88 lines
2.8 KiB
YAML
88 lines
2.8 KiB
YAML
name: Build flake
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/install-nix
|
|
- run: nix flake check
|
|
|
|
matrix:
|
|
runs-on: ubuntu-latest
|
|
needs: [check]
|
|
outputs:
|
|
aarch64-darwin: ${{ steps.generate_matrix.outputs.aarch64-darwin }}
|
|
aarch64-linux: ${{ steps.generate_matrix.outputs.aarch64-linux }}
|
|
x86_64-linux: ${{ steps.generate_matrix.outputs.x86_64-linux }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/install-nix
|
|
- id: generate_matrix
|
|
run: |
|
|
nix eval --raw .#github-matrix >> $GITHUB_OUTPUT
|
|
|
|
build-x86_64-linux:
|
|
runs-on: ubuntu-latest
|
|
needs: [matrix]
|
|
if: ${{ needs.matrix.outputs.x86_64-linux != '[]' && needs.matrix.outputs.x86_64-linux != '' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
output: ${{ fromJson(needs.matrix.outputs.x86_64-linux )}}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/install-nix
|
|
- name: Build output
|
|
run: nix build .#${{ matrix.output }} -L
|
|
- name: Push output
|
|
run: |
|
|
nix run .#attic -- login nrab-attic 'https://cache.nrab.lol/' ${{ secrets.ATTIC_TOKEN }}
|
|
nix run .#attic -- push nrab-attic:public result
|
|
|
|
build-aarch64-darwin:
|
|
runs-on: macos-14
|
|
needs: [matrix]
|
|
if: ${{ needs.matrix.outputs.aarch64-darwin != '[]' && needs.matrix.outputs.aarch64-darwin != '' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
output: ${{ fromJson(needs.matrix.outputs.aarch64-darwin )}}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: ./.github/actions/install-nix
|
|
- name: Build output
|
|
run: nix build .#${{ matrix.output }} -L
|
|
- name: Push output
|
|
run: |
|
|
nix run .#attic -- login nrab-attic 'https://cache.nrab.lol/' ${{ secrets.ATTIC_TOKEN }}
|
|
nix run .#attic -- push nrab-attic:public result
|
|
|
|
build-aarch64-linux:
|
|
runs-on: [Linux, ARM64, nix]
|
|
needs: [matrix]
|
|
if: ${{ needs.matrix.outputs.aarch64-linux != '[]' && needs.matrix.outputs.aarch64-linux != '' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
output: ${{ fromJson(needs.matrix.outputs.aarch64-linux )}}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Build output
|
|
run: nix build .#${{ matrix.output }} -L
|
|
- name: Push output
|
|
run: |
|
|
nix run .#attic -- login nrab-attic 'https://cache.nrab.lol/' ${{ secrets.ATTIC_TOKEN }}
|
|
nix run .#attic -- push nrab-attic:public result
|
|
|
|
all-built:
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
needs: [build-x86_64-linux, build-aarch64-darwin, build-aarch64-linux]
|
|
steps:
|
|
- uses: re-actors/alls-green@release/v1
|
|
with:
|
|
jobs: ${{ toJSON(needs) }}
|