@@ -3,101 +3,112 @@ name: 'Build NixOS WSL tarball'
3
3
on : [push, pull_request, release]
4
4
5
5
jobs :
6
- build :
6
+ prepare :
7
+ name : Prepare ⚙️
7
8
runs-on : ubuntu-latest
8
9
outputs :
9
10
tests : ${{ steps.tests.outputs.tests }}
10
11
steps :
11
12
- name : Checkout
12
13
uses : actions/checkout@v3
13
14
with :
14
- # Nix Flakes doesn't work on shallow clones
15
15
fetch-depth : 0
16
16
17
- - name : Find tests
17
+ - name : Find tests 🔍
18
18
id : tests
19
19
run : |
20
20
find tests -name '*.spec.ps1' -print0 | perl -pe 's|(.*?)\x0|"\1",|g;s|,$||;s|(.*)|tests=[\1]|' >> $GITHUB_OUTPUT
21
21
22
- - name : Install nix
23
- uses : cachix/install-nix-action@v16
24
-
25
- - name : Run checks
26
- run : |
27
- nix flake check
28
-
29
- - name : Build tarball
30
- run : |
31
- nix build '.#nixosConfigurations.mysystem.config.system.build.tarball'
32
-
33
- - name : Upload tarball
34
- uses : actions/upload-artifact@v3
22
+ build :
23
+ name : Build 🛠️
24
+ runs-on : ubuntu-latest
25
+ steps :
26
+ - name : Checkout
27
+ uses : actions/checkout@v3
35
28
with :
36
- name : rootfs
37
- path : result/tarball/nixos-wsl-x86_64-linux.tar.gz
29
+ fetch-depth : 0
38
30
39
- - name : Build installer
31
+ - name : Install nix ❄️
32
+ uses : cachix/install-nix-action@v18
33
+
34
+ - name : Build installer 🛠️
40
35
run : |
41
36
nix build '.#nixosConfigurations.mysystem.config.system.build.installer'
42
37
43
- - name : Upload installer
38
+ - name : Upload installer 📤
44
39
uses : actions/upload-artifact@v3
45
40
with :
46
41
name : installer
47
42
path : result/tarball/nixos-wsl-installer.tar.gz
48
43
44
+ checks :
45
+ name : Run Flake Checks 📋
46
+ runs-on : ubuntu-latest
47
+ steps :
48
+ - name : Checkout
49
+ uses : actions/checkout@v3
50
+ with :
51
+ fetch-depth : 0
52
+
53
+ - name : Install nix ❄️
54
+ uses : cachix/install-nix-action@v18
55
+
56
+ - name : Run checks 📋
57
+ run : |
58
+ nix flake check
59
+
49
60
tests :
50
61
needs :
62
+ - prepare
51
63
- build
52
64
strategy :
53
65
matrix :
54
66
os :
55
67
- ubuntu-latest
56
68
# - windows-latest # doesn't work due to lack of nested virtualization on the runners, hopefully this will work one day
57
- test : ${{ fromJSON(needs.build.outputs.tests) }}
69
+ test : ${{ fromJSON(needs.prepare.outputs.tests) }}
70
+ name : Run Tests 🧪
58
71
runs-on : ${{ matrix.os }}
59
72
steps :
60
73
- name : Checkout
61
74
uses : actions/checkout@v3
62
75
63
- - uses : actions/download-artifact@v3
76
+ - name : Download installer 📥
77
+ uses : actions/download-artifact@v3
64
78
with :
65
79
name : installer
66
80
67
- - name : Execute test
81
+ - name : Execute test 🧪
68
82
run : |
69
83
pwsh ${{ matrix.test }}
70
84
71
85
release :
72
86
if : startsWith(github.ref, 'refs/tags/')
73
87
needs :
88
+ - checks
74
89
- build
75
90
- tests
91
+ name : Create Release 📢
76
92
runs-on : ubuntu-latest
77
93
steps :
78
94
- name : Checkout
79
95
uses : actions/checkout@v3
80
96
81
- - uses : actions/download-artifact@v3
82
- with :
83
- name : rootfs
84
-
85
- - uses : actions/download-artifact@v3
97
+ - name : Download installer 📥
98
+ uses : actions/download-artifact@v3
86
99
with :
87
100
name : installer
88
101
89
- - name : Generate checksums
102
+ - name : Generate checksums 🔑
90
103
run : |
91
104
for x in *.tar.gz; do
92
105
sha256sum $x > ${x}.sha256
93
106
done
94
107
95
- - name : Attach to release
108
+ - name : Attach to release 📦
96
109
uses : softprops/action-gh-release@v1
97
110
with :
98
111
files : |
99
- nixos-wsl-x86_64-linux.tar.gz
100
- nixos-wsl-x86_64-linux.tar.gz.sha256
101
112
nixos-wsl-installer.tar.gz
102
113
nixos-wsl-installer.tar.gz.sha256
103
114
env :
0 commit comments