Skip to content

Commit 91395f4

Browse files
committed
publish tags
1 parent 14c302c commit 91395f4

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

.github/workflows/CI.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,17 @@ jobs:
3535
shell: bash -l {0}
3636
run: uv run pytest
3737

38-
build_and_publish:
39-
name: Build and Publish to PyPI
40-
needs: test
41-
if: startsWith(github.ref, 'refs/tags/') && github.event.head_commit.message != '[skip ci]'
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@v4
45-
- name: Set up Python 3.9
46-
uses: actions/setup-python@v5
47-
with:
48-
python-version: "3.9"
49-
- name: Install dependencies
50-
run: |
51-
python -m pip install --upgrade pip
52-
python -m pip install setuptools wheel
53-
python -m pip install twine
54-
- name: Build package
55-
run: |
56-
python -m pip install --upgrade pip
57-
pip install build
58-
python -m build
59-
- name: Publish distribution to PyPI
60-
uses: pypa/gh-action-pypi-publish@release/v1
61-
with:
62-
password: ${{ secrets.PYPI_API_TOKEN }}
38+
pypi-publish:
39+
name: upload release to PyPI
40+
runs-on: ubuntu-latest
41+
needs: test
42+
if: startsWith(github.ref, 'refs/tags/')
43+
environment: pypi
44+
permissions:
45+
# IMPORTANT: this permission is mandatory for Trusted Publishing
46+
id-token: write
47+
steps:
48+
# retrieve your distributions here
49+
50+
- name: Publish package distributions to PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)