Merge: Case-Folding UTF-8 (ẞ → ss) #128
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - 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 | |
| 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 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Clean install dependencies | |
| run: npm install | |
| - name: Run tests | |
| run: npm test | |
| - name: Publish to NPM | |
| uses: JS-DevTools/npm-publish@v3 | |
| with: | |
| 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 |