Skip to content

Commit

Permalink
Convert to build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
truh committed May 24, 2024
1 parent e891a86 commit 0118a91
Showing 1 changed file with 14 additions and 45 deletions.
59 changes: 14 additions & 45 deletions .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ on:
push:

jobs:
build-x86_64-linux:
runs-on: ubuntu-latest
build:
strategy:
matrix:
include:
- os: ubuntu-latest
system: x86_64-linux
- os: macos-latest
system: x86_64-darwin
- os: macos-latest
system: aarch64-darwin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
Expand All @@ -14,56 +23,16 @@ jobs:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
extra-platforms = x86_64-linux x86_64-darwin aarch64-darwin
accept-flake-config = true
- name: Install attic
run: |
nix run nixpkgs#attic-client login internal "https://attic.internal.moonvision.io" "${{ secrets.ATTIC_SECRET_KEY }}"
nix run nixpkgs#attic-client use moonvision-foss
- name: Building package
run: nix build .#packages.x86_64-linux.default
- name: Push result to cache
run: nix run nixpkgs#attic-client push moonvision-foss result
build-x86_64-darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rosetta
run: sudo softwareupdate --install-rosetta --agree-to-license
- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
extra-platforms = x86_64-darwin aarch64-darwin
accept-flake-config = true
- name: Install attic
run: |
nix run nixpkgs#attic-client login internal "https://attic.internal.moonvision.io" "${{ secrets.ATTIC_SECRET_KEY }}"
nix run nixpkgs#attic-client use moonvision-foss
- name: Building package
run: nix build .#packages.x86_64-darwin.default
- name: Push result to cache
run: nix run nixpkgs#attic-client push moonvision-foss result
build-aarch64-darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Rosetta
if: ${{ contains(matrix.system, 'x86_64-darwin') }}
run: sudo softwareupdate --install-rosetta --agree-to-license
- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
extra-platforms = x86_64-darwin aarch64-darwin
accept-flake-config = true
- name: Install attic
run: |
nix run nixpkgs#attic-client login internal "https://attic.internal.moonvision.io" "${{ secrets.ATTIC_SECRET_KEY }}"
nix run nixpkgs#attic-client use moonvision-foss
- name: Building package
run: nix build .#packages.aarch64-darwin.default
run: nix build .#packages.${{ matrix.system }}.default
- name: Push result to cache
run: nix run nixpkgs#attic-client push moonvision-foss result

0 comments on commit 0118a91

Please sign in to comment.