forked from MichaIng/DietPi
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (74 loc) · 3.46 KB
/
amiberry.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
name: Amiberry
on:
workflow_dispatch:
inputs:
plat:
description: 'Target platform'
type: choice
# https://github.com/BlitterStudio/amiberry/blob/master/Makefile
options: [rpi1-sdl2, rpi2-sdl2, rpi3-sdl2, rpi4-sdl2, rpi5-sdl2, rpi3-64-sdl2, rpi4-64-sdl2, rpi5-64-sdl2, c1, xu4, RK3288, sun8i, s812, AMLSM1, n2, a64, x86-64, rk3588, riscv64, all]
default: all
required: true
dist:
description: 'Target Debian version'
type: choice
options: [bullseye, bookworm, trixie, all]
default: all
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.inputs.plat }}-${{ github.event.inputs.dist }}
cancel-in-progress: true
permissions: {}
jobs:
prep:
outputs:
plat: ${{ steps.plat.outputs.plat }}
dist: ${{ steps.dist.outputs.dist }}
# https://github.com/actions/runner-images
runs-on: ubuntu-24.04
steps:
- id: plat
run: |
if [ '${{ github.event.inputs.plat }}' = 'all' ]
then
echo plat='["rpi1-sdl2", "rpi2-sdl2", "rpi3-sdl2", "rpi4-sdl2", "rpi5-sdl2", "rpi3-64-sdl2", "rpi4-64-sdl2", "rpi5-64-sdl2", "c1", "xu4", "RK3288", "sun8i", "s812", "AMLSM1", "n2", "a64", "x86-64", "rk3588", "riscv64"]' >> "$GITHUB_OUTPUT"
else
echo plat='["${{ github.event.inputs.plat }}"]' >> "$GITHUB_OUTPUT"
fi
- id: dist
run: |
if [ '${{ github.event.inputs.dist }}' = 'all' ]
then
echo dist='["bullseye", "bookworm", "trixie"]' >> "$GITHUB_OUTPUT"
else
echo dist='["${{ github.event.inputs.dist }}"]' >> "$GITHUB_OUTPUT"
fi
build:
needs: prep
strategy:
matrix:
plat: ${{ fromJson(needs.prep.outputs.plat) }}
dist: ${{ fromJson(needs.prep.outputs.dist) }}
exclude:
- { plat: riscv64, dist: bullseye }
- { plat: riscv64, dist: bookworm }
fail-fast: false
name: "${{ matrix.plat }} - ${{ matrix.dist }}"
# aarch64 build in QEMU-emulated Bullseye containers on Ubuntu Noble hosts fail:
# Processing triggers for libc-bin (2.31-13+deb11u10) ...
# qemu: uncaught target signal 11 (Segmentation fault) - core dumped
runs-on: ${{ matrix.dist == 'bullseye' && ( endsWith(matrix.plat, '-64-sdl2') || matrix.plat == 'AMLSM1' || matrix.plat == 'n2' || matrix.plat == 'a64' || matrix.plat == 'rk3588' ) && 'ubuntu-22.04' || 'ubuntu-24.04' }}
steps:
- name: Build
run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=$GITHUB_REF_NAME; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/$GITHUB_REF_NAME/.build/software/Amiberry/container_build.bash")" -- -p '${{ matrix.plat }}' -d '${{ matrix.dist }}'
- name: Upload
run: |
# SSH server and client keys
mkdir ~/.ssh
umask 377
echo '${{ secrets.KNOWN_HOSTS }}' > ~/.ssh/known_hosts
echo '${{ secrets.SSH_KEY }}' > ~/.ssh/id_ed25519
# Upload
curl -T 'rootfs/amiberry_${{ matrix.plat }}.deb' --key ~/.ssh/id_ed25519 '${{ secrets.UPLOAD_URL }}${{ matrix.dist }}/'
curl 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache' -H 'Authorization: Bearer ${{ secrets.CF_TOKEN }}' -H 'Content-Type: application/json' \
--data '{"files":["https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/","https://dietpi.com/downloads/binaries/${{ matrix.dist }}/testing/amiberry_${{ matrix.plat }}.deb"]}'