Release v0.8.1 #13
Workflow file for this run
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: Build precompiled NIFs | |
| on: | |
| push: | |
| tags: ['v*'] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - { target: x86_64-linux-gnu, os: ubuntu-latest } | |
| - { target: aarch64-macos-none, os: macos-latest } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: goto-bus-stop/setup-zig@v2 | |
| with: | |
| version: 0.15.2 | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: '27' | |
| elixir-version: '1.18' | |
| - name: Build NIF | |
| run: | | |
| mix local.hex --force | |
| mix local.rebar --force | |
| mix deps.get | |
| QUICKBEAM_BUILD=1 mix compile | |
| - name: Package artifact | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| BASENAME="Elixir.QuickBEAM.Native" | |
| # Find the built library (could be .so or .dylib) | |
| LIB_FILE=$(find priv/lib -name "*${BASENAME}.*" \ | |
| \( -name "*.so" -o -name "*.dylib" \) \ | |
| -not -name "*.[0-9]*" | sort | head -1) | |
| if [ -z "$LIB_FILE" ]; then | |
| echo "ERROR: Could not find built library" | |
| find priv/lib -type f | head -20 | |
| exit 1 | |
| fi | |
| echo "Found: ${LIB_FILE}" | |
| # ZiglerPrecompiled expects: Elixir.QuickBEAM.Native-v0.5.0-target.so.tar.gz | |
| # The .so extension is always used in the tar name, even for .dylib | |
| mkdir -p artifacts | |
| ARTIFACT_NAME="${BASENAME}-v${VERSION}-${{ matrix.target }}.so.tar.gz" | |
| tar czf "artifacts/${ARTIFACT_NAME}" -C "$(dirname "$LIB_FILE")" "$(basename "$LIB_FILE")" | |
| echo "Packaged: ${ARTIFACT_NAME}" | |
| - name: Upload to release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: artifacts/*.tar.gz |