diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5402100..047df8a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,9 @@ on: types: [created] branches: - 'master' + # Manual re-publish/backfill: run from a tag to rebuild and upload any + # files missing on PyPI for that version (skip-existing keeps the rest). + workflow_dispatch: jobs: build: @@ -28,18 +31,22 @@ jobs: - name: Upload build artifacts uses: actions/upload-artifact@v4 with: + name: dist-packages path: 'dist/*' + if-no-files-found: error upload_pypi: name: Upload packages needs: ['build'] runs-on: 'ubuntu-latest' - if: github.event_name == 'release' && github.event.action == 'created' + if: >- + (github.event_name == 'release' && github.event.action == 'created') + || github.event_name == 'workflow_dispatch' steps: - name: Download artifacts uses: actions/download-artifact@v4 with: - name: artifact + name: dist-packages path: dist - name: Publish package to PyPI @@ -47,3 +54,4 @@ jobs: with: user: '__token__' password: '${{ secrets.PYPI_API_TOKEN }}' + skip-existing: true diff --git a/scripts/build.sh b/scripts/build.sh index 43c74ec..d028a86 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,5 +2,5 @@ set -x -python3 -m build . --wheel +python3 -m build . twine check dist/*