Skip to content

Commit

Permalink
Pypi no longer allows username/password publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
heerener committed Dec 6, 2024
1 parent 05b3c7b commit ea021a1
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/publish_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,24 @@ jobs:
cd $GITHUB_WORKSPACE
pip3 install tox
DIST_FILE=`ls dist/*whl` && tox --installpkg=$DIST_FILE -e ${{ matrix.python_version }}
pypi-publish:
runs-on: ubuntu-22.04
# IMPORTANT: this permission is mandatory for trusted publishing
permissions:
id-token: write
steps:
- name: Download artifacts produced by the Build Wheel job
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Display structure of downloaded files
run: ls -R
working-directory: dist

- name: Upload Wheel
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
env:
PYPI_URL: ${{ secrets.PYPI_URL }}
PYPI_USER: ${{ secrets.PYPI_USER }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
pip3 install twine
python${{ matrix.python_version }} -m twine upload --username $PYPI_USER --password $PYPI_TOKEN dist/*
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist/

0 comments on commit ea021a1

Please sign in to comment.