-
Notifications
You must be signed in to change notification settings - Fork 12
198 lines (190 loc) · 6.27 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
name: build
on:
push:
env:
CACHE_VERSION: 20230707
WORKDIR: /home/runner/mod-workdir
jobs:
toolchain:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
key: toolchain-${{ env.CACHE_VERSION }}
path: ${{ env.WORKDIR }}
- uses: jpribyl/[email protected]
with:
key: docker-layer-for-mod-os-${{ env.CACHE_VERSION }}
- name: make toolchain
run: |
make toolchain
- name: pack toolchain
run: |
tar -C ${{ env.WORKDIR }} -czf workdir-toolchain-${{ env.CACHE_VERSION }}.tar.gz generic-x86_64
- uses: actions/upload-artifact@v3
with:
name: workdir-toolchain-${{ env.CACHE_VERSION }}
path: workdir-toolchain-${{ env.CACHE_VERSION }}.tar.gz
bootstrap:
needs: toolchain
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
key: bootstrap-${{ env.CACHE_VERSION }}
path: ${{ env.WORKDIR }}
- uses: jpribyl/[email protected]
with:
key: docker-layer-for-mod-os-${{ env.CACHE_VERSION }}
- uses: actions/download-artifact@v3
with:
name: workdir-toolchain-${{ env.CACHE_VERSION }}
path: /home/runner
- name: Extract workdir-toolchain-${{ env.CACHE_VERSION }}
shell: bash
run: |
mkdir -p ${{ env.WORKDIR }}
sudo tar -C ${{ env.WORKDIR }} -x --overwrite -f ~/workdir-toolchain-${{ env.CACHE_VERSION }}.tar.gz
- name: make bootstrap
run: |
touch toolchain/.stamp_built
make bootstrap
- name: pack bootstrap
run: |
tar -C ${{ env.WORKDIR }} -czf workdir-bootstrap-${{ env.CACHE_VERSION }}.tar.gz generic-x86_64
- uses: actions/upload-artifact@v3
with:
name: workdir-bootstrap-${{ env.CACHE_VERSION }}
path: workdir-bootstrap-${{ env.CACHE_VERSION }}.tar.gz
mod-os:
needs: bootstrap
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
key: mod-os-${{ env.CACHE_VERSION }}
path: ${{ env.WORKDIR }}
- uses: jpribyl/[email protected]
with:
key: docker-layer-for-mod-os-${{ env.CACHE_VERSION }}
- uses: actions/download-artifact@v3
with:
name: workdir-bootstrap-${{ env.CACHE_VERSION }}
path: /home/runner
- name: Extract workdir-bootstrap
shell: bash
run: |
mkdir -p ${{ env.WORKDIR }}
sudo tar -C ${{ env.WORKDIR }} -x --overwrite -f ~/workdir-bootstrap-${{ env.CACHE_VERSION }}.tar.gz
- name: make mod-os
env:
NOCLEAN: 1
run: |
touch toolchain/.stamp_built
touch bootstrap/.stamp_built
make mod-os
- name: pack mod-os
run: |
tar -C ${{ env.WORKDIR }} -czf workdir-mod-os-${{ env.CACHE_VERSION }}.tar.gz generic-x86_64
- uses: actions/upload-artifact@v3
with:
name: workdir-mod-os-${{ env.CACHE_VERSION }}
path: workdir-mod-os-${{ env.CACHE_VERSION }}.tar.gz
plugins-bootstrap:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
with:
key: plugins-bootstrap-${{ env.CACHE_VERSION }}
path: ${{ env.WORKDIR }}
- uses: jpribyl/[email protected]
with:
key: docker-layer-for-plugins-${{ env.CACHE_VERSION }}
- name: make plugins-bootstrap
run: |
mkdir -p ${{ env.WORKDIR }}
make plugins-bootstrap
plugins:
needs: plugins-bootstrap
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/cache@v3
with:
key: plugins-${{ env.CACHE_VERSION }}
path: |
plugins/.stamps
plugins/bundles
- uses: jpribyl/[email protected]
with:
key: docker-layer-for-plugins-${{ env.CACHE_VERSION }}
- name: make plugins
run: |
# touch toolchain/.stamp_built
make plugins
- name: pack plugin bundles
run: |
tar -czf plugin-bundles-${{ env.CACHE_VERSION }}.tar.gz plugins/bundles
- uses: actions/upload-artifact@v3
with:
name: plugin-bundles-${{ env.CACHE_VERSION }}
path: plugin-bundles-${{ env.CACHE_VERSION }}.tar.gz
iso:
needs: [mod-os, plugins]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
key: iso-${{ env.CACHE_VERSION }}
path: |
archiso/cache
- uses: jpribyl/[email protected]
with:
key: docker-layer-for-iso-${{ env.CACHE_VERSION }}
- uses: actions/download-artifact@v3
with:
name: workdir-mod-os-${{ env.CACHE_VERSION }}
path: /home/runner
- uses: actions/download-artifact@v3
with:
name: plugin-bundles-${{ env.CACHE_VERSION }}
path: /home/runner
- name: Extract workdir-mod-os
shell: bash
run: |
mkdir -p ${{ env.WORKDIR }}
sudo tar -C ${{ env.WORKDIR }} -x --overwrite -f ~/workdir-mod-os-${{ env.CACHE_VERSION }}.tar.gz
- name: Extract plugin bundles
shell: bash
run: |
sudo tar -x --overwrite -f ~/plugin-bundles-${{ env.CACHE_VERSION }}.tar.gz
- name: make iso
run: |
touch toolchain/.stamp_built
touch bootstrap/.stamp_built
touch plugins/.stamp_built
touch mod-os/.stamp_built
ln -sf ${{ env.WORKDIR }}/generic-x86_64/images/rootfs.ext2 mod-os/rootfs.ext2
make iso
- uses: actions/upload-artifact@v3
with:
name: iso
path: archiso/output/*.iso
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
draft: false
prerelease: true
files: |
archiso/output/*.iso