fixes: dont' schedule; use armbian/os userpatches for all jobs; separate config for use/don't-use userpatches repo and from where; don't DONT_BUILD_ARTIFACTS in config; disable all targets and keep only one; add config file to targets.yaml

This commit is contained in:
Ricardo Pardini
2023-05-03 11:37:54 +02:00
parent ec6bd9f79b
commit 4703ee196a
7 changed files with 110 additions and 28 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.idea
.vscode

View File

@@ -1,11 +1,9 @@
display_alert "Common settings for Armbian OS images" "setting default values" "info"
export SYNC_CLOCK=no # This takes waay too long, usually not needed
export INSTALL_HEADERS=no # dont install kernel headers package
export WIREGUARD=no # An extra package installed? No thanks.
#export BUILDING_IMAGE=yes
export KERNEL_CONFIGURE=no
export MAINTAINERMAIL=info@armbian.com
export MAINTAINER="Armbian Linux"
export COMPRESS_OUTPUTIMAGE="sha,img,xz"
export DONT_BUILD_ARTIFACTS="kernel,rootfs"
declare -g SYNC_CLOCK=no # This takes waay too long, usually not needed
declare -g INSTALL_HEADERS=no # dont install kernel headers package # @TODO: rpardini: this should be 'yes' when we get everything stable, so we _test_ the headers package during image build
declare -g WIREGUARD=no # An extra package installed? No thanks.
declare -g MAINTAINERMAIL=info@armbian.com
declare -g MAINTAINER="Armbian Linux"
declare -g COMPRESS_OUTPUTIMAGE="sha,img,xz"
# declare -g DONT_BUILD_ARTIFACTS="any,kernel,rootfs" # rpardini: this is only for images, so in the workflow/templates, not here!

View File

@@ -1,8 +1,8 @@
name: "Build All Artifacts"
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:
@@ -18,17 +18,23 @@ on:
env:
# For easier reuse across the multiple chunks
# For easier reuse across the multiple chunks ('armbian/build' repo)
BUILD_REPOSITORY: "[[org_and_build_repo]]"
BUILD_REF: "[[build_ref]]" # branch or tag or sha1
# For easier reuse across the multiple chunks ('armbian/os' repo)
USERPATCHES_REPOSITORY: "[[org_and_userpatches_repo]]"
USERPATCHES_REF: "[[userpatches_ref]]" # branch or tag or sha1
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.
DOCKER_ARMBIAN_BASE_COORDINATE_PREFIX: "ghcr.io/armbian/docker-armbian-build:armbian-" # 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
# These are mostly for developers which have their own Docker images, not main Armbian.
#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/armbian/docker-armbian-build:armbian-" # 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
# Added to every image build arguments.
EXTRA_PARAMS_IMAGE: "'DONT_BUILD_ARTIFACTS=kernel,firmware,full_firmware,rootfs,fake_ubuntu_advantage_tools,armbian-config,armbian-zsh,armbian-plymouth-theme' 'IMAGE_VERSION=20230500-${{ github.repository_owner }}' COMPRESS_OUTPUTIMAGE=xz SHOW_DEBIAN=yes SHARE_LOG=yes "
EXTRA_PARAMS_IMAGE: "'DONT_BUILD_ARTIFACTS=any,kernel,firmware,full_firmware,rootfs,fake_ubuntu_advantage_tools,armbian-config,armbian-zsh,armbian-plymouth-theme' 'IMAGE_VERSION=20230500-rc0' COMPRESS_OUTPUTIMAGE=xz SHOW_DEBIAN=yes SHARE_LOG=yes "
jobs:
@@ -41,6 +47,11 @@ jobs:
- name: Runner clean
uses: armbian/actions/runner-clean@main
# cleanup the place where we will clone the userpatches repo, to avoid git going insane and cleaning everything later
- name: Cleanup userpatches repo
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
run: rm -rfv userpatches.repo
- name: Checkout build repo
uses: actions/checkout@v3 # We don't need to clone git, really. A wget would suffice for GH-hosted runners. But using clone is better for Igor-hosted runners.
with:
@@ -49,9 +60,28 @@ jobs:
fetch-depth: 1
clean: false # true is default. it *will* delete the hosts /dev if mounted inside.
- name: grab the sha1 of the latest commit
- name: "grab the sha1 of the latest commit of the build repo ${{ env.BUILD_REPOSITORY }}#${{ env.BUILD_REF }}"
id: latest-commit
run: echo "sha1=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
# clone the userpatches repo (`armbian/os`)
- name: "Checkout userpatches repo: ${{env.USERPATCHES_REPOSITORY}}#${{env.USERPATCHES_REF}}"
uses: actions/checkout@v3
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
with:
repository: ${{ env.USERPATCHES_REPOSITORY }}
ref: ${{ env.USERPATCHES_REF }}
fetch-depth: 1
clean: false # true is default.
path: userpatches.repo
- name: "Put userpatches in place, and remove userpatches repo"
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
run: |
mkdir -pv userpatches
rsync -av userpatches.repo/${{env.USERPATCHES_DIR}}/. userpatches/
rm -rfv userpatches.repo
ls -lahR userpatches # debug
- name: GitHub cache
id: cache-restore

View File

@@ -22,6 +22,11 @@ jobs: # <TEMPLATE-IGNORE>
username: "[[ghcr_user]]" # GitHub username or org
password: ${{ secrets.GITHUB_TOKEN }} # GitHub actions builtin token. repo has to have pkg access.
# cleanup the place where we will clone the userpatches repo, to avoid git going insane and cleaning everything later
- name: Cleanup userpatches repo
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
run: rm -rfv userpatches.repo
- name: Checkout build repo
uses: actions/checkout@v3 # We don't need to clone git, really. A wget would suffice for GH-hosted runners. But using clone is better for Igor-hosted runners.
with:
@@ -30,6 +35,25 @@ jobs: # <TEMPLATE-IGNORE>
fetch-depth: 1
clean: false # true is default. it *will* delete the hosts /dev if mounted inside.
# clone the userpatches repo (`armbian/os`)
- name: "Checkout userpatches repo: ${{env.USERPATCHES_REPOSITORY}}#${{env.USERPATCHES_REF}}"
uses: actions/checkout@v3
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
with:
repository: ${{ env.USERPATCHES_REPOSITORY }}
ref: ${{ env.USERPATCHES_REF }}
fetch-depth: 1
clean: false # true is default.
path: userpatches.repo
- name: "Put userpatches in place, and remove userpatches repo"
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
run: |
mkdir -pv userpatches
rsync -av userpatches.repo/${{env.USERPATCHES_DIR}}/. userpatches/
rm -rfv userpatches.repo
ls -lahR userpatches # debug
- name: Build ${{matrix.desc}}
id: build
run: |

View File

@@ -11,6 +11,10 @@ jobs: # <TEMPLATE-IGNORE>
name: ${{ matrix.desc || 'Empty I[[chunk]]' }} # <-- HERE: Chunk number.
runs-on: ${{ matrix.runs_on }}
steps:
# cleanup the place where we will clone the userpatches repo, to avoid git going insane and cleaning everything later
- name: Cleanup userpatches repo
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
run: rm -rfv userpatches.repo
- name: Checkout build repo
uses: actions/checkout@v3
@@ -19,6 +23,25 @@ jobs: # <TEMPLATE-IGNORE>
ref: ${{ needs.matrix_prep.outputs.build-sha1 }}
clean: false # true is default. it *will* delete the hosts /dev if mounted inside.
# clone the userpatches repo (`armbian/os`)
- name: "Checkout userpatches repo: ${{env.USERPATCHES_REPOSITORY}}#${{env.USERPATCHES_REF}}"
uses: actions/checkout@v3
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
with:
repository: ${{ env.USERPATCHES_REPOSITORY }}
ref: ${{ env.USERPATCHES_REF }}
fetch-depth: 1
clean: false # true is default.
path: userpatches.repo
- name: "Put userpatches in place, and remove userpatches repo"
if: ${{ ( env.USERPATCHES_REPOSITORY != '' ) && ( env.USERPATCHES_REF != '' ) }}
run: |
mkdir -pv userpatches
rsync -av userpatches.repo/${{env.USERPATCHES_DIR}}/. userpatches/
rm -rfv userpatches.repo
ls -lahR userpatches # debug
- name: Cleanup leftover output images
run: |
rm -rfv output/images userpatches/VERSION

View File

@@ -1,5 +1,13 @@
org: "armbian" # can't be an expression, only string.
# armbian/build coordinates
org_and_build_repo: "armbian/build"
build_ref: "main"
# armbian/os coordinates. set all to empty to not use userpatches.
org_and_userpatches_repo: "armbian/os"
userpatches_ref: "main"
userpatches_dir: "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: "" # use "" for no config file
userpatches_config_for_prepare_job: "armbian-images" # use "" for no config file

View File

@@ -8,14 +8,10 @@ common-gha-configs:
rootfs-arm64: [ "self-hosted", "Linux", 'fast', "ARM64" ]
image-arm64: [ "self-hosted", "Linux", 'fast', "ARM64" ]
lists:
my-boards: &my-boards
# Actual Physical boards
- { BOARD: odroidn2, BRANCH: edge }
targets:
all:
enabled: no # DISABLED! for now
configs: [ armbian-images ]
pipeline:
gha: *armbian-gha
vars:
@@ -28,13 +24,14 @@ targets:
not-eos: "yes"
cli-debian:
enabled: yes
configs: [ armbian-images ]
pipeline:
gha: *armbian-gha
build-image: "yes"
enabled: yes
build-image: "yes"
vars:
RELEASE: bookworm
BUILD_MINIMAL: "no"
BUILD_DESKTOP: "no"
items: # list of reference-lists
- *my-boards
items: # simple hardcoded list
- { BOARD: odroidn2, BRANCH: edge }