DietPi-Build #1214
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DietPi-Build | |
on: | |
workflow_dispatch: | |
inputs: | |
buildargs: | |
description: 'DietPi-Build arguments' | |
required: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.inputs.buildargs }} | |
cancel-in-progress: true | |
permissions: {} | |
defaults: | |
run: | |
working-directory: /dev/shm | |
shell: sh | |
jobs: | |
prep: | |
outputs: | |
buildargs: ${{ steps.buildargs.outputs.buildargs }} | |
# https://github.com/actions/runner-images | |
runs-on: ubuntu-22.04 | |
steps: | |
- id: buildargs | |
run: | | |
if [ "${{ github.event.inputs.buildargs }}" = 'all' ] | |
then | |
echo buildargs=[\ | |
'"-m 0 -a 1 -d 6 -e all", "-m 0 -a 2 -d 6 -e all", "-m 0 -a 3 -d 6 -e all", '\ | |
'"-m 0 -a 1 -d 7 -e all", "-m 0 -a 2 -d 7 -e all", "-m 0 -a 3 -d 7 -e all", '\ | |
'"-m 0 -a 1 -d 8 -e all", "-m 0 -a 2 -d 8 -e all", "-m 0 -a 3 -d 8 -e all", '\ | |
'"-m 10 -d 6", "-m 10 -d 7", "-m 10 -d 8", '\ | |
'"-m 11 -d 6", "-m 11 -d 7", "-m 11 -d 8", '\ | |
'"-m 12 -d 6", "-m 12 -d 7", "-m 12 -d 8", '\ | |
'"-m 15 -d 6", "-m 15 -d 7", "-m 15 -d 8", '\ | |
'"-m 16 -d 6", "-m 16 -d 7", "-m 16 -d 8", '\ | |
'"-m 20 -d 6 -v all", "-m 20 -d 7 -v all", "-m 20 -d 8 -v all", '\ | |
'"-m 21 -d 6", "-m 21 -d 7", "-m 21 -d 8", '\ | |
'"-m 21 -d 6 -i", "-m 21 -d 7 -i", "-m 21 -d 8 -i", '\ | |
'"-m 21 -d 6 -p gpt", "-m 21 -d 7 -p gpt", "-m 21 -d 8 -p gpt", '\ | |
'"-m 40 -d 6", "-m 40 -d 7", "-m 40 -d 8", '\ | |
'"-m 42 -d 6", "-m 42 -d 7", "-m 42 -d 8", '\ | |
'"-m 43 -d 6", "-m 43 -d 7", "-m 43 -d 8", '\ | |
'"-m 44 -d 6", "-m 44 -d 7", "-m 44 -d 8", '\ | |
'"-m 45 -d 6", "-m 45 -d 7", "-m 45 -d 8", '\ | |
'"-m 46 -d 6", "-m 46 -d 7", "-m 46 -d 8", '\ | |
'"-m 47 -d 6", "-m 47 -d 7", "-m 47 -d 8", '\ | |
'"-m 48 -d 6", "-m 48 -d 7", "-m 48 -d 8", '\ | |
'"-m 49.1 -d 6", "-m 49.1 -d 7", "-m 49.1 -d 8", '\ | |
'"-m 49.2 -d 6", "-m 49.2 -d 7", "-m 49.2 -d 8", '\ | |
'"-m 49.3 -d 6", "-m 49.3 -d 7", "-m 49.3 -d 8", '\ | |
'"-m 52 -d 6", "-m 52 -d 7", "-m 52 -d 8", '\ | |
'"-m 54 -d 6", "-m 54 -d 7", "-m 54 -d 8", '\ | |
'"-m 55 -d 6", "-m 55 -d 7", "-m 55 -d 8", '\ | |
'"-m 56 -d 6", "-m 56 -d 7", "-m 56 -d 8", '\ | |
'"-m 57 -d 6", "-m 57 -d 7", "-m 57 -d 8", '\ | |
'"-m 58 -d 6", "-m 58 -d 7", "-m 58 -d 8", '\ | |
'"-m 59 -d 6", "-m 59 -d 7", "-m 59 -d 8", '\ | |
'"-m 60 -d 6", "-m 60 -d 7", "-m 60 -d 8", '\ | |
'"-m 61 -d 6", '\ | |
'"-m 62.1 -d 6", "-m 62.2 -d 6", '\ | |
'"-m 63 -d 6", "-m 63 -d 7", "-m 63 -d 8", '\ | |
'"-m 64 -d 6", "-m 64 -d 7", "-m 64 -d 8", '\ | |
'"-m 65.1 -d 6", "-m 65.1 -d 7", "-m 65.1 -d 8", '\ | |
'"-m 65.2 -d 6", "-m 65.2 -d 7", "-m 65.2 -d 8", '\ | |
'"-m 66 -d 6", "-m 66 -d 7", "-m 66 -d 8", '\ | |
'"-m 67 -d 6", "-m 67 -d 7", "-m 67 -d 8", '\ | |
'"-m 68.1 -d 6", "-m 68.1 -d 7", "-m 68.1 -d 8", '\ | |
'"-m 68.2 -d 6", "-m 68.2 -d 7", "-m 68.2 -d 8", '\ | |
'"-m 68.3 -d 6", "-m 68.3 -d 7", "-m 68.3 -d 8", '\ | |
'"-m 70 -d 6 -e all", '\ | |
'"-m 72 -d 6", "-m 72 -d 7", "-m 72 -d 8", '\ | |
'"-m 73 -d 6", "-m 73 -d 7", "-m 73 -d 8", '\ | |
'"-m 74 -d 6", "-m 74 -d 7", "-m 74 -d 8", '\ | |
'"-m 75 -a 1 -d 5", "-m 75 -a 2 -d 5", "-m 75 -a 3 -d 5", "-m 75 -a 10 -d 5", '\ | |
'"-m 75 -a 1 -d 6", "-m 75 -a 2 -d 6", "-m 75 -a 3 -d 6", "-m 75 -a 10 -d 6", '\ | |
'"-m 75 -a 1 -d 7", "-m 75 -a 2 -d 7", "-m 75 -a 3 -d 7", "-m 75 -a 10 -d 7", '\ | |
'"-m 75 -a 1 -d 8", "-m 75 -a 2 -d 8", "-m 75 -a 3 -d 8", "-m 75 -a 10 -d 8", "-m 75 -a 11 -d 8", '\ | |
'"-m 76 -d 6", "-m 76 -d 7", "-m 76 -d 8", '\ | |
'"-m 77 -d 6", "-m 77 -d 7", "-m 77 -d 8", '\ | |
'"-m 78 -d 6", "-m 78 -d 7", "-m 78 -d 8", '\ | |
'"-m 79 -d 6", "-m 79 -d 7", "-m 79 -d 8", '\ | |
'"-m 80 -d 6", "-m 80 -d 7", "-m 80 -d 8", '\ | |
'"-m 81 -d 8", '\ | |
'"-m 82 -d 6", "-m 82 -d 7", "-m 82 -d 8"]' >> "$GITHUB_OUTPUT" | |
elif [ "${{ github.event.inputs.buildargs }}" = 'quartz64' ] | |
then | |
echo buildargs=[\ | |
'"-m 49.1 -d 6", "-m 49.1 -d 7", "-m 49.1 -d 8", '\ | |
'"-m 49.2 -d 6", "-m 49.2 -d 7", "-m 49.2 -d 8", '\ | |
'"-m 49.3 -d 6", "-m 49.3 -d 7", "-m 49.3 -d 8"]' >> "$GITHUB_OUTPUT" | |
elif [ "${{ github.event.inputs.buildargs }}" = 'rpi' ] | |
then | |
echo buildargs=[\ | |
'"-m 0 -a 1 -d 6 -e all", "-m 0 -a 2 -d 6 -e all", "-m 0 -a 3 -d 6 -e all", '\ | |
'"-m 0 -a 1 -d 7 -e all", "-m 0 -a 2 -d 7 -e all", "-m 0 -a 3 -d 7 -e all", '\ | |
'"-m 0 -a 1 -d 8 -e all", "-m 0 -a 2 -d 8 -e all", "-m 0 -a 3 -d 8 -e all"]' >> "$GITHUB_OUTPUT" | |
else | |
echo buildargs='["${{ github.event.inputs.buildargs }}"]' >> "$GITHUB_OUTPUT" | |
fi | |
build: | |
needs: prep | |
strategy: | |
matrix: | |
buildargs: ${{ fromJson(needs.prep.outputs.buildargs) }} | |
fail-fast: false | |
name: "Build: ${{ matrix.buildargs }}" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Generate upload script | |
run: | | |
sudo dash -c 'umask 377; echo '\''${{ secrets.KNOWN_HOSTS }}'\'' > /root/.ssh/known_hosts; echo '\''${{ secrets.SSH_KEY }}'\'' > /root/.ssh/id_ed25519; > upload.sh; chmod 0711 upload.sh' | |
echo '#!/bin/dash | |
set -e | |
urls="\"https://dietpi.com/downloads/images/testing/\"" | |
for i in "$@"; do urls="$urls,\"https://dietpi.com/downloads/images/testing/${i##*/}\""; done | |
IFS=, | |
curl -T "{$*}" --key /root/.ssh/id_ed25519 '\''${{ secrets.UPLOAD_URL }}testing/'\'' | |
curl -H '\''Authorization: Bearer ${{ secrets.CF_TOKEN }}'\'' -H '\''Content-Type: application/json'\'' -d "{\"files\":[$urls]}" '\''https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE }}/purge_cache'\'' | |
echo' | sudo tee upload.sh > /dev/null | |
sudo gpg --batch --import << _EOF_ | |
${{ secrets.GPG_KEY }} | |
_EOF_ | |
- name: Run DietPi-Build | |
run: sudo bash -c "G_GITOWNER=$GITHUB_REPOSITORY_OWNER G_GITBRANCH=${GITHUB_REF#refs/heads/}; $(curl -sSf "https://raw.githubusercontent.com/$GITHUB_REPOSITORY_OWNER/DietPi/${GITHUB_REF#refs/heads/}/.build/images/dietpi-build")" 'DietPi-Build' ${{ matrix.buildargs }} --sign '${{ secrets.GPG_PASS }}' |