Skip to content

Commit 1754367

Browse files
authored
Add a PyPI-publishing job. (#99)
When a GH release is promoted from prerelease, this pulls its wheels and sdists and publishes them to PyPI.
1 parent 37cbeb1 commit 1754367

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# When you promote a GitHub prerelease to an actual release, publish its
2+
# artifacts to PyPI.
3+
4+
name: Publish to PyPI
5+
6+
on:
7+
release:
8+
types: [released]
9+
10+
jobs:
11+
publish:
12+
name: Publish promoted release to PyPI
13+
runs-on: ubuntu-24.04
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/fastly-compute
17+
permissions:
18+
id-token: write
19+
contents: read
20+
steps:
21+
- name: Download release assets
22+
env:
23+
GH_TOKEN: ${{ github.token }}
24+
TAG: ${{ github.event.release.tag_name }}
25+
REPO: ${{ github.repository }}
26+
run: |
27+
mkdir dist
28+
gh release download "$TAG" \
29+
--repo "$REPO" \
30+
--dir dist/ \
31+
--pattern '*.whl' \
32+
--pattern '*.tar.gz'
33+
- name: Publish dists to PyPI
34+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # @release/v1

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Package up release artifacts, and attach them to a new GitHub prerelease.
2+
13
name: Release
24

35
# Triggers:

0 commit comments

Comments
 (0)