-
Notifications
You must be signed in to change notification settings - Fork 2
212 lines (212 loc) · 6.85 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Build rootfs
on:
push:
paths:
- 'envs.sh'
- 'stage1-systemd-23.spec'
- 'stage3d-systemd-23.spec'
- 'stage4-llvm.spec'
- 'stage4-fex.spec'
- 'build.sh'
- 'assemble.sh'
- 'config/**'
jobs:
build-stage-1:
name: Build Stage 1
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: "ghcr.io/whatamisupposedtoputhere/fex-rootfs-catalyst:latest"
options: --user root --privileged
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Cache pkgs
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/packages/23.0-default/stage1-amd64"
key: "stage1-pkgs-${{ hashFiles('envs.sh', 'stage1-systemd-23.spec', 'config/**') }}"
restore-keys: "stage1-pkgs"
- name: "Get envs"
run: |
echo "TIMESTAMP_L=$(source envs.sh; echo $TIMESTAMP_L)" >> $GITHUB_ENV
echo "TIMESTAMP_S=$(source envs.sh; echo $TIMESTAMP_S)" >> $GITHUB_ENV
- name: Cache seed
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/stage3-amd64-systemd-${{env.TIMESTAMP_L}}.tar.xz"
key: "seed-${{ env.TIMESTAMP_L }}"
- name: Cache snapshot
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/gentoo-${{env.TIMESTAMP_S}}.xz.sqfs"
key: "snapshot-${{ env.TIMESTAMP_S }}"
- name: Build
run: "bash build.sh stage1-systemd-23.spec"
env:
GIT_SHA: ${{ github.sha }}
DOWNLOAD_SEED: 1
- name: Upload
uses: "actions/upload-artifact@v4"
with:
name: stage1-tarball
path: "/var/tmp/catalyst/builds/23.0-default/stage1-amd64-systemd.tar.xz"
build-stage-3:
name: Build Stage 3
needs: build-stage-1
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: "ghcr.io/whatamisupposedtoputhere/fex-rootfs-catalyst:latest"
options: --user root --privileged
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Download Stage 1
uses: actions/download-artifact@v4
with:
name: stage1-tarball
path: "/var/tmp/catalyst/builds/23.0-default/"
- name: Cache pkgs
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/packages/23.0-default/stage3-amd64"
key: "stage3-pkgs-${{ hashFiles('envs.sh', 'stage3d-systemd-23.spec', 'config/**') }}"
restore-keys: "stage3-pkgs"
- name: "Get envs"
run: |
echo "TIMESTAMP_S=$(source envs.sh; echo $TIMESTAMP_S)" >> $GITHUB_ENV
- name: Cache snapshot
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/gentoo-${{env.TIMESTAMP_S}}.xz.sqfs"
key: "snapshot-${{ env.TIMESTAMP_S }}"
- name: Build
run: "bash build.sh stage3d-systemd-23.spec"
env:
GIT_SHA: ${{ github.sha }}
- name: Upload
uses: "actions/upload-artifact@v4"
with:
name: stage3-tarball
path: "/var/tmp/catalyst/builds/23.0-default/stage3-amd64-systemd.tar.xz"
build-stage-4-clang:
name: Build Stage 4 Clang
needs: build-stage-3
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: "ghcr.io/whatamisupposedtoputhere/fex-rootfs-catalyst:latest"
options: --user root --privileged
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Download Stage 3
uses: actions/download-artifact@v4
with:
name: stage3-tarball
path: "/var/tmp/catalyst/builds/23.0-default/"
- name: Cache pkgs
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/packages/23.0-default/stage4-amd64"
key: "stage4-pkgs-${{ hashFiles('envs.sh', 'stage4-llvm.spec', 'config/**') }}"
restore-keys: |
stage4-pkgs-f
stage4-pkgs
- name: "Get envs"
run: |
echo "TIMESTAMP_S=$(source envs.sh; echo $TIMESTAMP_S)" >> $GITHUB_ENV
- name: Cache snapshot
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/gentoo-${{env.TIMESTAMP_S}}.xz.sqfs"
key: "snapshot-${{ env.TIMESTAMP_S }}"
- name: Build
run: "bash build.sh stage4-llvm.spec"
env:
GIT_SHA: ${{ github.sha }}
- name: Upload
uses: "actions/upload-artifact@v4"
with:
name: stage4-clang-tarball
path: "/var/tmp/catalyst/builds/23.0-default/stage4-amd64-clang.tar.xz"
build-stage-4:
name: Build Stage 4
needs: build-stage-4-clang
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: "ghcr.io/whatamisupposedtoputhere/fex-rootfs-catalyst:latest"
options: --user root --privileged
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Download Stage 4 Clang
uses: actions/download-artifact@v4
with:
name: stage4-clang-tarball
path: "/var/tmp/catalyst/builds/23.0-default/"
- name: Cache snapshot
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/packages/23.0-default/stage4-amd64"
key: "stage4-pkgs-f-${{ hashFiles('envs.sh', 'stage4-fex.spec', 'config/**') }}"
restore-keys: |
stage4-pkgs-f
stage4-pkgs
- name: "Get envs"
run: |
echo "TIMESTAMP_S=$(source envs.sh; echo $TIMESTAMP_S)" >> $GITHUB_ENV
- name: Cache snapshot
uses: "actions/cache@v4"
with:
path: "/var/tmp/catalyst/gentoo-${{env.TIMESTAMP_S}}.xz.sqfs"
key: "snapshot-${{ env.TIMESTAMP_S }}"
- name: Build
run: "bash build.sh stage4-fex.spec"
env:
GIT_SHA: ${{ github.sha }}
- name: Upload
uses: "actions/upload-artifact@v4"
with:
name: stage4-tarball
path: "/var/tmp/catalyst/builds/23.0-default/stage4-amd64-desktop-systemd.tar.xz"
assemble-squashfs:
name: Assemble squashfs image
needs: build-stage-4
runs-on: ubuntu-latest
defaults:
run:
shell: bash
container:
image: "ghcr.io/whatamisupposedtoputhere/fex-rootfs-catalyst:latest"
options: --user root --privileged
permissions:
contents: write
steps:
- name: Checkout
uses: "actions/checkout@v4"
- name: Download Stage 4
uses: actions/download-artifact@v4
with:
name: stage4-tarball
- name: Squash
run: "bash assemble.sh"
- name: "Get release"
run: echo "RELEASE=$(source envs.sh; echo $RELEASE)" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.RELEASE }}
files: |
fex-rootfs.sqfs
fex-chroot.sqfs