-
Notifications
You must be signed in to change notification settings - Fork 120
804 lines (743 loc) · 26.4 KB
/
release.yml
File metadata and controls
804 lines (743 loc) · 26.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
name: Release
on:
push:
branches: ["main"]
env:
BUILD_TYPE: Release
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
PYTHONUTF8: 1
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
packages: write
jobs:
versioning:
name: Update Version
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
persist-credentials: false
- name: Run TinySemVer
uses: ashvardanian/tinysemver@v2.1.1
with:
verbose: "true"
version-file: "VERSION"
update-version-in: |
Cargo.toml:^version = "(\d+\.\d+\.\d+)"
Cargo.lock:name = "stringzilla"\nversion = "(\d+\.\d+\.\d+)"
package.json:"version": "(\d+\.\d+\.\d+)"
CMakeLists.txt:VERSION (\d+\.\d+\.\d+)
update-major-version-in: |
include/stringzilla/stringzilla.h:^#define STRINGZILLA_H_VERSION_MAJOR (\d+)
update-minor-version-in: |
include/stringzilla/stringzilla.h:^#define STRINGZILLA_H_VERSION_MINOR (\d+)
update-patch-version-in: |
include/stringzilla/stringzilla.h:^#define STRINGZILLA_H_VERSION_PATCH (\d+)
dry-run: "false"
push: "true"
create-release: "true"
github-token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
rebase:
name: Rebase Dev. Branch
runs-on: ubuntu-24.04
if: github.ref == 'refs/heads/main'
needs: versioning
steps:
- name: Checkout the latest code
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
- name: Perform rebase
run: |
git fetch origin main
git checkout main-dev
git rebase origin/main
- name: Push changes
uses: CasperWA/push-protected@v2
with:
token: ${{ secrets.SEMANTIC_REBASE_TOKEN }}
branch: main-dev
unprotect_reviews: True
force: True
build_wheels_stringzilla_linux:
name: Build StringZilla ${{ matrix.python-version }} for Ubuntu
runs-on: ubuntu-24.04
needs: versioning
strategy:
fail-fast: false
matrix:
python-version: ["38", "39", "310", "311", "312", "313"]
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
CIBW_ENVIRONMENT_LINUX: SZ_IS_QEMU_=1 # When emulating this will disable some tricky SIMD instructions
SZ_TARGET: stringzilla
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzilla-ubuntu-24.04-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true
build_wheels_stringzilla_macos:
name: Build StringZilla ${{ matrix.python-version }} for macOS
runs-on: macos-15
needs: versioning
strategy:
fail-fast: false
matrix:
python-version: ["38", "39", "310", "311", "312", "313"]
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
MACOSX_DEPLOYMENT_TARGET: "11.0"
SZ_TARGET: stringzilla
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzilla-macos-15-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true
build_wheels_stringzilla_windows:
name: Build StringZilla ${{ matrix.python-version }} for Windows
runs-on: windows-2022
needs: versioning
strategy:
fail-fast: false
matrix:
python-version: ["38", "39", "310", "311", "312", "313"]
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
SZ_TARGET: stringzilla
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzilla-windows-2022-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true
build_wheels_stringzillas_cpus_linux:
name: Build StringZillas-CPUs ${{ matrix.python-version }} for Ubuntu
runs-on: ubuntu-24.04
needs: versioning
strategy:
fail-fast: false
matrix:
python-version: ["38", "39", "310", "311", "312", "313"]
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
CIBW_ENVIRONMENT_LINUX: SZ_IS_QEMU_=1 SZ_TARGET=stringzillas-cpus # When emulating this will disable some tricky SIMD instructions
SZ_TARGET: stringzillas-cpus
CIBW_ARCHS_LINUX: x86_64 aarch64 # Limit to 64-bit architectures only
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzillas-cpus-ubuntu-24.04-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true
build_wheels_stringzillas_cpus_macos:
name: Build StringZillas-CPUs ${{ matrix.python-version }} for macOS
runs-on: macos-15
needs: versioning
strategy:
fail-fast: false
matrix:
python-version: ["38", "39", "310", "311", "312", "313"]
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
MACOSX_DEPLOYMENT_TARGET: "11.0"
SZ_TARGET: stringzillas-cpus
CIBW_ARCHS_MACOS: x86_64 arm64
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzillas-cpus-macos-15-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true
build_wheels_stringzillas_cpus_windows:
name: Build StringZillas-CPUs ${{ matrix.python-version }} for Windows
runs-on: windows-2022
needs: versioning
strategy:
fail-fast: false
matrix:
python-version: ["38", "39", "310", "311", "312", "313"]
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
SZ_TARGET: stringzillas-cpus
CIBW_ARCHS_WINDOWS: AMD64 ARM64
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzillas-cpus-windows-2022-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true
build_wheels_stringzillas_cuda_linux:
name: Build StringZillas-CUDA ${{ matrix.python-version }} for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: versioning
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04] # Linux only
python-version: ["38", "39", "310", "311", "312", "313"]
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.3
- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp${{ matrix.python-version }}-*
CIBW_ENVIRONMENT_LINUX: SZ_IS_QEMU_=1 SZ_TARGET=stringzillas-cuda PATH=/usr/local/cuda-12.9/bin:$PATH LD_LIBRARY_PATH=/usr/local/cuda-12.9/lib64:$LD_LIBRARY_PATH CUDA_HOME=/usr/local/cuda-12.9
CIBW_BEFORE_ALL_LINUX: |
yum update -y && yum install -y glibc-devel wget python3-devel &&
wget https://developer.download.nvidia.com/compute/cuda/12.9.1/local_installers/cuda_12.9.1_575.57.08_linux.run &&
sh cuda_12.9.1_575.57.08_linux.run --silent --toolkit --override &&
rm cuda_12.9.1_575.57.08_linux.run &&
echo "CUDA installed successfully" &&
/usr/local/cuda-12.9/bin/nvcc --version
SZ_TARGET: stringzillas-cuda
CIBW_ARCHS_LINUX: x86_64 aarch64 # Limit to 64-bit architectures only
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-stringzillas-cuda-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
overwrite: true
build_sdist_stringzilla:
name: Build StringZilla Source Distribution
runs-on: ubuntu-24.04
needs: versioning
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Build source distribution
run: pip install build &&
python -m build --sdist
env:
SZ_TARGET: stringzilla
- name: Upload source distribution
uses: actions/upload-artifact@v4
with:
name: sdist-stringzilla
path: dist/*.tar.gz
retention-days: 1
build_sdist_stringzillas_cpus:
name: Build StringZillas-CPUs Source Distribution
runs-on: ubuntu-24.04
needs: versioning
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Build source distribution
run: pip install build &&
python -m build --sdist
env:
SZ_TARGET: stringzillas-cpus
- name: Upload source distribution
uses: actions/upload-artifact@v4
with:
name: sdist-stringzillas-cpus
path: dist/*.tar.gz
retention-days: 1
build_sdist_stringzillas_cuda:
name: Build StringZillas-CUDA Source Distribution
runs-on: ubuntu-24.04
needs: versioning
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version: 3.x
- name: Build source distribution
run: pip install build &&
python -m build --sdist
env:
SZ_TARGET: stringzillas-cuda
- name: Upload source distribution
uses: actions/upload-artifact@v4
with:
name: sdist-stringzillas-cuda
path: dist/*.tar.gz
retention-days: 1
publish_pypi_stringzilla:
name: Publish StringZilla to PyPI
needs:
[
build_wheels_stringzilla_linux,
build_wheels_stringzilla_macos,
build_wheels_stringzilla_windows,
build_sdist_stringzilla,
]
if: ${{ always() }}
runs-on: ubuntu-24.04
environment:
name: pypi-stringzilla
url: https://pypi.org/p/stringzilla
steps:
- name: Prepare dist directory
run: mkdir -p dist
- name: Download wheels
uses: actions/download-artifact@v4
with:
# unpacks all StringZilla wheel artifacts into dist/
pattern: cibw-wheels-stringzilla-*
path: dist
merge-multiple: true
if-no-artifact-found: ignore
- name: Download source distribution
uses: actions/download-artifact@v4
with:
name: sdist-stringzilla
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist
verbose: true
print-hash: true
skip-existing: true
publish_pypi_stringzillas_cpus:
name: Publish StringZillas-CPUs to PyPI
needs:
[
build_wheels_stringzillas_cpus_linux,
build_wheels_stringzillas_cpus_macos,
build_wheels_stringzillas_cpus_windows,
build_sdist_stringzillas_cpus,
]
if: ${{ always() }}
runs-on: ubuntu-24.04
environment:
name: pypi-stringzillas-cpus
url: https://pypi.org/p/stringzillas-cpus
permissions: {}
steps:
- name: Prepare dist directory
run: mkdir -p dist
- name: Download wheels
uses: actions/download-artifact@v4
with:
# unpacks all StringZillas-CPUs wheel artifacts into dist/
pattern: cibw-wheels-stringzillas-cpus-*
path: dist
merge-multiple: true
if-no-artifact-found: ignore
- name: Download source distribution
uses: actions/download-artifact@v4
with:
name: sdist-stringzillas-cpus
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist
verbose: true
print-hash: true
skip-existing: true
publish_pypi_stringzillas_cuda:
name: Publish StringZillas-CUDA to PyPI
needs: [build_wheels_stringzillas_cuda_linux, build_sdist_stringzillas_cuda]
if: ${{ always() }}
runs-on: ubuntu-24.04
environment:
name: pypi-stringzillas-cuda
url: https://pypi.org/p/stringzillas-cuda
steps:
- name: Prepare dist directory
run: mkdir -p dist
- name: Download wheels
uses: actions/download-artifact@v4
with:
# unpacks all StringZillas-CUDA wheel artifacts into dist/
pattern: cibw-wheels-stringzillas-cuda-*
path: dist
merge-multiple: true
if-no-artifact-found: ignore
- name: Download source distribution
uses: actions/download-artifact@v4
with:
name: sdist-stringzillas-cuda
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
packages-dir: dist
verbose: true
print-hash: true
skip-existing: true
publish_rust:
name: Publish Rust
runs-on: ubuntu-22.04
needs: versioning
steps:
- uses: actions/checkout@v5
with:
ref: "main"
submodules: recursive
- name: Initialize submodules
run: git submodule update --init --recursive
- name: Hide submodule Crates
run: |
mv fork_union/Cargo.toml fork_union/Cargo.toml.bak
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# JavaScript
publish_javascript:
name: Publish JavaScript
needs: versioning
runs-on: ubuntu-24.04
environment:
name: npm-stringzilla
url: https://www.npmjs.com/package/stringzilla
permissions:
contents: read
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
ref: "main"
- name: Initialize submodules
run: git submodule update --init --recursive
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Publish to NPM
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
create_linux_deb_package:
name: Create Debian Package for ${{ matrix.arch }}
runs-on: ubuntu-22.04
needs: versioning
env:
CC: clang-16
CXX: clang++-16
AR: llvm-ar
NM: llvm-nm
RANLIB: llvm-ranlib
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
target: x86_64-linux-gnu
- arch: arm64
target: aarch64-linux-gnu
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
ref: "main"
submodules: recursive
- name: Get version
id: set_version
run: |
version=$(cat VERSION)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y make build-essential crossbuild-essential-arm64 crossbuild-essential-armhf libjemalloc-dev
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
- name: Build C/C++
run: |
# Configure and build the project
cmake -B build_release \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=1 \
-DCMAKE_C_COMPILER_TARGET=${{ matrix.target }} \
-DCMAKE_CXX_COMPILER_TARGET=${{ matrix.target }} \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=${{ matrix.arch }} \
-DSTRINGZILLA_BUILD_SHARED=1 \
-DSTRINGZILLA_BUILD_BENCHMARK=1 \
-DSTRINGZILLA_BUILD_TEST=1
cmake --build build_release --config Release
cp build_release/libstringzilla_bare.so "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.so"
mkdir -p "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}/DEBIAN"
touch "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}/DEBIAN/control"
mkdir -p "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}/usr/local/lib"
mkdir "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}/usr/local/include"
cp include/stringzilla/stringzilla.h "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}/usr/local/include/"
cp build_release/libstringzilla_bare.so "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}/usr/local/lib/"
echo -e "Package: stringzilla\nVersion: ${{ steps.set_version.outputs.version }}\nMaintainer: Ash Vardanian\nArchitecture: ${{ matrix.arch }}\nDescription: Search, hash, sort, fingerprint, and fuzzy-match strings faster via SWAR, SIMD, and GPGPU" > "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}/DEBIAN/control"
dpkg-deb --build "stringzilla_bare_linux_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}"
- name: Upload library
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "*.so"
update_latest_release: true
- name: Upload archive
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "*.deb"
update_latest_release: true
create_windows_dll_library:
name: Create Dll Library for Windows ${{ matrix.arch }}
runs-on: windows-2022
needs: versioning
strategy:
fail-fast: false
matrix:
include:
- arch: x64
target: x64
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
ref: "main"
submodules: recursive
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Get version
id: set_version
shell: cmd
run: |
set /p version=<VERSION
echo version=%version% >> %GITHUB_OUTPUT%
- name: Build library
shell: cmd
run: |
cmake -DCMAKE_BUILD_TYPE=Release -GNinja -B build_release -DSTRINGZILLA_BUILD_SHARED=1
cmake --build build_release --config Release
tar -cvf "stringzilla_bare_windows_${{ matrix.target }}_${{ steps.set_version.outputs.version }}.tar" "build_release\stringzilla_bare.dll" "build_release\stringzilla_bare.lib" ".\include\stringzilla\stringzilla.h"
- name: Upload archive
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "stringzilla_bare_windows_${{ matrix.target }}_${{ steps.set_version.outputs.version }}.tar"
update_latest_release: true
create_macos_library:
name: Create Library for MacOS ${{ matrix.arch }}
runs-on: macos-14
needs: versioning
strategy:
fail-fast: false
matrix:
arch: [arm64] # Only Apple Silicon for now
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
ref: "main"
submodules: recursive
- name: Get version
id: set_version
run: |
version=$(cat VERSION)
echo "version=$version" >> $GITHUB_OUTPUT
- name: Build library
run: |
cmake -DCMAKE_BUILD_TYPE=Release -B build_release -DSTRINGZILLA_BUILD_SHARED=1
cmake --build build_release --config Release
zip -r stringzilla_shared_macos_${{ matrix.arch }}_${{ steps.set_version.outputs.version }}.zip build_release/libstringzilla_shared.dylib include/stringzilla/stringzilla.h
- name: Upload archive
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "*.zip"
update_latest_release: true
# Aggregators for README badges (per-platform)
status_linux:
name: Linux CI
needs:
- build_wheels_stringzilla_linux
- build_wheels_stringzillas_cpus_linux
- build_wheels_stringzillas_cuda_linux
- create_linux_deb_package
if: ${{ always() }}
runs-on: ubuntu-24.04
steps:
- name: Aggregate Linux status
run: |
echo "Linux job results:"
echo "build_wheels_stringzilla_linux: ${{ needs.build_wheels_stringzilla_linux.result }}"
echo "build_wheels_stringzillas_cpus_linux: ${{ needs.build_wheels_stringzillas_cpus_linux.result }}"
echo "build_wheels_stringzillas_cuda_linux: ${{ needs.build_wheels_stringzillas_cuda_linux.result }}"
echo "create_linux_deb_package: ${{ needs.create_linux_deb_package.result }}"
if [ "${{ needs.build_wheels_stringzilla_linux.result }}" != "success" ] || \
[ "${{ needs.build_wheels_stringzillas_cpus_linux.result }}" != "success" ] || \
[ "${{ needs.build_wheels_stringzillas_cuda_linux.result }}" != "success" ] || \
[ "${{ needs.create_linux_deb_package.result }}" != "success" ]; then
echo "One or more Linux dependencies failed.";
exit 1;
fi
status_windows:
name: Windows CI
needs:
- build_wheels_stringzilla_windows
- build_wheels_stringzillas_cpus_windows
- create_windows_dll_library
if: ${{ always() }}
runs-on: ubuntu-24.04
steps:
- name: Aggregate Windows status
run: |
echo "Windows job results:"
echo "build_wheels_stringzilla_windows: ${{ needs.build_wheels_stringzilla_windows.result }}"
echo "build_wheels_stringzillas_cpus_windows: ${{ needs.build_wheels_stringzillas_cpus_windows.result }}"
echo "create_windows_dll_library: ${{ needs.create_windows_dll_library.result }}"
if [ "${{ needs.build_wheels_stringzilla_windows.result }}" != "success" ] || \
[ "${{ needs.build_wheels_stringzillas_cpus_windows.result }}" != "success" ] || \
[ "${{ needs.create_windows_dll_library.result }}" != "success" ]; then
echo "One or more Windows dependencies failed.";
exit 1;
fi
status_macos:
name: macOS CI
needs:
- build_wheels_stringzilla_macos
- build_wheels_stringzillas_cpus_macos
- create_macos_library
if: ${{ always() }}
runs-on: ubuntu-24.04
steps:
- name: Aggregate macOS status
run: |
echo "macOS job results:"
echo "build_wheels_stringzilla_macos: ${{ needs.build_wheels_stringzilla_macos.result }}"
echo "build_wheels_stringzillas_cpus_macos: ${{ needs.build_wheels_stringzillas_cpus_macos.result }}"
echo "create_macos_library: ${{ needs.create_macos_library.result }}"
if [ "${{ needs.build_wheels_stringzilla_macos.result }}" != "success" ] || \
[ "${{ needs.build_wheels_stringzillas_cpus_macos.result }}" != "success" ] || \
[ "${{ needs.create_macos_library.result }}" != "success" ]; then
echo "One or more macOS dependencies failed.";
exit 1;
fi