-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (58 loc) · 2 KB
/
binaries.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: "Build and upload static Nix binaries"
on:
push:
paths:
- flake.nix
- flake.lock
- 'static-bins/**'
jobs:
build-macos:
name: Build macOS binaries
runs-on: macos-latest
environment: Cachix
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Nix
uses: cachix/install-nix-action@v20
- name: Set up Cachix access
uses: cachix/cachix-action@v12
with:
name: nix-wrap
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
pushFilter: "(-source|-man)$"
- name: Build macOS binaries output
run: |
nix build .#static-bins.aarch64-darwin-nix-static
nix build .#static-bins.x86_64-darwin-nix-static
nix build .#static-bins.fakedir
cachix push nix-wrap $(nix eval --raw .#static-bins.aarch64-darwin-nix-static)
cachix push nix-wrap $(nix eval --raw .#static-bins.x86_64-darwin-nix-static)
cachix push nix-wrap $(nix eval --raw .#static-bins.fakedir)
assemble-linux:
name: Build Linux binaries and merge derivation
runs-on: ubuntu-latest
needs: build-macos
environment: Cachix
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Nix
uses: cachix/install-nix-action@v20
- name: Set up Cachix access
uses: cachix/cachix-action@v12
with:
name: nix-wrap
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
pushFilter: "(-source|-man)$"
- name: Install QEMU for AArch64 builds
run: |
sudo apt-get -q -y update
sudo apt-get -q -y install qemu-user-static
- name: Build and pin final output
run: |
nix --extra-platforms aarch64-linux build .#static-bins
cachix push nix-wrap $(nix eval --raw .#static-bins)
cachix pin nix-wrap binaries $(nix eval --raw .#static-bins) --keep-forever