-
-
Notifications
You must be signed in to change notification settings - Fork 6
242 lines (205 loc) · 7.19 KB
/
release.yml
File metadata and controls
242 lines (205 loc) · 7.19 KB
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
name: release
on:
push:
branches:
- master
jobs:
github:
runs-on: ubuntu-24.04
if: "contains(github.event.head_commit.message, 'chore: release')"
steps:
- run: sudo apt-get update && sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev libudev-dev libgtk-4-dev libglib2.0-dev
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: MarcoIeni/release-plz-action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
linux:
name: linux / ${{ matrix.target }}
runs-on: ubuntu-latest
needs: github
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }} --exclude goldboot-uki
- uses: actions/upload-artifact@v4
with:
name: goldboot-${{ matrix.target }}
path: target/${{ matrix.target }}/release/goldboot
- uses: actions/upload-artifact@v4
with:
name: goldboot-registry-${{ matrix.target }}
path: target/${{ matrix.target }}/release/goldboot-registry
- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
for tag in $(git tag --points-at HEAD); do
if cp target/${{ matrix.target }}/release/${tag%-*} ${tag%-*}_${{ matrix.target }}; then
gh release upload "${tag}" "${tag%-*}_${{ matrix.target }}"
fi
done
goldboot-uki:
runs-on: ubuntu-24.04
needs: linux
steps:
- run: sudo apt-get update && sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev libudev-dev libgtk-4-dev libglib2.0-dev
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Build goldboot-uki image x86_64
run: |
export RUST_BACKTRACE=1
export RUST_LOG=debug
target/release/goldboot init --os Goldboot --executable target/release/goldboot-uki
target/release/goldboot cast --output goldboot-uki-x86_64.gb .
- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
for tag in $(git tag --points-at HEAD); do
if [ "${tag%-*}" = "goldboot-uki" ]; then
mv target/release/${tag%-*} "${tag%-*}_x86_64-unknown-linux-gnu"
gh release upload "${tag}" "${tag%-*}_x86_64-unknown-linux-gnu"
mv goldboot-uki-x86_64.gb "${tag%-*}_x86_64-unknown-linux-gnu.gb"
gh release upload "${tag}" "${tag%-*}_x86_64-unknown-linux-gnu.gb"
fi
done
macos:
runs-on: macos-latest
needs: github
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --exclude goldboot-uki
- uses: actions/upload-artifact@v4
with:
name: goldboot-x86_64-apple-darwin
path: target/release/goldboot
- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
for tag in $(git tag --points-at HEAD); do
if cp target/release/${tag%-*} ${tag%-*}_x86_64-apple-darwin; then
gh release upload "${tag}" "${tag%-*}_x86_64-apple-darwin"
fi
done
windows:
runs-on: windows-latest
needs: github
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --exclude goldboot-uki
- uses: actions/upload-artifact@v4
with:
name: goldboot-x86_64-pc-windows-msvc
path: target/release/goldboot
- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
foreach ($tag in $(git tag --points-at HEAD)) {
$tagWithoutSuffix = $tag -replace '-.*$'
if (Copy-Item -Path "target\release\$tagWithoutSuffix" -Destination "$tagWithoutSuffix_x86_64-pc-windows-msvc") {
gh release upload $tag "$tagWithoutSuffix_x86_64-pc-windows-msvc"
}
}
docker:
runs-on: ubuntu-latest
needs: linux
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/download-artifact@v4
with:
name: goldboot-x86_64-unknown-linux-musl
path: goldboot/linux-amd64
- uses: actions/download-artifact@v4
with:
name: goldboot-aarch64-unknown-linux-musl
path: goldboot/linux-arm64
- uses: actions/download-artifact@v4
with:
name: goldboot-registry-x86_64-unknown-linux-musl
path: goldboot/linux-amd64
- uses: actions/download-artifact@v4
with:
name: goldboot-registry-aarch64-unknown-linux-musl
path: goldboot/linux-arm64
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Find version tags
id: get_tags
run: |
for tag in $(git tag --points-at HEAD); do
echo "${tag%-*}=${tag##*-}" >>"$GITHUB_OUTPUT"
done
- uses: docker/build-push-action@v5
if: ${{ steps.get_tags.outputs.goldboot != '' }}
with:
context: goldboot
platforms: linux/amd64,linux/arm64 #,linux/arm/v7
push: true
tags: fossable/goldboot:latest,fossable/goldboot:${{ steps.get_tags.outputs.goldboot }}
- uses: docker/build-push-action@v5
if: ${{ steps.get_tags.outputs.goldboot-registry != '' }}
with:
context: goldboot-registry
platforms: linux/amd64,linux/arm64 #,linux/arm/v7
push: true
tags: fossable/goldboot-registry:latest,fossable/goldboot-registry:${{ steps.get_tags.outputs.goldboot-registry }}
- uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: fossable/goldboot