Building main Custom Armbian Images #81 #81
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: "Build Custom Armbian Images" | |
run-name: "Building ${{ github.ref_name }} Custom Armbian Images #${{ github.run_number }}" | |
on: | |
workflow_dispatch: | |
repository_dispatch: | |
types: ["custom"] | |
# Ensure there is only one instance of job running | |
concurrency: | |
# group: ${{ github.run_id }}-custom | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: false | |
# Allow writing packages | |
permissions: | |
contents: read | |
packages: write | |
env: | |
# Force specific version of armbian | |
ARMBIAN_VERSION: 24.5.0-trunk.434 | |
# Enable or disable building dietpi | |
BUILD_DIETPI: true | |
jobs: | |
build-armbian: | |
continue-on-error: true | |
# Create a matrix of all the types of images that we want to build. | |
strategy: | |
fail-fast: false | |
matrix: | |
release: | |
# - trixie | |
- bookworm | |
ui: | |
# - minimal | |
- server | |
# - xfce | |
kernel: | |
# - legacy | |
- vendor | |
name: "${{ matrix.ui }} | ${{ matrix.release }}-${{ matrix.kernel }}" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout Armbian os" | |
uses: actions/checkout@v4 | |
with: | |
repository: armbian/os | |
fetch-depth: 0 | |
clean: false | |
path: os | |
- name: "Checkout Armbian build framework" | |
uses: actions/checkout@v4 | |
with: | |
repository: armbian/build | |
fetch-depth: 0 | |
clean: false | |
path: build | |
# Checkout armbian branch of this repo (keeping separated for easier identification of modifications). | |
- name: "Checkout Armbian branch customisations" | |
uses: actions/checkout@v4 | |
with: | |
ref: "armbian" | |
fetch-depth: 0 | |
clean: false | |
path: custom | |
- name: Armbian Customisations | |
shell: bash | |
id: customisation | |
run: | | |
# copy os userpatches (from armbian repo) and | |
# copy custom user patches (from armbian branch of this repo) | |
mkdir -pv build/userpatches | |
rsync -av os/userpatches/. build/userpatches/ | |
[[ -d custom/userpatches ]] && rsync -av custom/userpatches/. build/userpatches/ | |
- name: Compile Armbian ${{ matrix.release }}-${{ matrix.kernel }} | |
id: compile | |
shell: bash | |
run: | | |
# Get kind of ui | |
if [[ "${{ matrix.ui }}" == minimal ]]; then | |
BUILD_DESKTOP="no" | |
BUILD_MINIMAL="yes" | |
elif [[ "${{ matrix.ui }}" == server ]]; then | |
BUILD_DESKTOP="no" | |
BUILD_MINIMAL="no" | |
else | |
BUILD_DESKTOP="yes" | |
BUILD_MINIMAL="no" | |
DESKTOP_ENVIRONMENT="${{ matrix.ui }}" | |
DESKTOP_APPGROUPS_SELECTED="" | |
DESKTOP_ENVIRONMENT_CONFIG_NAME="config_base" | |
fi | |
# go to build folder and checkout | |
cd build | |
git checkout main | |
# execute build command | |
./compile.sh "build" \ | |
REVISION="${{ env.ARMBIAN_VERSION }}" \ | |
BOARD="radxa-zero3" \ | |
BRANCH="${{ matrix.kernel }}" \ | |
RELEASE="${{ matrix.release }}" \ | |
KERNEL_CONFIGURE="no" \ | |
COMPRESS_OUTPUTIMAGE="sha,xz" \ | |
BUILD_DESKTOP="${BUILD_DESKTOP}" \ | |
BUILD_MINIMAL="${BUILD_MINIMAL}" \ | |
DESKTOP_ENVIRONMENT="${DESKTOP_ENVIRONMENT}" \ | |
DESKTOP_APPGROUPS_SELECTED="${DESKTOP_APPGROUPS_SELECTED}" \ | |
DESKTOP_ENVIRONMENT_CONFIG_NAME="${DESKTOP_ENVIRONMENT_CONFIG_NAME}" \ | |
SHARE_LOG="yes" \ | |
BETA="yes" \ | |
EXPERT="yes" | |
# ENABLE_EXTENSIONS="${{ inputs.armbian_extensions }}" \ | |
- name: Get file names | |
run: | | |
ls -R build/output/images/ | |
- name: Decompress Image | |
run: | | |
sudo unxz -k build/output/images/*.xz | |
- name: List all outputs | |
run: | | |
ls -R build/output/images/ | |
# Upload Armbian images to artifacts (we'll download them and add them to the release later). | |
- name: Upload Armbian Artifacts for Release | |
id: artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "armbian-${{ matrix.ui }}-${{ matrix.release }}-${{ matrix.kernel }}" | |
path: | | |
build/output/images/* | |
!build/output/images/*.img | |
- name: Build Diet PI | |
shell: bash | |
env: | |
G_GITOWNER: MichaIng | |
G_GITBRANCH: master | |
FP_ROOT_DEV: /dev/loop0p2 | |
CLONING_TOOL: dd | |
OUTPUT_IMG_NAME: DietPi_RadxaZero3-${{matrix.ui}}-${{ matrix.release }}-${{ matrix.kernel }} | |
OUTPUT_IMG_EXT: img | |
run: | | |
sudo --preserve-env bash -c "$(curl -sSfL 'https://raw.githubusercontent.com/MichaIng/DietPi/imager/.build/images/dietpi-imager')" -i build/output/images/*.img --add-dos-part | |
outputs: | |
armbian-artifacts: ${{ steps.artifacts.outputs.artifact-id }} | |
release: | |
runs-on: ubuntu-latest | |
needs: [build-armbian] | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "DATE=$(date +'%y.%m.%d')" >> $GITHUB_ENV | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- name: Display structure of downloaded files | |
run: ls -R | |
- uses: ncipollo/release-action@v1 | |
with: | |
tag: "${{ env.DATE }}" | |
name: "${{ env.DATE }} Radxa Images" | |
artifacts: "./*.txt,./*.xz,./*.sha" | |
allowUpdates: true | |
removeArtifacts: false | |
replacesArtifacts: true | |
makeLatest: true | |
token: "${{ secrets.ARMBIAN_SELF_DISPATCH_TOKEN }}" | |
body: | | |
Radxa Custom Images: | |
based on Armbian v${{ env.ARMBIAN_VERSION }} | |
# - uses: armbian/build@main | |
# with: | |
# armbian_token: "${{ secrets.GITHUB_TOKEN }}" # GitHub token | |
# armbian_release: "${{ matrix.release }}" | |
# armbian_target: "build" | |
# armbian_board: "radxa-zero3" | |
# armbian_ui: "${{ matrix.ui }}" | |
# armbian_kernel_branch: "${{ matrix.kernel }}" | |
# armbian_compress: "sha,xz" | |
# armbian_artifacts: "build/output/images/" | |
# armbian_release_tittle: "${{ steps.date.output.DATE }} Radxa Zero 3 W Images" | |
# armbian_release_body: "Build with [Armbian tools](https://github.com/armbian/build)" |