fix(ci): install Zig on PATH so Burrito pre_check passes (#78) #10
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 | |
| # Triggers on version tags, e.g. v0.3.0 | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| env: | |
| MIX_ENV: prod | |
| ELIXIR_VERSION: "1.17.3" | |
| # OTP 27 has Mix release bugs (TypedStruct.MixProject and Decimal.Error | |
| # 'already compiled' errors during dep walk, plus inspect protocol | |
| # changes that crash with {badkey, pretty, []}). Pinned to OTP 26 | |
| # until upstream Elixir/Mix fixes land. Companion PR #76 pins | |
| # erlexec to 2.0.6 (last pre-OTP-27 release). | |
| OTP_VERSION: "26.2.5" | |
| jobs: | |
| # ── macOS arm64 (Apple Silicon) ────────────────────────────────────── | |
| build-macos-arm64: | |
| runs-on: macos-14 # Apple Silicon runner (M1/M2) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Build the native ScreenCaptureKit helper before the Elixir release so | |
| # it ends up in priv/helpers/ when Burrito bundles priv/. | |
| - name: Build native macOS helper (osa-screen-capture-darwin) | |
| run: | | |
| chmod +x native/macos/ScreenShare/build.sh | |
| cd native/macos/ScreenShare | |
| ./build.sh release | |
| - name: Set up Erlang/OTP + Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: macos-arm64-${{ hashFiles('mix.lock') }} | |
| restore-keys: macos-arm64- | |
| - name: Install deps | |
| run: mix deps.get --only prod | |
| - name: Install Zig (Burrito pre_check requires zig on PATH) | |
| uses: mlugg/setup-zig@v1 | |
| with: | |
| version: 0.13.0 | |
| - name: Build Burrito binary (macos_arm64) | |
| run: mix release burrito | |
| env: | |
| BURRITO_TARGET: macos_arm64 | |
| - name: Rename binary | |
| run: mv burrito_out/macos_arm64 burrito_out/osa-darwin-arm64 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: osa-darwin-arm64 | |
| path: burrito_out/osa-darwin-arm64 | |
| # ── Linux amd64 ────────────────────────────────────────────────────── | |
| build-linux-amd64: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Erlang/OTP + Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: linux-amd64-${{ hashFiles('mix.lock') }} | |
| restore-keys: linux-amd64- | |
| - name: Install deps | |
| run: mix deps.get --only prod | |
| - name: Install Zig (Burrito pre_check requires zig on PATH) | |
| uses: mlugg/setup-zig@v1 | |
| with: | |
| version: 0.13.0 | |
| - name: Build Burrito binary (linux_amd64) | |
| run: mix release burrito | |
| env: | |
| BURRITO_TARGET: linux_amd64 | |
| - name: Rename binary | |
| run: mv burrito_out/linux_amd64 burrito_out/osa-linux-amd64 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: osa-linux-amd64 | |
| path: burrito_out/osa-linux-amd64 | |
| # ── Linux arm64 ────────────────────────────────────────────────────── | |
| build-linux-arm64: | |
| runs-on: ubuntu-22.04-arm # GitHub-hosted ARM runner (public beta) | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Erlang/OTP + Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: linux-arm64-${{ hashFiles('mix.lock') }} | |
| restore-keys: linux-arm64- | |
| - name: Install deps | |
| run: mix deps.get --only prod | |
| - name: Install Zig (Burrito pre_check requires zig on PATH) | |
| uses: mlugg/setup-zig@v1 | |
| with: | |
| version: 0.13.0 | |
| - name: Build Burrito binary (linux_arm64) | |
| run: mix release burrito | |
| env: | |
| BURRITO_TARGET: linux_arm64 | |
| - name: Rename binary | |
| run: mv burrito_out/linux_arm64 burrito_out/osa-linux-arm64 | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: osa-linux-arm64 | |
| path: burrito_out/osa-linux-arm64 | |
| # ── Windows amd64 ──────────────────────────────────────────────────── | |
| # Burrito on Windows requires: | |
| # - 7-zip (for self-extraction bootstrap) — pre-installed on windows-2022 | |
| # - Zig toolchain (Burrito downloads it automatically via Zig.get_zig/0) | |
| # - No vcredist or MSVC required — ERTS ships its own DLLs | |
| build-windows-amd64: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Build the native Desktop Duplication helper before the Elixir release. | |
| - name: Set up .NET 8 | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Build native Windows helper (osa-screen-capture-windows.exe) | |
| shell: pwsh | |
| run: | | |
| cd native/windows/ScreenShare | |
| dotnet publish -c Release -r win-x64 --self-contained true -o publish | |
| Copy-Item publish/ScreenShare.exe ../../../priv/helpers/osa-screen-capture-windows.exe | |
| Write-Host "Deployed to priv/helpers/osa-screen-capture-windows.exe" | |
| Get-ChildItem ../../../priv/helpers/ | Select-Object Name, Length | |
| - name: Set up Erlang/OTP + Elixir | |
| uses: erlef/setup-beam@v1 | |
| with: | |
| elixir-version: ${{ env.ELIXIR_VERSION }} | |
| otp-version: ${{ env.OTP_VERSION }} | |
| - name: Cache deps | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| deps | |
| _build | |
| key: windows-amd64-${{ hashFiles('mix.lock') }} | |
| restore-keys: windows-amd64- | |
| - name: Install deps | |
| shell: bash | |
| run: mix deps.get --only prod | |
| # Burrito auto-fetches Zig during the wrap step; pre-warming avoids | |
| # network timeouts inside the release task. | |
| - name: Warm Zig cache | |
| shell: bash | |
| run: mix burrito.get_zig || true | |
| - name: Build Burrito binary (windows_amd64) | |
| shell: bash | |
| run: mix release burrito | |
| env: | |
| BURRITO_TARGET: windows_amd64 | |
| - name: Rename binary | |
| shell: bash | |
| run: mv burrito_out/windows_amd64.exe burrito_out/osa-windows-amd64.exe | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: osa-windows-amd64 | |
| path: burrito_out/osa-windows-amd64.exe | |
| # ── Publish GitHub Release ──────────────────────────────────────────── | |
| # | |
| # Depends ONLY on the Linux amd64 build. macOS, Linux arm64, and Windows | |
| # builds still run in parallel above — they just don't block publishing. | |
| # Rationale: a flaky build on any single platform should not hold the | |
| # entire release hostage. Linux amd64 binaries are the immediate consumer | |
| # (MIOSA Firecracker rootfs install.sh). Other platforms can be added | |
| # back to `needs:` and `files:` once their build pipelines are confirmed | |
| # stable. | |
| publish: | |
| needs: build-linux-amd64 | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write # required to create the GitHub Release | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download Linux amd64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: osa-linux-amd64 | |
| path: release-assets/osa-linux-amd64 | |
| - name: Make Linux binary executable | |
| run: chmod +x release-assets/osa-linux-amd64/osa-linux-amd64 | |
| - name: Create GitHub Release and upload assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: "OSA ${{ github.ref_name }}" | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| generate_release_notes: true | |
| files: | | |
| release-assets/osa-linux-amd64/osa-linux-amd64 |