Skip to content

Publish Wheels to GitHub Packages #2

Publish Wheels to GitHub Packages

Publish Wheels to GitHub Packages #2

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/*