Skip to content

Rhino Linux Image Generation (Meta) #480

Rhino Linux Image Generation (Meta)

Rhino Linux Image Generation (Meta) #480

Workflow file for this run

name: Rhino Linux Image Generation (Meta)
on:
workflow_dispatch
jobs:
build:
strategy:
matrix:
include:
- target: amd64
runs-on: buildjet-4vcpu-ubuntu-2204
type: iso
- target: arm64
runs-on: buildjet-4vcpu-ubuntu-2204-arm
type: iso
- target: pine
runs-on: buildjet-4vcpu-ubuntu-2204-arm
type: tarball
ref: pinephone
- target: rpi
runs-on: buildjet-4vcpu-ubuntu-2204-arm
type: tarball
ref: rpi
- target: tab
runs-on: buildjet-4vcpu-ubuntu-2204-arm
type: tarball
ref: pinetab
runs-on: ${{ matrix.runs-on }}
container:
image: "ubuntu:latest"
options: --privileged
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.ref }}
- name: Install needed packages
run: |
rm -rf /var/lib/apt/lists/*
sed -i 's/jammy/noble/g' /etc/apt/sources.list
apt-get update && apt-get install --reinstall sudo debootstrap mtools dosfstools qemu-user-static binfmt-support dpkg-dev -y
ln -sfn /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/noble
dpkg -i debs/live-build_*_all.deb
mv /usr/share/debootstrap/functions functions
patch -i 0002-remove-WRONGSUITE-error.patch
mv functions /usr/share/debootstrap/functions
cp binary_grub-efi /usr/lib/live/build/binary_grub-efi
- name: set to tarball
if: matrix.type == 'tarball'
run: cp binary_rootfs /usr/lib/live/build/binary_rootfs || echo "no need to change offsets."
- name: Make scripts executable
run: chmod -R +x build.sh etc/auto/config etc/terraform.conf etc/
- name: Build system image
run: ./build.sh etc/terraform.conf
- name: export iso filename
if: matrix.type == 'iso'
run: echo "OUT_ISO=$(cd builds/${{ matrix.target }}; ls *.iso)" >> $GITHUB_ENV
- uses: actions/[email protected]
if: matrix.type == 'iso'
with:
name: ${{ env.OUT_ISO }}
path: builds/${{ matrix.target }}/${{ env.OUT_ISO }}
- uses: actions/[email protected]
if: matrix.type == 'tarball'
with:
path: binary/
key: tar-${{ matrix.target }}-${{ github.run_id }}
deploy:
needs: build
runs-on: buildjet-4vcpu-ubuntu-2204
container:
image: "ubuntu:latest"
options: --privileged
strategy:
matrix:
include:
- target: pinephone-unified
parent: pine
ref: pinephone
out: pinephone-unified
- target: raspberrypi-desktop
parent: rpi
ref: rpi
out: rpi-desktop
- target: raspberrypi-server
parent: rpi
ref: rpi
out: rpi-server
- target: pinetab
parent: tab
ref: pinetab
out: pinetab
- target: pinetab2
parent: tab
ref: pinetab
out: pinetab2
steps:
- uses: actions/checkout@v4
with:
ref: ${{ matrix.ref }}
- uses: actions/[email protected]
with:
path: binary/
key: tar-${{ matrix.parent }}-${{ github.run_id }}
- name: Deploy to partition
run: |
source ./etc/terraform.conf
VER="${VERSION}${SUBVER}"
./debos-docker --privileged -t image:"Rhino-Linux-${VER}-${{ matrix.out }}.img" -m 10G ${{ matrix.target }}.yaml
- name: Move to output folder and compress
run: |
mkdir -p builds/${{ matrix.type }}
mv Rhino*${{ matrix.out }}.img builds/${{ matrix.out }}/
xz -v builds/${{ matrix.out }}/Rhino*${{ matrix.out }}.img
echo "OUT_IMAGE=$(cd builds/${{ matrix.out }}; ls *.img.xz)" >> $GITHUB_ENV
- uses: actions/[email protected]
with:
name: ${{ env.OUT_IMAGE }}
path: builds/${{ matrix.out }}/${{ env.OUT_IMAGE }}