|
1 |
| -# This file is autogenerated by maturin v1.8.1 |
2 |
| -# To update, run |
3 |
| -# |
4 |
| -# maturin generate-ci github |
5 |
| -# |
6 |
| -name: truss-transfer-build-maturin |
| 1 | +name: Build and Release truss-transfer |
7 | 2 |
|
8 | 3 | on:
|
9 | 4 | push:
|
|
13 | 8 | paths:
|
14 | 9 | - "truss-transfer/**"
|
15 | 10 | tags:
|
16 |
| - - "*" # Still runs on all tags regardless of directory changes |
| 11 | + - "*" |
17 | 12 | pull_request:
|
18 | 13 | paths:
|
19 | 14 | - "truss-transfer/**"
|
20 | 15 | workflow_dispatch:
|
21 |
| - |
22 |
| -permissions: |
23 |
| - contents: read |
| 16 | + inputs: |
| 17 | + publish_pypi: |
| 18 | + description: "Publish to PyPI? (true/false)" |
| 19 | + required: false |
| 20 | + default: "false" |
24 | 21 |
|
25 | 22 | jobs:
|
26 |
| - linux: |
27 |
| - runs-on: ${{ matrix.platform.runner }} |
28 |
| - strategy: |
29 |
| - matrix: |
30 |
| - platform: |
31 |
| - - runner: ubuntu-22.04 |
32 |
| - target: x86_64 |
33 |
| - - runner: ubuntu-22.04 |
34 |
| - target: x86 |
35 |
| - - runner: ubuntu-22.04 |
36 |
| - target: aarch64 |
37 |
| - - runner: ubuntu-22.04 |
38 |
| - target: armv7 |
39 |
| - # - runner: ubuntu-22.04 |
40 |
| - # target: s390x |
41 |
| - - runner: ubuntu-22.04 |
42 |
| - target: ppc64le |
43 |
| - steps: |
44 |
| - - uses: actions/checkout@v4 |
45 |
| - - uses: actions/setup-python@v5 |
46 |
| - with: |
47 |
| - python-version: 3.x |
48 |
| - - name: Build wheels |
49 |
| - uses: PyO3/maturin-action@v1 |
50 |
| - with: |
51 |
| - working-directory: truss-transfer |
52 |
| - target: ${{ matrix.platform.target }} |
53 |
| - args: --release --out dist --find-interpreter |
54 |
| - sccache: "false" |
55 |
| - manylinux: auto |
56 |
| - before-script-linux: | |
57 |
| - if command -v apt-get &> /dev/null; then |
58 |
| - apt-get update && apt-get install libssl-dev libatomic-ops-dev -y |
59 |
| - elif command -v yum &> /dev/null; then |
60 |
| - yum install openssl-devel devtoolset-10-libatomic-devel perl-IPC-Cmd -y |
61 |
| - else |
62 |
| - echo "Neither apt-get nor yum is installed. Please install a package manager." |
63 |
| - exit 1 |
64 |
| - fi |
65 |
| - - name: Build free-threaded wheels |
66 |
| - uses: PyO3/maturin-action@v1 |
67 |
| - if: ${{ matrix.platform.target != 'aarch64' || matrix.platform.target != 'armv7' }} |
68 |
| - with: |
69 |
| - working-directory: truss-transfer |
70 |
| - target: ${{ matrix.platform.target }} |
71 |
| - args: --release --out dist -i python3.13t |
72 |
| - sccache: "false" |
73 |
| - manylinux: auto |
74 |
| - docker-options: > |
75 |
| - ${{ matrix.platform.target == 'armv7' && '--env RING_PREGENERATE_ASM=false' || '' }} |
76 |
| - before-script-linux: | |
77 |
| - if command -v apt-get &> /dev/null; then |
78 |
| - apt-get update && apt-get install libssl-dev libatomic-ops-dev -y |
79 |
| - elif command -v yum &> /dev/null; then |
80 |
| - yum install openssl-devel devtoolset-10-libatomic-devel perl-IPC-Cmd -y |
81 |
| - else |
82 |
| - echo "Neither apt-get nor yum is installed. Please install a package manager." |
83 |
| - exit 1 |
84 |
| - fi |
85 |
| - - name: Upload wheels |
86 |
| - uses: actions/upload-artifact@v4 |
87 |
| - with: |
88 |
| - name: wheels-linux-${{ matrix.platform.target }} |
89 |
| - path: truss-transfer/dist |
90 |
| - |
91 |
| - musllinux: |
92 |
| - runs-on: ${{ matrix.platform.runner }} |
93 |
| - strategy: |
94 |
| - matrix: |
95 |
| - platform: |
96 |
| - - runner: ubuntu-22.04 |
97 |
| - target: x86_64 |
98 |
| - - runner: ubuntu-22.04 |
99 |
| - target: x86 |
100 |
| - - runner: ubuntu-22.04 |
101 |
| - target: aarch64 |
102 |
| - - runner: ubuntu-22.04 |
103 |
| - target: armv7 |
104 |
| - steps: |
105 |
| - - uses: actions/checkout@v4 |
106 |
| - - uses: actions/setup-python@v5 |
107 |
| - with: |
108 |
| - python-version: 3.x |
109 |
| - - name: Build wheels |
110 |
| - uses: PyO3/maturin-action@v1 |
111 |
| - with: |
112 |
| - working-directory: truss-transfer |
113 |
| - target: ${{ matrix.platform.target }} |
114 |
| - args: --release --out dist --find-interpreter |
115 |
| - sccache: "false" |
116 |
| - manylinux: musllinux_1_2 |
117 |
| - - name: Build free-threaded wheels |
118 |
| - uses: PyO3/maturin-action@v1 |
119 |
| - with: |
120 |
| - working-directory: truss-transfer |
121 |
| - target: ${{ matrix.platform.target }} |
122 |
| - args: --release --out dist -i python3.13t |
123 |
| - sccache: "false" |
124 |
| - manylinux: musllinux_1_2 |
125 |
| - - name: Upload wheels |
126 |
| - uses: actions/upload-artifact@v4 |
127 |
| - with: |
128 |
| - name: wheels-musllinux-${{ matrix.platform.target }} |
129 |
| - path: truss-transfer/dist |
130 |
| - |
131 |
| - windows: |
132 |
| - runs-on: ${{ matrix.platform.runner }} |
133 |
| - strategy: |
134 |
| - matrix: |
135 |
| - platform: |
136 |
| - - runner: windows-latest |
137 |
| - target: x64 |
138 |
| - - runner: windows-latest |
139 |
| - target: x86 |
140 |
| - steps: |
141 |
| - - uses: actions/checkout@v4 |
142 |
| - - uses: actions/setup-python@v5 |
143 |
| - with: |
144 |
| - python-version: 3.x |
145 |
| - architecture: ${{ matrix.platform.target }} |
146 |
| - - name: Build wheels |
147 |
| - uses: PyO3/maturin-action@v1 |
148 |
| - with: |
149 |
| - working-directory: truss-transfer |
150 |
| - target: ${{ matrix.platform.target }} |
151 |
| - args: --release --out dist --find-interpreter |
152 |
| - sccache: "false" |
153 |
| - # - name: Build free-threaded wheels |
154 |
| - # uses: PyO3/maturin-action@v1 |
155 |
| - # with: |
156 |
| - # target: ${{ matrix.platform.target }} |
157 |
| - # args: --release --out dist -i python3.13t |
158 |
| - # sccache: 'false' |
159 |
| - # working-directory: truss-transfer |
160 |
| - - name: Upload wheels |
161 |
| - uses: actions/upload-artifact@v4 |
162 |
| - with: |
163 |
| - name: wheels-windows-${{ matrix.platform.target }} |
164 |
| - path: truss-transfer/dist |
165 |
| - |
166 |
| - macos: |
167 |
| - runs-on: ${{ matrix.platform.runner }} |
168 |
| - strategy: |
169 |
| - matrix: |
170 |
| - platform: |
171 |
| - - runner: macos-13 |
172 |
| - target: x86_64 |
173 |
| - - runner: macos-14 |
174 |
| - target: aarch64 |
175 |
| - steps: |
176 |
| - - uses: actions/checkout@v4 |
177 |
| - - uses: actions/setup-python@v5 |
178 |
| - with: |
179 |
| - python-version: 3.x |
180 |
| - - name: Build wheels |
181 |
| - uses: PyO3/maturin-action@v1 |
182 |
| - with: |
183 |
| - working-directory: truss-transfer |
184 |
| - target: ${{ matrix.platform.target }} |
185 |
| - args: --release --out dist --find-interpreter |
186 |
| - sccache: "false" |
187 |
| - - name: Build free-threaded wheels |
188 |
| - uses: PyO3/maturin-action@v1 |
189 |
| - with: |
190 |
| - working-directory: truss-transfer |
191 |
| - target: ${{ matrix.platform.target }} |
192 |
| - args: --release --out dist -i python3.13t |
193 |
| - sccache: "false" |
194 |
| - - name: Upload wheels |
195 |
| - uses: actions/upload-artifact@v4 |
196 |
| - with: |
197 |
| - name: wheels-macos-${{ matrix.platform.target }} |
198 |
| - path: truss-transfer/dist |
199 |
| - |
200 |
| - sdist: |
201 |
| - runs-on: ubuntu-latest |
202 |
| - steps: |
203 |
| - - uses: actions/checkout@v4 |
204 |
| - - name: Build sdist |
205 |
| - uses: PyO3/maturin-action@v1 |
206 |
| - with: |
207 |
| - working-directory: truss-transfer |
208 |
| - command: sdist |
209 |
| - args: --out dist |
210 |
| - - name: Upload sdist |
211 |
| - uses: actions/upload-artifact@v4 |
212 |
| - with: |
213 |
| - name: wheels-sdist |
214 |
| - path: truss-transfer/dist |
215 |
| - |
216 |
| - release: |
217 |
| - name: Release |
218 |
| - runs-on: ubuntu-latest |
219 |
| - if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} |
220 |
| - needs: [linux, musllinux, windows, macos, sdist] |
221 |
| - permissions: |
222 |
| - # Use to sign the release artifacts |
223 |
| - id-token: write |
224 |
| - # Used to upload release artifacts |
225 |
| - contents: write |
226 |
| - # Used to generate artifact attestation |
227 |
| - attestations: write |
228 |
| - steps: |
229 |
| - - uses: actions/download-artifact@v4 |
230 |
| - - name: Generate artifact attestation |
231 |
| - uses: actions/attest-build-provenance@v1 |
232 |
| - with: |
233 |
| - subject-path: "wheels-*/*" |
234 |
| - - name: Publish to PyPI |
235 |
| - if: ${{ startsWith(github.ref, 'refs/tags/') }} |
236 |
| - uses: PyO3/maturin-action@v1 |
237 |
| - env: |
238 |
| - MATURIN_PYPI_TOKEN: ${{ secrets.TRUSS_TRANSFER_PYPI_API_TOKEN }} |
239 |
| - with: |
240 |
| - command: upload |
241 |
| - args: --non-interactive --skip-existing wheels-*/* |
| 23 | + build-package: |
| 24 | + uses: ./.github/workflows/build-maturin.yml |
| 25 | + with: |
| 26 | + folder: truss-transfer |
| 27 | + publish_pypi: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.publish_pypi == 'true' || startsWith(github.ref, 'refs/tags/') }} |
| 28 | + secrets: |
| 29 | + PYPI_TOKEN: ${{ secrets.TRUSS_TRANSFER_PYPI_API_TOKEN }} |
0 commit comments