-
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (89 loc) · 3.58 KB
/
Copy pathbuild-iso.yaml
File metadata and controls
110 lines (89 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# SPDX-FileCopyrightText: 2025 Its-J <@jonah@fyralabs.com>
#
# SPDX-License-Identifier: GPL-3.0-or-later
name: Build ISO images with katsu
on:
# schedule:
# - cron: "0 4 * * *" # every day at 4am UTC
workflow_call:
inputs:
variant_name:
description: Variant name used to locate the build context
required: true
type: string
variant_image:
description: Full image repository to build and push
required: true
type: string
image_tag:
description: Tag of the image to build
required: true
type: string
# Cancel in-progress builds when a new run is queued
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build-iso:
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
variant:
- name: nothing
image: ghcr.io/ultramarine-linux/nothing-bootc:${{ github.ref_name || 'main' }}
name: Build ISO images with katsu
runs-on: ${{ contains(matrix.arch, 'aarch64') && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
container:
image: ghcr.io/fyralabs/katsu:main
options: --privileged --security-opt seccomp=unconfined -v /usr:/hostusr -v /:/hostfs
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Clean up space before build
run: |
df -h
# Wipe stuff in our host /usr to make some space
# We don't need the android SDK
rm -rf /hostusr/local/lib/android
# We're a Rust shop, not a Haskell shop
rm -rf /hostusr/local/.ghcup
rm -rf /hostfs/opt/ghc
# We don't even use .NET
rm -rf /hostusr/share/dotnet
# We don't need CodeQL in this action
rm -rf /hostfs/opt/hostedtoolcache/CodeQL
echo "After cleanup:"
df -h
- name: Login to GitHub Container Registry
env:
registry: ghcr.io
shell: bash
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | sudo podman login -u "${{ github.actor }}" --password-stdin "$registry"
- name: Build live ISO with Katsu
run: |
# set -x prints all commands to terminal
set -x
echo "debug: variant_image: ${{ inputs.variant_image }}"
echo "debug: image_tag: ${{ inputs.image_tag }}"
# make output directory and copy katsu manifest template there
mkdir -p output/
cp -r katsu-template/ output/katsu-live/
# replace %BASE_IMAGE with the actual image name in bootc-live.yaml manifest
# %BASE_IMAGE needs to look something like ghcr.io/ultramarine-linux/shade/nothing:sha-acc8f20
# ghcr.io/ultramarine-linux/shade/nothing is the variant_image and :main is the tag
IMAGE_NAME=${{ inputs.variant_image }}:${{ inputs.image_tag }}
echo "debug: IMAGE_NAME=${IMAGE_NAME}"
sed -i "s|%BASE_IMAGE%|${IMAGE_NAME}|g" output/katsu-live/bootc-live.yaml # makes katsu manifest
# build the live ISO using katsu with the generated manifest
katsu -o iso output/katsu-live/bootc-live.yaml
# rename the built ISO to include variant name and architecture
mv out.iso ./${{ inputs.variant_name }}-${{ matrix.arch }}.iso
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: iso-artifact-${{ github.run_id }}-${{ inputs.variant_name }}-${{ matrix.arch }}
path: ./*.iso
archive: false
compression-level: 0