Skip to content

Commit 72a7426

Browse files
committed
Migrate release process to trusted publishing
1 parent 39de1b8 commit 72a7426

3 files changed

Lines changed: 9 additions & 477 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
environment: release
12+
if: github.ref == 'refs/heads/master'
13+
permissions:
14+
# IMPORTANT: this permission is mandatory for Trusted Publishing
15+
id-token: write
1116
steps:
1217
- uses: actions/checkout@v5
1318
with:
@@ -21,11 +26,9 @@ jobs:
2126
python -m pip install --upgrade pip
2227
pip install pipenv
2328
pipenv install --dev --deploy
24-
- name: Build and publish
25-
env:
26-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
27-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29+
- name: Build
2830
run: |
2931
pipenv run pytest
3032
pipenv run python setup.py bdist_wheel
31-
pipenv run twine upload dist/*
33+
- name: Publish package distributions to PyPI
34+
uses: pypa/gh-action-pypi-publish@release/v1

Pipfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ verify_ssl = true
66
[dev-packages]
77
pytest = "*"
88
wheel = "*"
9-
twine = "*"
109
setuptools = "*"
1110

1211
[dev-local]

0 commit comments

Comments
 (0)