name: Cross-platform builds on: push: branches: [main] workflow_dispatch: permissions: contents: read concurrency: group: builds-${{ github.ref }} cancel-in-progress: true jobs: build: name: ${{ matrix.name }} runs-on: ubuntu-24.04 timeout-minutes: 30 strategy: fail-fast: false matrix: include: - name: windows-x86_64 target: x86_64-windows-gnu - name: linux-x86_64 target: x86_64-linux-gnu.2.28 - name: macos-aarch64 target: aarch64-macos.13.0 - name: macos-x86_64 target: x86_64-macos.13.0 steps: - name: Check out source uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: persist-credentials: false - name: Install Zig uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 with: version: 0.17.0 - name: Build compiler, C library, and DXC drop-in run: >- zig build install dropin -Doptimize=ReleaseFast -Dtarget=${{ matrix.target }} -Dcpu=baseline --prefix zig-out/${{ matrix.name }} # A tar archive preserves executable permissions inside the uploaded ZIP. - name: Package build run: >- tar -czf zdxc-${{ matrix.name }}.tar.gz -C zig-out/${{ matrix.name }} bin lib include - name: Upload build uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: zdxc-${{ matrix.name }} path: zdxc-${{ matrix.name }}.tar.gz if-no-files-found: error retention-days: 14