Skip to content

Commit 2430022

Browse files
authored
fix version check and release in CI (#310)
1 parent cd820f3 commit 2430022

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ jobs:
201201

202202
- name: check GITHUB_REF matches package version
203203
uses: samuelcolvin/check-python-version@v4.1
204-
if: "startsWith(github.ref, 'refs/tags/')"
204+
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu' }}
205205
with:
206206
version_file_path: Cargo.toml
207207

@@ -286,17 +286,14 @@ jobs:
286286
needs: [build, check, docs]
287287
if: "success() && startsWith(github.ref, 'refs/tags/')"
288288
runs-on: ubuntu-latest
289+
environment: release
290+
291+
permissions:
292+
id-token: write
289293

290294
steps:
291295
- uses: actions/checkout@v4
292296

293-
- name: set up python
294-
uses: actions/setup-python@v5
295-
with:
296-
python-version: '3.10'
297-
298-
- run: pip install twine
299-
300297
- name: get dist artifacts
301298
uses: actions/download-artifact@v4
302299
with:
@@ -310,13 +307,10 @@ jobs:
310307
name: docs
311308
path: site
312309

313-
- run: twine check dist/*
314-
315-
- name: upload to pypi
316-
run: twine upload dist/*
317-
env:
318-
TWINE_USERNAME: __token__
319-
TWINE_PASSWORD: ${{ secrets.pypi_token }}
310+
- name: Publish to PyPI
311+
uses: pypa/gh-action-pypi-publish@release/v1
312+
with:
313+
skip-existing: true
320314

321315
- name: publish docs
322316
uses: JamesIves/github-pages-deploy-action@v4.2.5

0 commit comments

Comments
 (0)