generated from nix-community/nur-packages-template
-
Notifications
You must be signed in to change notification settings - Fork 5
171 lines (159 loc) · 5.29 KB
/
build.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: 'Build and populate cache'
on:
workflow_dispatch:
push:
branches:
- main
- master
jobs:
build-packages:
strategy:
fail-fast: false
matrix:
system:
- x86_64-linux
# - aarch64-linux
ci-command:
- ci
- ci-cuda
runs-on: ubuntu-latest
env:
GIT_SSL_NO_VERIFY: 'true'
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 512
swap-size-mb: 1024
build-mount-path: '/nix'
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.AUTOMERGE_TOKEN }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Install nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes ca-derivations
extra-experimental-features = nix-command flakes ca-derivations
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
extra-platforms = i686-linux aarch64-linux arm-linux
keep-going = true
log-lines = 25
substituters = https://nix-community.cachix.org https://cache.garnix.io https://cache.nixos.org/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=
trusted-substituters = https://nix-community.cachix.org https://cache.garnix.io https://cache.nixos.org/
- name: Setup Attic cache
uses: ryanccn/attic-action@v0
continue-on-error: true
with:
endpoint: https://attic.xuyh0120.win
cache: lantian
token: ${{ secrets.ATTIC_TOKEN }}
- name: Set nix daemon tmpdir path
run: |
sudo mkdir -p /nix/tmpdir
sudo chown "$(whoami)" /nix/tmpdir
cat > override.conf <<EOF
[Service]
Environment="TMPDIR=/nix/tmpdir"
EOF
sudo mkdir /etc/systemd/system/nix-daemon.service.d/
sudo mv override.conf /etc/systemd/system/nix-daemon.service.d/override.conf
sudo systemctl daemon-reload
sudo systemctl restart nix-daemon
- name: Build nix packages
run: |
echo "::group::Preparing"
env TMPDIR=/nix/tmpdir nix run .#${{ matrix.ci-command }} -- ${{ matrix.system }}
- name: Commit back to repository
uses: stefanzweifel/git-auto-commit-action@v5
if: ${{ success() || failure() }}
with:
commit_message: 'auto: update package hashes'
test-nur-eval:
runs-on: ubuntu-latest
env:
GIT_SSL_NO_VERIFY: 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Install nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes ca-derivations
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
extra-platforms = i686-linux aarch64-linux arm-linux
- name: Build nix packages
run: |
nix run .#nur-check
check-package-meta:
runs-on: ubuntu-latest
env:
GIT_SSL_NO_VERIFY: 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: all
- name: Install nix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes ca-derivations
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
extra-platforms = i686-linux aarch64-linux arm-linux
- name: Build nix packages
run: |
tools/check_package_meta.py
update-nur:
runs-on: ubuntu-latest
needs:
- build-packages
- test-nur-eval
- check-package-meta
steps:
- name: Trigger NUR update
run: curl -XPOST "https://nur-update.nix-community.org/update?repo=xddxdd"
# update-flakehub:
# runs-on: ubuntu-latest
# needs:
# - build-packages
# - test-nur-eval
# - check-package-meta
# permissions:
# id-token: 'write'
# contents: 'read'
# steps:
# - uses: 'actions/checkout@v4'
# - uses: 'DeterminateSystems/nix-installer-action@main'
# - uses: 'DeterminateSystems/flakehub-push@main'
# with:
# name: 'xddxdd/nur-packages'
# rolling: true
# visibility: 'public'