name: Publish to GitHub Packages on: release: types: [created, published] workflow_dispatch: jobs: build-and-publish: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.9' - name: Install build dependencies run: | python -m pip install --upgrade pip pip install build twine - name: Build distribution packages run: python -m build - name: Publish to GitHub Packages run: | python -m twine upload dist/* \ --repository-url https://python.pkg.github.com/${{ github.repository_owner }} \ --username ${{ github.actor }} \ --password ${{ secrets.GITHUB_TOKEN }} \ --verbose