Skip to content

Commit 1df839c

Browse files
authored
Merge pull request #669 from aai-institute/feature/pypa-action
Switch to trusted publishing for pypi
2 parents a845959 + afc7069 commit 1df839c

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

.github/workflows/publish.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ env:
2323
jobs:
2424
publish:
2525
runs-on: ubuntu-22.04
26+
environment:
27+
name: publish
28+
url: https://pypi.org/pydvl
2629
concurrency:
2730
group: publish
31+
permissions:
32+
id-token: write
2833
steps:
2934
- name: Checking out last commit in release
3035
if: ${{ github.event_name != 'workflow_dispatch' }}
@@ -54,6 +59,14 @@ jobs:
5459
# Make the version available as env variable for next steps
5560
echo CURRENT_VERSION=$CURRENT_VERSION >> $GITHUB_ENV
5661
shell: bash
62+
- name: Build dist
63+
run: |
64+
python setup.py sdist bdist_wheel
65+
- name: Publish to PyPI
66+
uses: pypa/gh-action-pypi-publish@release/v1
67+
with:
68+
verbose: true
69+
print-hash: true
5770
- name: Deploy Docs
5871
uses: ./.github/actions/deploy-docs
5972
with:
@@ -63,10 +76,3 @@ jobs:
6376
email: ${{ env.GITHUB_BOT_EMAIL }}
6477
username: ${{ env.GITHUB_BOT_USERNAME }}
6578
set-default: 'true'
66-
- name: Build and publish to PyPI
67-
env:
68-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
69-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
70-
run: |
71-
python setup.py sdist bdist_wheel
72-
twine upload --verbose --non-interactive dist/*

requirements-dev.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ pytest-sugar
1818
pytest-rerunfailures
1919
nbmake
2020
wheel
21-
twine==5.1.1

0 commit comments

Comments
 (0)