Skip to content

Commit a8a3a86

Browse files
committed
Create release.yml
1 parent 3d236fc commit a8a3a86

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build & Publish Wheels + Source
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
build_wheels:
12+
name: Build wheels on ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
19+
20+
steps:
21+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
23+
- name: Set up Python 3.13
24+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
25+
with:
26+
python-version: "3.13"
27+
cache: "pip"
28+
29+
- name: Install uv
30+
uses: install-pinned/uv@b9511b633710c8bbe8ba48376771dba624746799 # 0.4.12
31+
32+
- name: Install dependencies
33+
run: |
34+
uv pip install --system -r requirements-dev.txt
35+
uv pip install --system -e .[all]
36+
37+
- name: Build src dist
38+
if: ${{ matrix.os == 'ubuntu-latest' }}
39+
run: |
40+
python -m build --sdist --outdir wheels parsons
41+
42+
- name: Build wheels
43+
run: git pull && python -m cibuildwheel parsons/ --output-dir wheels
44+
45+
# Save wheels as artifacts
46+
- name: Upload built wheels
47+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
48+
with:
49+
name: wheels-${{ matrix.os }}
50+
path: wheels
51+
52+
publish_wheels:
53+
if: github.repository_owner == 'move-coop'
54+
needs: build_wheels
55+
56+
runs-on: ubuntu-latest
57+
environment: release
58+
59+
permissions:
60+
# IMPORTANT: this permission is mandatory for trusted publishing
61+
id-token: write
62+
63+
steps:
64+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
65+
66+
- name: Download wheels
67+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
68+
with:
69+
pattern: wheels-*
70+
path: wheels
71+
merge-multiple: true
72+
73+
# Publish
74+
- name: Publish
75+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
76+
with:
77+
verify-metadata: true
78+
skip-existing: true
79+
packages-dir: wheels
80+
verbose: true

0 commit comments

Comments
 (0)