1515 runs-on : ubuntu-latest
1616 strategy :
1717 matrix :
18- python-version : ["3.9", "3. 10", "3.11", "3.12", "3.13", "3.14"]
18+ python-version : ["3.10", "3.11", "3.12", "3.13", "3.14"]
1919
2020 steps :
2121 - uses : actions/checkout@v6
4747 runs-on : ubuntu-latest
4848 needs : test
4949 if : github.event_name == 'push' && github.ref == 'refs/heads/stable'
50+ permissions :
51+ contents : write
5052 steps :
53+ - name : Generate app token
54+ id : app-token
55+ uses : actions/create-github-app-token@v3
56+ with :
57+ app-id : ${{ secrets.CLOUDCHECK_APP_ID }}
58+ private-key : ${{ secrets.CLOUDCHECK_APP_PRIVATE_KEY }}
5159 - uses : actions/checkout@v6
60+ with :
61+ fetch-depth : 0
62+ token : ${{ steps.app-token.outputs.token }}
5263 - name : Set up Python
5364 uses : actions/setup-python@v6
5465 with :
@@ -57,10 +68,33 @@ jobs:
5768 uses : dtolnay/rust-toolchain@stable
5869 - name : Set up uv
5970 uses : astral-sh/setup-uv@v7
71+ - name : Get current version
72+ id : get_version
73+ run : |
74+ VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
75+ echo "VERSION=v${VERSION}" >> $GITHUB_OUTPUT
76+ - name : Check for version change
77+ id : version_check
78+ run : |
79+ git fetch --tags
80+ LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1) 2>/dev/null || echo "none")
81+ CURRENT="${{ steps.get_version.outputs.VERSION }}"
82+ if [ "$LATEST_TAG" = "$CURRENT" ]; then
83+ echo "changed=false" >> $GITHUB_OUTPUT
84+ else
85+ echo "changed=true" >> $GITHUB_OUTPUT
86+ fi
6087 - name : Build PyPi package
6188 run : uv run maturin build --release --out dist
6289 - name : Publish PyPi package
6390 run : uv run maturin publish --skip-existing --username __token__ --password ${{ secrets.PYPI_TOKEN }}
91+ - name : Tag release
92+ if : steps.version_check.outputs.changed == 'true'
93+ run : |
94+ git config user.name "github-actions[bot]"
95+ git config user.email "github-actions[bot]@users.noreply.github.com"
96+ git tag -a "${{ steps.get_version.outputs.VERSION }}" -m "Release ${{ steps.get_version.outputs.VERSION }}"
97+ git push origin "refs/tags/${{ steps.get_version.outputs.VERSION }}"
6498 linux :
6599 runs-on : ${{ matrix.platform.runner }}
66100 needs : publish
@@ -107,7 +141,7 @@ jobs:
107141 exit 1
108142 fi
109143 - name : Upload wheels
110- uses : actions/upload-artifact@v6
144+ uses : actions/upload-artifact@v7
111145 with :
112146 name : wheels-linux-${{ matrix.platform.target }}
113147 path : dist
@@ -157,7 +191,7 @@ jobs:
157191 fi
158192
159193 - name : Upload wheels
160- uses : actions/upload-artifact@v6
194+ uses : actions/upload-artifact@v7
161195 with :
162196 name : wheels-musllinux-${{ matrix.platform.target }}
163197 path : dist
@@ -186,7 +220,7 @@ jobs:
186220 args : --release --out dist --find-interpreter
187221 sccache : false
188222 - name : Upload wheels
189- uses : actions/upload-artifact@v6
223+ uses : actions/upload-artifact@v7
190224 with :
191225 name : wheels-windows-${{ matrix.platform.target }}
192226 path : dist
@@ -214,7 +248,7 @@ jobs:
214248 args : --release --out dist --find-interpreter
215249 sccache : false
216250 - name : Upload wheels
217- uses : actions/upload-artifact@v6
251+ uses : actions/upload-artifact@v7
218252 with :
219253 name : wheels-macos-${{ matrix.platform.target }}
220254 path : dist
@@ -231,7 +265,7 @@ jobs:
231265 command : sdist
232266 args : --out dist
233267 - name : Upload sdist
234- uses : actions/upload-artifact@v6
268+ uses : actions/upload-artifact@v7
235269 with :
236270 name : wheels-sdist
237271 path : dist
@@ -249,9 +283,9 @@ jobs:
249283 # Used to generate artifact attestation
250284 attestations : write
251285 steps :
252- - uses : actions/download-artifact@v7
286+ - uses : actions/download-artifact@v8
253287 - name : Generate artifact attestation
254- uses : actions/attest-build-provenance@v3
288+ uses : actions/attest-build-provenance@v4
255289 with :
256290 subject-path : ' wheels-*/*'
257291 - name : Publish to PyPI
0 commit comments