Skip to content

Commit 0297bfa

Browse files
committed
cibuildwheel CI
1 parent c1453ab commit 0297bfa

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

.github/workflows/wheels.yml

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

0 commit comments

Comments
 (0)