pycrucible 0.2.8__tar.gz → 0.2.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,292 @@
1
+ name: Build and Release PyCrucible (native)
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+ branches: [main]
8
+ release:
9
+ types: [created]
10
+
11
+ permissions:
12
+ contents: write
13
+
14
+ jobs:
15
+ test:
16
+ name: Run Tests (linux/x64)
17
+ runs-on: ubuntu-latest
18
+
19
+ steps:
20
+ - name: Checkout repository
21
+ uses: actions/checkout@v4
22
+
23
+ - name: Install Rust
24
+ uses: dtolnay/rust-toolchain@stable
25
+
26
+ - name: Cache Cargo dependencies
27
+ uses: actions/cache@v4
28
+ with:
29
+ path: |
30
+ ~/.cargo/bin
31
+ ~/.cargo/registry
32
+ ~/.cargo/git
33
+ target
34
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
35
+
36
+ - name: Run tests
37
+ run: cargo test --verbose
38
+
39
+ build:
40
+ name: Build ${{ matrix.target }}
41
+ if: github.event_name == 'release'
42
+ needs: test
43
+ runs-on: ${{ matrix.runner }}
44
+
45
+ strategy:
46
+ fail-fast: false
47
+ matrix:
48
+ include:
49
+ # ----- Linux -----
50
+ - runner: ubuntu-latest
51
+ target: x86_64-unknown-linux-gnu
52
+ bin_ext: ""
53
+ - runner: ubuntu-24.04-arm
54
+ target: aarch64-unknown-linux-gnu
55
+ bin_ext: ""
56
+ # ----- Windows -----
57
+ - runner: windows-latest
58
+ target: x86_64-pc-windows-msvc
59
+ bin_ext: ".exe"
60
+ - runner: windows-11-arm
61
+ target: aarch64-pc-windows-msvc
62
+ bin_ext: ".exe"
63
+ # ----- macOS -----
64
+ - runner: macos-13
65
+ target: x86_64-apple-darwin
66
+ bin_ext: ""
67
+ - runner: macos-14
68
+ target: aarch64-apple-darwin
69
+ bin_ext: ""
70
+ steps:
71
+ - name: Checkout repository
72
+ uses: actions/checkout@v4
73
+
74
+ - name: Install Rust
75
+ uses: dtolnay/rust-toolchain@stable
76
+ with:
77
+ targets: ${{ matrix.target }}
78
+
79
+ - name: Cache Cargo dependencies
80
+ uses: actions/cache@v4
81
+ with:
82
+ path: |
83
+ ~/.cargo/bin
84
+ ~/.cargo/registry
85
+ ~/.cargo/git
86
+ target
87
+ key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
88
+
89
+ - name: Build
90
+ run: cargo build --release --target ${{ matrix.target }}
91
+
92
+ - name: Package binary
93
+ shell: bash
94
+ run: |
95
+ VERSION=${{ github.ref_name }}
96
+ BIN_NAME=pycrucible${{ matrix.bin_ext }}
97
+ OUT_NAME=pycrucible_${VERSION}_${{ matrix.target }}${{ matrix.bin_ext }}
98
+ cp target/${{ matrix.target }}/release/$BIN_NAME $OUT_NAME
99
+ echo "OUT_NAME=$OUT_NAME" >> $GITHUB_ENV
100
+
101
+ - name: Upload artifact
102
+ uses: actions/upload-artifact@v4
103
+ with:
104
+ name: ${{ env.OUT_NAME }}
105
+ path: ${{ env.OUT_NAME }}
106
+
107
+ run_test_app:
108
+ name: Smoke Test PyCrucible
109
+ if: github.event_name == 'release'
110
+ needs: build
111
+ runs-on: ${{ matrix.runner }}
112
+ strategy:
113
+ fail-fast: false
114
+ matrix:
115
+ include:
116
+ # ----- Linux -----
117
+ - runner: ubuntu-latest
118
+ target: x86_64-unknown-linux-gnu
119
+ bin_ext: ""
120
+ - runner: ubuntu-24.04-arm
121
+ target: aarch64-unknown-linux-gnu
122
+ bin_ext: ""
123
+ # ----- Windows -----
124
+ - runner: windows-latest
125
+ target: x86_64-pc-windows-msvc
126
+ bin_ext: ".exe"
127
+ - runner: windows-11-arm
128
+ target: aarch64-pc-windows-msvc
129
+ bin_ext: ".exe"
130
+ # ----- macOS -----
131
+ - runner: macos-13
132
+ target: x86_64-apple-darwin
133
+ bin_ext: ""
134
+ - runner: macos-14
135
+ target: aarch64-apple-darwin
136
+ bin_ext: ""
137
+
138
+ steps:
139
+ - name: Download build artifacts
140
+ uses: actions/download-artifact@v4
141
+
142
+ - name: Clone example project
143
+ run: git clone https://github.com/JamesParrott/simple-python-project-for-PyCrucible
144
+
145
+ - name: Copy PyCrucible binary into example project
146
+ shell: bash
147
+ run: cp ./pycrucible_*/* simple-python-project-for-PyCrucible
148
+
149
+ - name: Make binary executable (linux)
150
+ if: runner.os != 'Windows'
151
+ run: chmod +x simple-python-project-for-PyCrucible/pycrucible_*
152
+
153
+ - name: Run PyCrucible
154
+ working-directory: simple-python-project-for-PyCrucible
155
+ run: |
156
+ ./pycrucible_${{ github.ref_name }}_${{ matrix.target }}${{ matrix.bin_ext }} -e . -o cowsay${{ matrix.bin_ext }} --debug
157
+
158
+ - name: Smoke-test generated artifact
159
+ working-directory: simple-python-project-for-PyCrucible
160
+ run: ./cowsay${{ matrix.bin_ext }}
161
+
162
+ build_sdist:
163
+ name: Build sdist for PyPI
164
+ if: github.event_name == 'release'
165
+ needs: [build, run_test_app]
166
+ runs-on: ubuntu-latest
167
+
168
+ steps:
169
+ - name: Checkout repository
170
+ uses: actions/checkout@v4
171
+
172
+ - name: Install Python
173
+ uses: actions/setup-python@v5
174
+ with:
175
+ python-version: '3.12'
176
+
177
+ - name: Install dependencies
178
+ run: |
179
+ python -m pip install --upgrade pip
180
+ pip install maturin
181
+
182
+ - name: Build sdist
183
+ run: |
184
+ maturin sdist --out dist
185
+
186
+ - name: Upload sdist as artifact
187
+ uses: actions/upload-artifact@v4
188
+ with:
189
+ name: sdist
190
+ path: dist/*.tar.gz
191
+
192
+
193
+ build_wheels:
194
+ name: Build wheels for PyPI
195
+ if: github.event_name == 'release'
196
+ needs: [build, run_test_app]
197
+ runs-on: ${{ matrix.runner }}
198
+ strategy:
199
+ matrix:
200
+ include:
201
+ - runner: ubuntu-latest
202
+ target: x86_64-unknown-linux-gnu
203
+ - runner: windows-latest
204
+ target: x86_64-pc-windows-msvc
205
+ - runner: macos-13
206
+ target: x86_64-apple-darwin
207
+ steps:
208
+ - name: Checkout repository
209
+ uses: actions/checkout@v4
210
+
211
+ - name: Install Python
212
+ uses: actions/setup-python@v5
213
+ with:
214
+ python-version: '3.12'
215
+
216
+ - name: Install Rust
217
+ uses: dtolnay/rust-toolchain@stable
218
+ with:
219
+ targets: ${{ matrix.target }}
220
+
221
+ - name: Install dependencies
222
+ run: |
223
+ python -m pip install --upgrade pip
224
+ pip install maturin
225
+
226
+ - name: Install patchelf (Linux only)
227
+ if: runner.os == 'Linux'
228
+ run: sudo apt-get update && sudo apt-get install -y patchelf
229
+
230
+ - name: Build wheel
231
+ run: |
232
+ maturin build --release --out dist --target ${{ matrix.target }}
233
+
234
+ - name: Upload wheel artifact
235
+ uses: actions/upload-artifact@v4
236
+ with:
237
+ name: wheel-${{ matrix.target }}
238
+ path: dist/*.whl
239
+
240
+
241
+
242
+ release_to_pypi:
243
+ name: Upload release to PyPI
244
+ if: startsWith(github.ref, 'refs/tags/')
245
+ runs-on: ubuntu-latest
246
+ needs: [build_sdist, build_wheels]
247
+
248
+ environment:
249
+ name: pypi
250
+ url: https://pypi.org/p/pycrucible/
251
+ permissions:
252
+ id-token: write
253
+
254
+ steps:
255
+ - name: Download all artifacts
256
+ uses: actions/download-artifact@v4
257
+ with:
258
+ path: dist
259
+ merge-multiple: true
260
+
261
+ - name: Remove non-PyPI files
262
+ run: |
263
+ find dist -type f ! -name "*.whl" ! -name "*.tar.gz" -delete
264
+
265
+ - name: List files
266
+ run: ls -R dist
267
+
268
+ - name: Publish to PyPI
269
+ uses: pypa/gh-action-pypi-publish@release/v1
270
+ with:
271
+ skip-existing: true
272
+ packages-dir: dist/
273
+ continue-on-error: false
274
+
275
+
276
+ release_to_gh:
277
+ name: Publish Release to GitHub
278
+ if: github.event_name == 'release'
279
+ needs: [build, run_test_app]
280
+ runs-on: ubuntu-latest
281
+
282
+ steps:
283
+ - name: Download build artifacts
284
+ uses: actions/download-artifact@v4
285
+
286
+ - name: Upload binaries to GitHub Release
287
+ uses: softprops/action-gh-release@v1
288
+ with:
289
+ files: |
290
+ **/pycrucible_*
291
+ env:
292
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,2 @@
1
+ /target
2
+ /test