Publish Wheels to GitHub Packages #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Publish Wheels to GitHub Packages | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag to pull wheels from' | |
| required: true | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: { python-version: '3.12' } | |
| - name: Download wheels | |
| uses: robinraju/[email protected] | |
| with: | |
| repository: ${{ github.repository }} | |
| tag: ${{ github.event.inputs.tag }} | |
| fileName: '*.whl' | |
| out-file-path: 'dist' | |
| - name: Publish to GitHub Packages | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| python -m pip install --upgrade pip twine | |
| python -m twine upload \ | |
| --repository-url https://api.github.com/orgs/${{ github.repository_owner }}/packages/pypi/upload \ | |
| dist/* |