54 lines
1.7 KiB
YAML
54 lines
1.7 KiB
YAML
name: Build artifacts
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
workflow_call:
|
|
|
|
jobs:
|
|
build-artifacts:
|
|
runs-on: ${{ matrix.systems.runner }}
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
env:
|
|
ARTIFACT_KEY: magic-nix-cache-${{ matrix.systems.system }}
|
|
ARCHIVE_NAME: magic-nix-cache.closure.xz
|
|
strategy:
|
|
matrix:
|
|
systems:
|
|
- nix-system: x86_64-linux
|
|
system: X64-Linux
|
|
runner: ubuntu-22.04
|
|
- nix-system: aarch64-linux
|
|
system: ARM64-Linux
|
|
runner: namespace-profile-default-arm64
|
|
- nix-system: x86_64-darwin
|
|
system: X64-macOS
|
|
runner: macos-14-large
|
|
- nix-system: aarch64-darwin
|
|
system: ARM64-macOS
|
|
runner: macos-latest-xlarge
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Nix on ${{ matrix.systems.system }}
|
|
uses: DeterminateSystems/nix-installer-action@main
|
|
- name: Magic Nix Cache
|
|
uses: DeterminateSystems/magic-nix-cache-action@main
|
|
|
|
- name: Build and cache dev shell for ${{ matrix.systems.nix-system }}
|
|
run: |
|
|
nix build ".#devShells.${{ matrix.systems.nix-system }}.default"
|
|
|
|
- name: Build package and create closure for ${{ matrix.systems.system }}
|
|
run: |
|
|
nix build .# -L --fallback && \
|
|
nix-store --export $(nix-store -qR ./result) | xz -9 > "${{ env.ARCHIVE_NAME }}"
|
|
|
|
- name: Upload magic-nix-cache closure for ${{ matrix.systems.system }}
|
|
uses: actions/upload-artifact@v4.6.0
|
|
with:
|
|
# Artifact name
|
|
name: ${{ env.ARTIFACT_KEY }}
|
|
path: ${{ env.ARCHIVE_NAME }}
|
|
retention-days: 1
|