Skip to content

Commit

Permalink
Merge pull request #21 from airframesio/matrix-reloaded
Browse files Browse the repository at this point in the history
Build Matrix Hopefully Working
  • Loading branch information
lanefu authored Nov 5, 2023
2 parents 89cedc3 + 7fbe923 commit 92905f4
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 76 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/artifact-image-complete-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
name: "artifact-image-complete-matrix"

on:
# schedule:
# - cron: '0 1 * * *' # Scheduled runs every day at 2am UTC
# schedule:
# - cron: '0 1 * * *' # Scheduled runs every day at 2am UTC
workflow_dispatch:
inputs:
skipImages:
Expand All @@ -22,7 +22,7 @@ on:
checkOci:
description: 'Check OCI for existing artifacts? yes = check OCI, no = always build everything'
required: true
options: [ 'yes', 'no' ]
options: [ 'no', 'yes' ]
type: choice
skipCustomRepo:
description: 'Skip custom repo? yes = skip custom repo, no = use custom repo'
Expand Down Expand Up @@ -395,7 +395,7 @@ jobs:
publish-debs-to-repo:
name: "publish debs to repo"
runs-on: [ "self-hosted", "Linux", 'armbian', "debs-to-repo" ]
if: ${{ !failure() && !cancelled() && (github.event.inputs.targetsFilterInclude == '') }} # eg: run if dependencies worked. See https://github.com/orgs/community/discussions/45058#discussioncomment-4817378
if: ${{ !failure() && !cancelled() && (github.event.inputs.targetsFilterInclude == 'LEAVE_BRITNEY_ALONE') }} # eg: run if dependencies worked. See https://github.com/orgs/community/discussions/45058#discussioncomment-4817378
needs: [ "matrix_prep", "all-artifacts-ready" ]
steps:
# Prepare dependencies.
Expand Down Expand Up @@ -508,7 +508,7 @@ jobs:
- name: Integrated reprepro-based deb-download and reprepro script generation
id: rolling-repo-reprepro-download-script
run: |
bash ./compile.sh airwaves-os debs-to-repo-rolling-reprepro REPO_REPREPRO_PATH=/armbian/output/reprepro-db REPO_GPG_KEYID="${{ steps.import_gpg.outputs.keyid }}" BETA=${{ github.event.inputs.nightly || 'yes' }} ${{env.EXTRA_PARAMS_ALL_BUILDS}}
bash ./compile.sh airwaves-os debs-to-repo-rolling-reprepro REPO_REPREPRO_PATH=/armbian/output/reprepro-db REPO_GPG_KEYID="${{ steps.import_gpg.outputs.keyid }}" BETA=${{ github.event.inputs.nightly || 'yes' }} ${{env.EXTRA_PARAMS_ALL_BUILDS}} OCI_TARGET_BASE=${{env.OCI_TARGET_BASE}}
- name: "Logs debs-to-repo-rolling-reprepro: ${{ steps.rolling-repo-reprepro-download-script.outputs.logs_url }}"
run: |
Expand Down
29 changes: 29 additions & 0 deletions armbian/armbian-userpatches/gha/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# gha matrix automation

## how does this work

TLDR; it's complicated I'll get back to you.

it's based on [rpardini's tooling](https://github.com/rpardini/armbian-build/tree/extensions/userpatches/gha)

as [noted here](https://github.com/rpardini/armbian-build/blob/f487f305753465a058082bf6ccada7588f5b1aac/userpatches/gha/chunks/750.single_repo.yaml#L198-L205) a pair of secrets for GPG signing key was configured in GHA

## updating matrix

### light changes

if just updating board list, this should be sufficient

update `armbian-userpatches/targets.yaml`

### broader changes..

anything beyond a board item, you need ot regerate everything

assumes armbian-build is already checked out

run this from the `airwaves-os/armbian` path

```
rclone sync armbian-userpatches armbian-build/userpatches;pushd armbian-build/;./compile.sh gha-matrix;./compile.sh gha-template MATRIX_ARTIFACT_CHUNKS=1 MATRIX_IMAGE_CHUNKS=1;cp output/info/artifact-image-complete-matrix.yml ../../.github/workflows/artifact-image-complete-matrix.yml ;popd
```
8 changes: 4 additions & 4 deletions armbian/armbian-userpatches/gha/chunks/050.single_header.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name: "artifact-image-complete-matrix"

on:
schedule:
- cron: '0 1 * * *' # Scheduled runs every day at 2am UTC
# schedule:
# - cron: '0 1 * * *' # Scheduled runs every day at 2am UTC
workflow_dispatch:
inputs:
skipImages:
Expand All @@ -19,7 +19,7 @@ on:
checkOci:
description: 'Check OCI for existing artifacts? yes = check OCI, no = always build everything'
required: true
options: [ 'yes', 'no' ]
options: [ 'no', 'yes' ]
type: choice
skipCustomRepo:
description: 'Skip custom repo? yes = skip custom repo, no = use custom repo'
Expand Down Expand Up @@ -49,7 +49,7 @@ env:
USERPATCHES_DIR: "[[userpatches_dir]]" # folder inside USERPATCHES_REPOSITORY

# Armbian envs. Adjust to your needs.
# OCI_TARGET_BASE: "ghcr.io/${{ github.repository }}/" # This is picked up by the Docker launcher automatically. It does _not_ override the targets.yaml during info resolution.
OCI_TARGET_BASE: "ghcr.io/${{ github.repository }}/" # This is picked up by the Docker launcher automatically. It does _not_ override the targets.yaml during info resolution.
DOCKER_ARMBIAN_BASE_COORDINATE_PREFIX: "ghcr.io/${{ github.repository }}:armbian-next-" # Use Docker image in same repo
DOCKER_SKIP_UPDATE: "yes" # Do not apt update/install/requirements/etc during Dockerfile build, trust DOCKER_ARMBIAN_BASE_COORDINATE_PREFIX's images are up-to-date

Expand Down
4 changes: 2 additions & 2 deletions armbian/armbian-userpatches/gha/chunks/750.single_repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs: # <TEMPLATE-IGNORE>
publish-debs-to-repo:
name: "publish debs to repo"
runs-on: [ "self-hosted", "Linux", 'armbian', "debs-to-repo" ]
if: ${{ !failure() && !cancelled() && (github.event.inputs.targetsFilterInclude == '') }} # eg: run if dependencies worked. See https://github.com/orgs/community/discussions/45058#discussioncomment-4817378
if: ${{ !failure() && !cancelled() && (github.event.inputs.targetsFilterInclude == 'LEAVE_BRITNEY_ALONE') }} # eg: run if dependencies worked. See https://github.com/orgs/community/discussions/45058#discussioncomment-4817378
needs: [ "matrix_prep", "all-artifacts-ready" ]
steps:
# Prepare dependencies.
Expand Down Expand Up @@ -119,7 +119,7 @@ jobs: # <TEMPLATE-IGNORE>
- name: Integrated reprepro-based deb-download and reprepro script generation
id: rolling-repo-reprepro-download-script
run: |
bash ./compile.sh [[userpatches_config_for_prepare_job]] debs-to-repo-rolling-reprepro REPO_REPREPRO_PATH=/armbian/output/reprepro-db REPO_GPG_KEYID="${{ steps.import_gpg.outputs.keyid }}" BETA=${{ github.event.inputs.nightly || 'yes' }} ${{env.EXTRA_PARAMS_ALL_BUILDS}}
bash ./compile.sh [[userpatches_config_for_prepare_job]] debs-to-repo-rolling-reprepro REPO_REPREPRO_PATH=/armbian/output/reprepro-db REPO_GPG_KEYID="${{ steps.import_gpg.outputs.keyid }}" BETA=${{ github.event.inputs.nightly || 'yes' }} ${{env.EXTRA_PARAMS_ALL_BUILDS}} OCI_TARGET_BASE=${{env.OCI_TARGET_BASE}}
- name: "Logs debs-to-repo-rolling-reprepro: ${{ steps.rolling-repo-reprepro-download-script.outputs.logs_url }}"
run: |
Expand Down
2 changes: 1 addition & 1 deletion armbian/armbian-userpatches/gha/gha_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ userpatches_ref: "main"
userpatches_dir: "armbian/armbian-userpatches" # folder inside the userpatches repo; use "." if stuff is in the root of the repo

ghcr_user: "${{ github.repository_owner }}"
userpatches_config_for_prepare_job: "airwaves-os" # use "" for no config file
userpatches_config_for_prepare_job: "airwaves-os" # use "" for no config file
93 changes: 29 additions & 64 deletions armbian/armbian-userpatches/targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,84 +4,38 @@ common-gha-configs:
default: "ubuntu-latest" # or a ["tag", "list"]
by-name:
kernel: [ "self-hosted", "Linux", 'armbian', "artifact-kernel" ]
uboot: [ "self-hosted", "Linux", 'armbian', "X64" ]
by-name-and-arch:
rootfs-arm64: [ "self-hosted", "Linux", 'armbian', "rootfs-arm64" ]
image-arm64: [ "self-hosted", "Linux", 'armbian', "image-arm64" ]
rootfs-armhf: [ "self-hosted", "Linux", 'armbian', "rootfs-armhf" ]
image-armhf: [ "self-hosted", "Linux", 'armbian', "image-armhf" ]
rootfs-riscv64: [ "self-hosted", "Linux", 'armbian', "rootfs-riscv64" ]
image-riscv64: [ "self-hosted", "Linux", 'armbian', "image-riscv64" ]

lists:

my-physical-boards: &my-physical-boards
airwaves-boards: &airwaves-boards
# Actual Physical boards
- { BOARD: odroidn2, BRANCH: edge }
- { BOARD: odroidhc4, BRANCH: edge }
- { BOARD: odroidn2l, BRANCH: edge }
- { BOARD: radxa-zero2, BRANCH: edge }
- { BOARD: radxa-zero, BRANCH: edge }
- { BOARD: orangepi3b, BRANCH: legacy }
- { BOARD: orangepi3b, BRANCH: edge }
- { BOARD: odroidm1, BRANCH: edge }
# - { BOARD: tinkerboard-2, BRANCH: legacy }
- { BOARD: rpi4b, BRANCH: edge, RELEASE: jammy } # rpi4b requires Ubuntu's flash-kernel and will be skipped for Debian
#- { BOARD: rpi4b, BRANCH: edge, RELEASE: jammy } # rpi4b requires Ubuntu's flash-kernel
- { BOARD: rockpro64, BRANCH: edge }
- { BOARD: rock-5b, BRANCH: legacy }
- { BOARD: orangepi5, BRANCH: legacy }
- { BOARD: lepotato, BRANCH: current }
- { BOARD: rockpro64, BRANCH: current }
- { BOARD: tritium-h5, BRANCH: current }
- { BOARD: pineh64-b, BRANCH: current }
- { BOARD: orangepi3-lts, BRANCH: current }
- { BOARD: rockpi-4b, BRANCH: edge }
- { BOARD: rockpi-4c, BRANCH: edge }
- { BOARD: rock-4se, BRANCH: edge }
- { BOARD: khadas-vim3l, BRANCH: edge, ENABLE_EXTENSIONS: "image-output-oowow" }
- { BOARD: khadas-vim3, BRANCH: edge, ENABLE_EXTENSIONS: "image-output-oowow" }
- { BOARD: khadas-vim4, BRANCH: legacy, ENABLE_EXTENSIONS: "image-output-oowow" }
- { BOARD: khadas-vim1s, BRANCH: legacy, ENABLE_EXTENSIONS: "image-output-oowow" }

my-virtual-boards: &my-virtual-boards
# UTM images, virtual
- { BOARD: uefi-arm64, BRANCH: edge, ENABLE_EXTENSIONS: image-output-utm }
- { BOARD: uefi-x86, BRANCH: edge, ENABLE_EXTENSIONS: image-output-utm }
# Plain UEFI's, for physical machines
- { BOARD: uefi-arm64, BRANCH: edge }
- { BOARD: uefi-x86, BRANCH: edge }

not-mine: &not-mine
#- { BOARD: orangepizero2, BRANCH: legacy }
#- { BOARD: odroidxu4, BRANCH: current }
#- { BOARD: bananapicm4io, BRANCH: edge }
#- { BOARD: aml-s9xx-box, BRANCH: edge }
#- { BOARD: helios64, BRANCH: edge }
#- { BOARD: rock-5b, BRANCH: collabora, RELEASE: bookworm }
# - { BOARD: orangepi5, BRANCH: edge }
#- { BOARD: hikey960, BRANCH: edge } # PR https://github.com/armbian/build/pull/5660
- { BOARD: hinlink-h28k, BRANCH: legacy } # PR https://github.com/armbian/build/pull/5747
#- { BOARD: tinkerboard, BRANCH: edge }
# very distant from being mine
# - { BOARD: star64, BRANCH: edge, RELEASE: sid } # only sid has proper riscv64 support in Debian?
#- { BOARD: helios64, BRANCH: current }
- { BOARD: tritium-h3, BRANCH: edge }
- { BOARD: tritium-h5, BRANCH: edge }
- { BOARD: rk322x-box, BRANCH: edge }
- { BOARD: rk322x-box, BRANCH: current }
#- { BOARD: nanopiduo2, BRANCH: current, RELEASE: bullseye }

home-assistant-boards: &home-assistant-boards
- { BOARD: odroidhc4, BRANCH: current }
#- { BOARD: tinkerboard-2, BRANCH: edge }

cloud-rescues: &cloud-rescues
# rescue e2img's, for both ddk and edge, x86 and arm64
- { BOARD: uefi-arm64, BRANCH: ddk, ENABLE_EXTENSIONS: uefi-rescue }
- { BOARD: uefi-arm64, BRANCH: edge, ENABLE_EXTENSIONS: uefi-rescue }
- { BOARD: uefi-x86, BRANCH: ddk, ENABLE_EXTENSIONS: uefi-rescue }
- { BOARD: uefi-x86, BRANCH: edge, ENABLE_EXTENSIONS: uefi-rescue }
# - { BOARD: khadas-vim3l, BRANCH: edge, ENABLE_EXTENSIONS: "image-output-oowow" }
# - { BOARD: khadas-vim3, BRANCH: edge, ENABLE_EXTENSIONS: "image-output-oowow" }
# - { BOARD: khadas-vim4, BRANCH: legacy, ENABLE_EXTENSIONS: "image-output-oowow" }
# - { BOARD: khadas-vim1s, BRANCH: legacy, ENABLE_EXTENSIONS: "image-output-oowow" }
# - { BOARD: uefi-arm64, BRANCH: edge, ENABLE_EXTENSIONS: image-output-utm }
# # Plain UEFI's, for physical machines
# - { BOARD: uefi-arm64, BRANCH: edge }
airwaves-boards-rpi: &airwaves-boards-rpi
# Actual Physical boards
- { BOARD: rpi4b, BRANCH: edge, RELEASE: jammy } # rpi4b requires Ubuntu's flash-kernel and will be skipped for Debian
- { BOARD: rpi4b, BRANCH: current, RELEASE: jammy } # rpi4b requires Ubuntu's flash-kernel and will be skipped for Debian

cloud-metadata: &cloud-metadata
# edge, x86 and arm64, with cloud-metadata
- { BOARD: uefi-x86, BRANCH: edge, ENABLE_EXTENSIONS: cloud-metadata }
- { BOARD: uefi-arm64, BRANCH: edge, ENABLE_EXTENSIONS: cloud-metadata }

targets:

Expand All @@ -95,7 +49,18 @@ targets:
BUILD_MINIMAL: "no" # quoting "no" is the first lesson of YAML
CLOUD_IMAGE: "no"
items: # list of reference-lists
- *my-physical-boards
- *airwaves-boards

cli-jammy:
enabled: yes
configs: [ airwaves-os ]
pipeline:
gha: *airwaves-gha
vars:
RELEASE: jammy
BUILD_MINIMAL: "no" # quoting "no" is the first lesson of YAML
CLOUD_IMAGE: "no"
items: # list of reference-lists
- *airwaves-boards-rpi


0 comments on commit 92905f4

Please sign in to comment.