-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (62 loc) · 2.07 KB
/
main.yaml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build
on:
push:
workflow_dispatch:
inputs:
version:
description: "Release version"
required: true
defaults:
run:
shell: nix develop -v -c bash {0}
jobs:
build:
name: Build
runs-on: [self-hosted, nix, general, "${{ matrix.arch.runner }}", small]
timeout-minutes: 10
strategy:
matrix:
arch:
- nix: x86_64-linux
runner: amd64-linux
- nix: aarch64-linux
runner: arm64-linux
- nix: aarch64-darwin
runner: arm64-darwin
steps:
- uses: actions/checkout@v3
- name: Set version
if: github.event.inputs.version
run: ./cli.sh set_version "${{ github.event.inputs.version }}"
- name: Build Dev Env
run: nix build -L -v --no-link '.#packages.${{ matrix.arch.nix }}.devEnv'
- name: Check
run: ./cli.sh code_quality
- name: Build
run: nix build -L -v --no-link '.#defaultPackage.${{ matrix.arch.nix }}'
- name: Cache Dev Env
env:
NIX_OUTPUT: .#packages.${{ matrix.arch.nix }}.devEnv
run: |
nix store sign "${NIX_OUTPUT}" -v -r -k ~/.secrets/nix-cache-private-key
nix copy -v "${NIX_OUTPUT}" --to 's3://nixed/cache?compression=zstd¶llel-compression=true'
- name: Cache helmet
env:
NIX_OUTPUT: .#defaultPackage.${{ matrix.arch.nix }}
run: |
nix store sign "${NIX_OUTPUT}" -v -r -k ~/.secrets/nix-cache-private-key
nix copy -v "${NIX_OUTPUT}" --to 's3://nixed/cache?compression=zstd¶llel-compression=true'
release:
name: Release
if: github.event.inputs.version
needs: [build]
runs-on: [self-hosted, nix, general, arm64-linux, small]
steps:
- uses: actions/checkout@v3
- name: Set version
if: github.event.inputs.version
run: ./cli.sh set_version "${{ github.event.inputs.version }}"
- name: Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./cli.sh create_release "${{ github.event.inputs.version }}"