diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f9d3928 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +# When you promote a GitHub prerelease to an actual release, publish its +# artifacts to PyPI. + +name: Publish to PyPI + +on: + release: + types: [released] + +jobs: + publish: + name: Publish promoted release to PyPI + runs-on: ubuntu-24.04 + environment: + name: pypi + url: https://pypi.org/p/fastly-compute + permissions: + id-token: write + contents: read + steps: + - name: Download release assets + env: + GH_TOKEN: ${{ github.token }} + TAG: ${{ github.event.release.tag_name }} + REPO: ${{ github.repository }} + run: | + mkdir dist + gh release download "$TAG" \ + --repo "$REPO" \ + --dir dist/ \ + --pattern '*.whl' \ + --pattern '*.tar.gz' + - name: Publish dists to PyPI + uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # @release/v1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3bcd404..671f38e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,3 +1,5 @@ +# Package up release artifacts, and attach them to a new GitHub prerelease. + name: Release # Triggers: