@@ -33,18 +33,19 @@ jobs:
3333 - name : Install UV
3434 uses : astral-sh/setup-uv@v4
3535 with :
36- version : " latest "
36+ version : " ${{ needs.prepare-environment.outputs.UV_VERSION }} "
3737
3838 - name : Install dependencies
3939 run : uv sync
4040
4141 - name : Check prerelease type
4242 id : release
4343 run : |
44- echo is_prerelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\")').is_prerelease))") >> "$GITHUB_OUTPUT"
45- echo is_devrelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\")').is_devrelease))") >> "$GITHUB_OUTPUT"
46- echo "version=$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\"))" >> "$GITHUB_OUTPUT"
47- echo major_minor_version=$(uv run python -c "from packaging.version import Version; print(f\"{Version('$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\")').major}.{Version('$(uv run python -c \"import tomllib; print(tomllib.load(open(\"pyproject.toml\", \"rb\"))[\"project\"][\"version\"])\")').minor}\")") >> "$GITHUB_OUTPUT"
44+ VERSION=$(uv run python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
45+ echo is_prerelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$VERSION').is_prerelease))") >> "$GITHUB_OUTPUT"
46+ echo is_devrelease=$(uv run python -c "from packaging.version import Version; print(int(Version('$VERSION').is_devrelease))") >> "$GITHUB_OUTPUT"
47+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
48+ echo major_minor_version=$(uv run python -c "from packaging.version import Version; v = Version('$VERSION'); print(f'{v.major}.{v.minor}')") >> "$GITHUB_OUTPUT"
4849 echo latest_tag=$(curl -L \
4950 -H "Accept: application/vnd.github+json" \
5051 -H "Authorization: Bearer ${{ github.token }}" \
@@ -53,10 +54,14 @@ jobs:
5354 | jq -r '.tag_name') >> "$GITHUB_OUTPUT"
5455
5556 - name : Check tag version
56- if : github.event.release.tag_name != format('v{0}', steps.release.outputs.version)
5757 run : |
58- echo "Tag version does not match python project version"
59- exit 1
58+ EXPECTED_TAG="v${{ steps.release.outputs.version }}"
59+ if [ "${{ github.event.release.tag_name }}" != "$EXPECTED_TAG" ]; then
60+ echo "Tag version does not match python project version"
61+ echo "Expected: $EXPECTED_TAG"
62+ echo "Got: ${{ github.event.release.tag_name }}"
63+ exit 1
64+ fi
6065
6166 - name : Check prerelease and project version
6267 if : github.event.release.prerelease == true && steps.release.outputs.is_prerelease == 0 && steps.release.outputs.is_devrelease == 0
0 commit comments