Use Erlang :httpc for NIF download, matching tailwind/esbuild pattern #15
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| ci: | |
| name: CI (${{ matrix.target }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - target: x86_64-linux | |
| runner: ubuntu-latest | |
| - target: aarch64-linux | |
| runner: ubuntu-24.04-arm | |
| - target: aarch64-macos | |
| runner: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.2 | |
| - name: Build Zig library | |
| run: zig build -Doptimize=ReleaseFast | |
| - name: Run Zig tests | |
| run: zig build test | |
| - name: Set up Erlang/Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: "27" | |
| elixir-version: "1.17" | |
| - name: Run Elixir tests | |
| env: | |
| TAILWIND_COMPILER_PATH: "true" | |
| run: | | |
| mix local.hex --force | |
| mix local.rebar --force | |
| mix deps.get | |
| mix test | |
| build_nif: | |
| name: Build NIF (${{ matrix.target }}) | |
| needs: ci | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| include: | |
| - target: x86_64-linux | |
| runner: ubuntu-latest | |
| - target: aarch64-linux | |
| runner: ubuntu-24.04-arm | |
| - target: aarch64-macos | |
| runner: macos-15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mlugg/setup-zig@v2 | |
| with: | |
| version: 0.15.2 | |
| - name: Set up Erlang/Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: "27" | |
| elixir-version: "1.17" | |
| - name: Build NIF | |
| env: | |
| TAILWIND_COMPILER_PATH: "true" | |
| run: | | |
| mix local.hex --force | |
| mix local.rebar --force | |
| mix deps.get | |
| mix compile | |
| - name: Package NIF | |
| run: | | |
| NIF_FILE=$(find _build -name "Elixir.TailwindCompiler.NIF.so" -type f | head -1) | |
| if [ -z "$NIF_FILE" ]; then | |
| echo "ERROR: Could not find compiled NIF .so file" | |
| find _build -name "*NIF*" -type f | |
| exit 1 | |
| fi | |
| echo "Found NIF at: $NIF_FILE" | |
| mkdir -p release | |
| cp "$NIF_FILE" release/Elixir.TailwindCompiler.NIF.so | |
| cd release | |
| tar czf "tailwind_compiler-nif-${{ matrix.target }}.tar.gz" Elixir.TailwindCompiler.NIF.so | |
| shasum -a 256 "tailwind_compiler-nif-${{ matrix.target }}.tar.gz" | tee "tailwind_compiler-nif-${{ matrix.target }}.tar.gz.sha256" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nif-${{ matrix.target }} | |
| path: release/tailwind_compiler-nif-* | |
| release: | |
| name: Create Release | |
| needs: build_nif | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true |