Skip to content

Amiberry

Amiberry #82

Workflow file for this run

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"]}'