Skip to content

Commit 7d9562d

Browse files
committed
cibuildwheel CI
1 parent c1453ab commit 7d9562d

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

.github/workflows/wheels.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Build wheels
2+
3+
on:
4+
push:
5+
branches: [main, dev, wheel]
6+
tags: ['*']
7+
pull_request:
8+
branches: [main, dev]
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build_sdist:
17+
name: Build & verify package
18+
runs-on: ubuntu-latest
19+
permissions:
20+
attestations: write
21+
id-token: write
22+
steps:
23+
- uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
- uses: hynek/build-and-inspect-python-package@v2
27+
with:
28+
attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
29+
skip-wheel: true
30+
31+
build_wheels:
32+
name: Build wheels on ${{ matrix.os }}
33+
runs-on: ${{ matrix.os }}
34+
strategy:
35+
matrix:
36+
os:
37+
- ubuntu-latest
38+
- ubuntu-24.04-arm
39+
- windows-latest
40+
- macos-13
41+
- macos-latest
42+
fail-fast: false
43+
permissions:
44+
attestations: write
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Build wheels
52+
uses: pypa/[email protected]
53+
54+
- name: Generate artifact attestation for wheels
55+
if: ${{ github.event_name != 'pull_request' }}
56+
uses: actions/attest-build-provenance@c074443f1aee8d4aeeae555aebba3282517141b2 # v2.2.3
57+
with:
58+
subject-path: "wheelhouse/bids_validator_deno-*.whl"
59+
60+
- uses: actions/upload-artifact@v4
61+
with:
62+
name: wheel-${{ matrix.os }}
63+
path: ./wheelhouse
64+
65+
test-publish:
66+
name: Push package to test.pypi.org
67+
# if: github.event_name == 'push'
68+
runs-on: ubuntu-latest
69+
needs: [build_sdist, build_wheels]
70+
# permissions:
71+
# id-token: write
72+
73+
steps:
74+
- name: Download sdist
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: Packages
78+
path: dist
79+
80+
- name: Download wheels
81+
uses: actions/download-artifact@v4
82+
with:
83+
name: wheel-*
84+
path: dist
85+
86+
- run: ls -lR
87+
88+
# - name: Upload package to PyPI
89+
# uses: pypa/gh-action-pypi-publish@release/v1
90+
# with:
91+
# repository-url: https://test.pypi.org/legacy/
92+
# skip-existing: true
93+
94+
publish:
95+
name: Publish released package to pypi.org
96+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
97+
runs-on: ubuntu-latest
98+
needs: [build_sdist, build_wheels]
99+
permissions:
100+
id-token: write
101+
102+
steps:
103+
- name: Download sdist
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: Packages
107+
path: dist
108+
109+
- name: Download wheels
110+
uses: actions/download-artifact@v4
111+
with:
112+
name: wheel-*
113+
path: dist
114+
115+
- name: Upload package to PyPI
116+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)