forked from AmberELEC/AmberELEC
-
Notifications
You must be signed in to change notification settings - Fork 5
418 lines (389 loc) · 21.2 KB
/
build-main.yaml
File metadata and controls
418 lines (389 loc) · 21.2 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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
name: build-main
on:
repository_dispatch:
types: [release-beta, release-prerelease, release-draft, release-dev]
workflow_dispatch:
push:
paths-ignore:
- '.github/**'
- 'LICENSE.md'
- 'Dockerfile'
- '.dockerignore'
branches:
- main
- dev
# Ensure that if there are multiple builds for main only 1 is queued during a build
# Example: 1st commit in main starts a build then 2-9 commits come in during the first build.
# 'concurrency' makes it so that only commit 9 is enqueued to build rather builds 2-9 all runing a build.
concurrency:
group: main
env:
# This is used by 'make docker-*' commands to determine image to build with
DOCKER_IMAGE: ghcr.io/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}-build:latest
jobs:
build-init:
timeout-minutes: 60
runs-on: main
steps:
#- uses: hmarr/debug-action@v2
# name: debug
- name: Get current branch as it may not be 'default branch'
id: branch
run: |
branch_arg="${{ github.event.client_payload.branch }}"
if [[ -z "$branch_arg" ]]; then
branch_arg="$GITHUB_REF_NAME"
fi
echo "branch=$branch_arg" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
name: Checkout
with:
clean: false
ref: "${{ steps.branch.outputs.branch }}"
build-rg351p:
needs: [build-init]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Build RG351P
run: |
set -e
export CUSTOM_VERSION="${{ steps.version.outputs.version }}"
make DOCKER_WORK_DIR=/work docker-RG351P
build-rg351v:
needs: [build-init, build-rg351p]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Build RG351V
run: |
set -e
export CUSTOM_VERSION="${{ steps.version.outputs.version }}"
make DOCKER_WORK_DIR=/work docker-RG351V
build-rg351mp:
needs: [build-init, build-rg351p, build-rg351v]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Build RG351MP
run: |
set -e
export CUSTOM_VERSION="${{ steps.version.outputs.version }}"
make DOCKER_WORK_DIR=/work docker-RG351MP
build-rg552:
needs: [build-init, build-rg351p, build-rg351v, build-rg351mp]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Build RG552
run: |
set -e
export CUSTOM_VERSION="${{ steps.version.outputs.version }}"
make DOCKER_WORK_DIR=/work docker-RG552
build-finalize:
needs: [build-init, build-rg351p, build-rg351v, build-rg351mp, build-rg552]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Cleanup system artifacts
run: |
set -e
rm -rf release/aarch64/RG*/*.system*
rm -rf release/aarch64/RG*/*.kernel*
- name: Cleanup system artifacts (no .img in non-release 'main' builds)
if: github.event.client_payload.release_tag == ''
run: |
set -e
#main builds only include the .tar for speed
rm -rf release/aarch64/RG*/*.img.gz*
- name: Archive RG351V (${{github.sha}})
uses: actions/upload-artifact@v4
if: github.event.client_payload.release_tag == ''
with:
name: RG351V-dev-main-${{ steps.date.outputs.date }}-${{steps.sha.outputs.sha}}
path: |
release/aarch64/RG351V/
- name: Archive RG351P (${{github.sha}})
if: github.event.client_payload.release_tag == ''
uses: actions/upload-artifact@v4
with:
name: RG351P-dev-main-${{ steps.date.outputs.date }}-${{steps.sha.outputs.sha}}
path: |
release/aarch64/RG351P/
- name: Archive RG351MP (${{github.sha}})
if: github.event.client_payload.release_tag == ''
uses: actions/upload-artifact@v4
with:
name: RG351MP-dev-main-${{ steps.date.outputs.date }}-${{steps.sha.outputs.sha}}
path: |
release/aarch64/RG351MP/
- name: Archive RG552 (${{github.sha}})
if: github.event.client_payload.release_tag == ''
uses: actions/upload-artifact@v4
with:
name: RG552-dev-main-${{ steps.date.outputs.date }}-${{steps.sha.outputs.sha}}
path: |
release/aarch64/RG552/
- name: Create pre-release as draft at first to hide during uploads
if: github.event.action == 'release-prerelease'
uses: ncipollo/release-action@v1.13.0
with:
tag: "${{ steps.version.outputs.version }}"
body: |
# Release Notes (Prerelease)
This is a prerelease based on the commit: ${{ github.event.repository.full_name }}@${{github.sha}}.
Prereleases are provided for the community to test fixes and explore new functionality. Please DO NOT open issues on this build and instead post in the `#pre-release-feedback` section on our Discord server.
See our [website](https://amberelec.org/contributing/contributing-to-amberelec) for more info.
### Changes (since last prerelease version):
${{ github.event.client_payload.release_notes }}
### Upgrade Instructions
You can update to this release using the `prerelease` channel on your device. This is the recommended way to use prerelease versions.
If you want to manually update, download the matching .tar from below and place it on your devices update folder (`GAMES/update` or `/roms/update`) on your microSD card (slot 2 if you use two cards).
> [!CAUTION]
> Do not replace or rename any of the `.dtb` files after flashing a new image or updating from an older AmberELEC release.
> To simplify the process and reduce complexity, we're determining which display the device is using, so no manual interaction is necessary.
<!--devices-->
<table>
<tr>
<td align="center" width="70" nowrap="nowrap">SoC</td>
<td align="center" width="150" nowrap="nowrap">Manufacturer</td>
<td align="center" width="150" nowrap="nowrap">Device</td>
<td align="center" width="120" nowrap="nowrap">New Installation</td>
<td align="center" width="120" nowrap="nowrap">Upgrade</td>
</tr>
<tr>
<td>RK3399</td>
<td>Anbernic</td>
<td>RG552</td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG552.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG552.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td rowspan="10">RK3326</td>
<td rowspan="4">Anbernic</td>
<td>RG351P</td>
<td rowspan="2" align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td rowspan="2" align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td>RG351M</td>
</tr>
<tr>
<td>RG351V</td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td>RG351MP</td>
<td rowspan="7" align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td rowspan="7" align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td rowspan="2">PowKiddy</td>
<td>RGB20S</td>
</tr>
<tr>
<td>Magicx XU10</td>
</tr>
<tr>
<td rowspan="2">Game Console<br />Game Station</td>
<td>R35S</td>
</tr>
<tr>
<td>R36S</td>
</tr>
<tr>
<td>SZDiiER</td>
<td>D007 Plus</td>
</tr>
</table>
<!--devices-->
artifacts: "release/aarch64/RG351P/*, release/aarch64/RG351V/*, release/aarch64/RG351MP/*, release/aarch64/RG552/*"
prerelease: true
draft: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: AmberELEC-prerelease
- name: Switch draft to start showing release
if: github.event.action == 'release-prerelease'
uses: ncipollo/release-action@v1.13.0
with:
tag: "${{ steps.version.outputs.version }}"
allowUpdates: true
draft: false
prerelease: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: AmberELEC-prerelease
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Create dev release as draft at first to hide during uploads
if: github.event.action == 'release-dev'
uses: ncipollo/release-action@v1.13.0
with:
tag: "${{ steps.version.outputs.version }}"
body: |
# Release Notes (Dev - Unsupported)
This is an **unsupported dev release** based on the commit: ${{ github.event.repository.full_name }}@${{github.sha}}.
Unless you were asked by a developer to use this build or **are** a developer. **Do not use this build.**
### Changes (since last dev build):
${{ github.event.client_payload.release_notes }}
### Upgrade Instructions
You can update to this release using the `prerelease` channel on your device if you take the following steps:
- Under`System Settings` -> `Developer` (`Updates` section), set the following:
-`GITHUB ORG` = `351dev`
-`GITHUB REPO` = `builds`
artifacts: "release/aarch64/RG351P/*, release/aarch64/RG351V/*, release/aarch64/RG351MP/*, release/aarch64/RG552/*"
prerelease: true
draft: true
token: ${{ secrets.TRIGGER_DEV_BUILD_TOKEN }}
owner: 351dev
repo: dev-builds
- name: Switch draft to start showing release
if: github.event.action == 'release-dev'
uses: ncipollo/release-action@v1.13.0
with:
tag: "${{ steps.version.outputs.version }}"
allowUpdates: true
draft: false
prerelease: true
token: ${{ secrets.TRIGGER_DEV_BUILD_TOKEN }}
owner: 351dev
repo: dev-builds
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
#This can be removed after no more 'bridge' betas are needed
- name: Create pre-release as draft at first to hide during uploads
if: github.event.action == 'release-beta'
uses: ncipollo/release-action@v1.13.0
with:
tag: "${{ steps.version.outputs.version }}"
body: |
# Release Notes (Beta)
This beta is provided as a OTA bridge to the new pre-releases
### Upgrade Instructions
You can update to this release using the `beta` channel on your device. This is the recommended way to use beta versions.
**IMPORTANT NOTE**: There are **three different images** below, one for the **RG351P/M**, **RG351V** and **RG351MP**!
**If you download the incorrect image for your device, it will not boot!** If you are unsure, use the the following links:
**New Installations** (`.img.gz`): **[RG351P/M](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG351V](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG351MP](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz)**
**Upgrades** (place in `/storage/roms/update`): **[RG351P/M](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG351V](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG351MP](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.tar)**
artifacts: "release/aarch64/RG351P/*, release/aarch64/RG351V/*, release/aarch64/RG351MP/*, release/aarch64/RG552/*"
prerelease: true
draft: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: AmberELEC-prerelease
- name: Switch draft to start showing release
if: github.event.action == 'release-beta'
uses: ncipollo/release-action@v1.13.0
with:
tag: "${{ steps.version.outputs.version }}"
allowUpdates: true
draft: false
prerelease: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: AmberELEC-prerelease
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Create draft release
uses: softprops/action-gh-release@v1
if: github.event.action == 'release-draft'
with:
tag_name: "${{ steps.version.outputs.version }}"
name: "AmberELEC - ${{ steps.version.outputs.version }} - ${{ github.event.client_payload.release_name }}"
body: |
# Release Notes
Welcome to the ${{ github.event.client_payload.release_name}} (${{ steps.version.outputs.version }}) release.
General:
New Stuff:
Fixes:
**IMPORTANT NOTE**: There are **four different images** below, one for the **RG351P/M**, **RG351V**, **RG351MP** and **RG552**!
**If you download the incorrect image for your device, it will not boot!** If you are unsure, use the the following links:
**New Installations** (`.img.gz`): **[RG351P/M](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG351V](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG351MP](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG552](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG552.aarch64-${{ steps.version.outputs.version }}.img.gz)**
**Upgrades** (place in `/storage/roms/update`): **[RG351P/M](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG351V](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG351MP](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG552](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG552.aarch64-${{ steps.version.outputs.version }}.tar)**
files: |
release/aarch64/RG351P/*
release/aarch64/RG351V/*
release/aarch64/RG351MP/*
release/aarch64/RG552/*
prerelease: true
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}