Skip to content

Build for rgb30 on github-hosted_ubuntu-24.04 #179

Build for rgb30 on github-hosted_ubuntu-24.04

Build for rgb30 on github-hosted_ubuntu-24.04 #179

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
board:
description: 'Select board to build'
required: true
type: choice
options:
- h700
- h700_consoleonly
- h700_rootrw
- h700_sway
- rgb30
- rgb30_consoleonly
- pi3b
- pi3b_development
- qemu_aarch64
- qemu_aarch64_development
runner:
description: 'Select runner type'
required: true
type: choice
options:
- github-hosted_ubuntu-24.04
- github-hosted_ubuntu-24.04-arm
- self-hosted_debian12-sachchat2
- self-hosted_ubuntu-24.04
- self-hosted_ubuntu-25.04-arm
create_release:
description: 'Create GitHub release with name (and tag): (leave empty for no release)'
required: false
type: string
run-name: Build for ${{ inputs.board }} on ${{ inputs.runner }}
jobs:
build:
runs-on: ${{ (inputs.runner == 'github-hosted_ubuntu-24.04' && 'ubuntu-24.04') || (inputs.runner == 'github-hosted_ubuntu-24.04-arm' && 'ubuntu-24.04-arm') || (inputs.runner == 'self-hosted_debian12-sachchat2' && fromJSON('["self-hosted","debian12-sachchat2"]')) || (inputs.runner == 'self-hosted_ubuntu-24.04' && fromJSON('["self-hosted","ubuntu-24.04"]')) || (inputs.runner == 'self-hosted_ubuntu-25.04-arm' && fromJSON('["self-hosted","ubuntu-25.04-arm"]')) }}
permissions:
contents: write
steps:
- name: Checkout main repo
uses: actions/checkout@v5
with:
path: TiniLinux
- name: Create board build config
run: |
set -x
cd TiniLinux
./scripts/make-board-build.sh configs/${{ inputs.board }}_defconfig
cd output/${{ inputs.board }}
- name: Install deps
if: ${{ inputs.runner == 'github-hosted_ubuntu-24.04' || inputs.runner == 'github-hosted_ubuntu-24.04-arm' }}
run: |
# disable mandb to save build time
sudo mv /usr/bin/mandb /usr/bin/mandb-OFF
sudo cp -p /bin/true /usr/bin/mandb
sudo rm -r /var/cache/man
# install packages
sudo apt update && sudo apt install -y build-essential cmake mtools
- name: Install deps (fix)
if: ${{ inputs.board == 'pi3b_development' || inputs.board == 'qemu_aarch64_development' }}
run: |
### FIX for development boards on ubuntu 24.04 as mkfs.ext4 didn't accept tar (mk-flashable-img-rootrw-rootless.sh:L108)
wget https://code.launchpad.net/ubuntu/+source/e2fsprogs/1.47.1-1ubuntu1/+build/28603966/+files/libext2fs2t64_1.47.1-1ubuntu1_amd64.deb
wget https://code.launchpad.net/ubuntu/+source/e2fsprogs/1.47.1-1ubuntu1/+build/28603966/+files/libcom-err2_1.47.1-1ubuntu1_amd64.deb
wget https://code.launchpad.net/ubuntu/+source/e2fsprogs/1.47.1-1ubuntu1/+build/28603966/+files/comerr-dev_2.1-1.47.1-1ubuntu1_amd64.deb
wget https://code.launchpad.net/ubuntu/+source/e2fsprogs/1.47.1-1ubuntu1/+build/28603966/+files/e2fsprogs_1.47.1-1ubuntu1_amd64.deb
wget https://code.launchpad.net/ubuntu/+source/e2fsprogs/1.47.1-1ubuntu1/+build/28603966/+files/libss2_1.47.1-1ubuntu1_amd64.deb
wget https://code.launchpad.net/ubuntu/+source/e2fsprogs/1.47.1-1ubuntu1/+build/28603966/+files/libext2fs-dev_1.47.1-1ubuntu1_amd64.deb
sudo dpkg -i libcom-err2_1.47.1-1ubuntu1_amd64.deb
sudo dpkg -i libext2fs2t64_1.47.1-1ubuntu1_amd64.deb
sudo dpkg -i libss2_1.47.1-1ubuntu1_amd64.deb
sudo dpkg -i comerr-dev_2.1-1.47.1-1ubuntu1_amd64.deb
sudo dpkg -i libext2fs-dev_1.47.1-1ubuntu1_amd64.deb
sudo dpkg -i e2fsprogs_1.47.1-1ubuntu1_amd64.deb
sudo apt -f install
# - name: Maximize build space
# if: ${{ inputs.runner == 'github-hosted_ubuntu-24.04' || inputs.runner == 'github-hosted_ubuntu-24.04-arm' }}
# uses: easimon/maximize-build-space@master
# with:
# root-reserve-mb: 8192
# swap-size-mb: 1024
# remove-dotnet: 'true'
# remove-android: 'true'
# # remove-haskell: 'true'
# # remove-codeql: 'true'
# remove-docker-images: 'true'
- name: Restore dl cache
uses: actions/cache@v5
with:
path: TiniLinux/dl
key: dl-cache-${{ inputs.board }}-${{ hashFiles(format('TiniLinux/output/{0}/.config', inputs.board)) }}
restore-keys: |
dl-cache-${{ inputs.board }}-
- name: Restore ccache
uses: actions/cache@v5
with:
path: TiniLinux/.buildroot-ccache
key: ccache-${{ inputs.board }}-${{ hashFiles(format('TiniLinux/output/{0}/.config', inputs.board)) }}
restore-keys: |
ccache-${{ inputs.board }}-
- name: Build
run: |
set -x
cd TiniLinux/output/${{ inputs.board }}
# download packages
make source -s
# build
time make -j$(nproc) -s
make ccache-stats
# remove some heavy packages after built to save space (for dl-cache optimization)
find ../../dl -name '*git' -type d -exec rm -rf {} +
rm -rf ../../dl/linux
rm -rf ../../dl/linux-firmware
rm -rf ../../dl/rpi-firmware
- name: Make flashable image
run: |
set -x
cd TiniLinux/output/${{ inputs.board }}
ZIP=0 make img
if [ -n "${{ inputs.create_release }}" ]; then
cd images && zip -j tinilinux-${{ inputs.board }}.img.zip tinilinux-${{ inputs.board }}.img
fi
- name: Archive build output
uses: actions/upload-artifact@v7
with:
name: tinilinux-${{ inputs.board }}.img.zip # upload-artifact automatically zipped the file
path: TiniLinux/output/${{ inputs.board }}/images/tinilinux-${{ inputs.board }}.img
retention-days: 2
- name: Create Release
if: inputs.create_release != ''
uses: softprops/action-gh-release@v2
with:
files: TiniLinux/output/${{ inputs.board }}/images/tinilinux-${{ inputs.board }}.img.zip
generate_release_notes: false
name: ${{ inputs.create_release }}
tag_name: ${{ inputs.create_release }}