Skip to content

Commit 427e967

Browse files
authored
Publish to PyPI on release (#16)
1 parent 15025c0 commit 427e967

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

Diff for: .github/workflows/build.yml

+32-10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
- '**.rst'
1414
- 'docs/**'
1515

16+
release:
17+
types:
18+
- published
19+
1620
concurrency:
1721
group: ${{ github.workflow }}-${{ github.ref }}
1822
cancel-in-progress: true
@@ -21,20 +25,38 @@ jobs:
2125
build_wheels:
2226
strategy:
2327
matrix:
24-
os: ["ubuntu-20.04", "macos-11"]
28+
os: ["ubuntu-latest", "macos-latest"]
2529

2630
runs-on: ${{ matrix.os }}
31+
steps:
32+
- uses: actions/checkout@v3
33+
- run: make requirements c_lib
34+
- uses: pypa/[email protected]
35+
- uses: actions/upload-artifact@v3
36+
with:
37+
path: wheelhouse/*.whl
2738

39+
make_sdist:
40+
runs-on: "ubuntu-latest"
2841
steps:
2942
- uses: actions/checkout@v3
30-
- name: Install dependencies
31-
run: |
32-
make requirements c_lib
33-
- name: Build wheels
34-
uses: pypa/[email protected]
35-
- name: Upload packages
36-
if: github.event_name == 'push'
37-
uses: actions/upload-artifact@v3
43+
- run: |
44+
make requirements
45+
python -m build --no-isolation --sdist
46+
- uses: actions/upload-artifact@v3
47+
with:
48+
path: dist/*.tar.gz
49+
50+
upload_all:
51+
needs: [build_wheels, make_sdist]
52+
runs-on: "ubuntu-latest"
53+
environment: release
54+
if: github.event_name == 'release' && github.event.action == 'published'
55+
permissions:
56+
id-token: write
57+
steps:
58+
- uses: actions/download-artifact@v3
3859
with:
3960
name: ada-url-packages
40-
path: wheelhouse/*
61+
path: wheelhouse
62+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)