Skip to content

Commit 7c0f0f2

Browse files
committed
feat: Enable removal of unwanted software in the build workflow.
1 parent 12f2baa commit 7c0f0f2

File tree

8 files changed

+105
-78
lines changed

8 files changed

+105
-78
lines changed

.github/workflows/build-iso.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,17 @@ jobs:
227227
id: build
228228
uses: hanthor/titanoboa@main
229229
with:
230-
image-ref: ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}${{ steps.get_image_ref.outputs.image_suffix }}:${{ steps.get_image_ref.outputs.image_tag }}
230+
image-ref: >-
231+
ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}${{
232+
steps.get_image_ref.outputs.image_suffix }}:${{
233+
steps.get_image_ref.outputs.image_tag }}
231234
flatpaks-list: ${{ github.workspace }}/system_files/etc/ublue-os/system-flatpaks.list
232235
hook-post-rootfs: ${{ github.workspace }}/iso_files/configure_lts_iso_anaconda.sh
233-
builder-distro: ${{ matrix.image_variant == 'yellowfin' && 'almalinux' || matrix.image_variant == 'albacore' && 'almalinux' || matrix.image_variant == 'skipjack' && 'centos' || matrix.image_variant == 'bonito' && 'fedora' }}
236+
builder-distro: |
237+
${{ matrix.image_variant == 'yellowfin' && 'almalinux' ||
238+
matrix.image_variant == 'albacore' && 'almalinux' ||
239+
matrix.image_variant == 'skipjack' && 'centos' ||
240+
matrix.image_variant == 'bonito' && 'fedora' }}
234241
platform: ${{ matrix.platform }}
235242

236243
- name: Rename ISO

.github/workflows/build-next.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
else
6262
IMAGE_VARIANTS="$INPUT_VARIANT"
6363
fi
64-
64+
6565
# Define flavors to build based on input, ensuring dependencies are met
6666
FLAVORS_TO_BUILD=""
6767
if [ "$INPUT_FLAVOR" = "all" ]; then
@@ -73,12 +73,12 @@ jobs:
7373
else # base
7474
FLAVORS_TO_BUILD="base"
7575
fi
76-
76+
7777
# Generate separate matrices for each flavor
7878
BASE_MATRIX="{\"include\":[]}"
7979
DX_MATRIX="{\"include\":[]}"
8080
GDX_MATRIX="{\"include\":[]}"
81-
81+
8282
for variant in $IMAGE_VARIANTS; do
8383
for flavor in $FLAVORS_TO_BUILD; do
8484
# Determine image name based on flavor
@@ -87,7 +87,7 @@ jobs:
8787
else
8888
IMAGE_NAME="${variant}"
8989
fi
90-
90+
9191
# Set variant-specific descriptions and platforms
9292
case "$variant" in
9393
yellowfin)
@@ -99,12 +99,12 @@ jobs:
9999
PLATFORMS="linux/arm64,linux/amd64,linux/amd64/v2"
100100
;;
101101
esac
102-
102+
103103
# Override platforms if provided via input
104104
if [ -n "$INPUT_PLATFORMS" ]; then
105105
PLATFORMS="$INPUT_PLATFORMS"
106106
fi
107-
107+
108108
# Add flavor suffix to description
109109
case "$flavor" in
110110
dx)
@@ -114,15 +114,15 @@ jobs:
114114
DESCRIPTION="${DESCRIPTION} GDX"
115115
;;
116116
esac
117-
117+
118118
ENTRY="{
119119
\"variant\": \"${variant}\",
120120
\"flavor\": \"${flavor}\",
121121
\"image_name\": \"${IMAGE_NAME}\",
122122
\"description\": \"${DESCRIPTION}\",
123123
\"platforms\": \"${PLATFORMS}\"
124124
}"
125-
125+
126126
# Add to appropriate matrix
127127
case "$flavor" in
128128
base)
@@ -137,7 +137,7 @@ jobs:
137137
esac
138138
done
139139
done
140-
140+
141141
echo "base_matrix=$(echo "${BASE_MATRIX}" | jq -c '.')" >> $GITHUB_OUTPUT
142142
echo "dx_matrix=$(echo "${DX_MATRIX}" | jq -c '.')" >> $GITHUB_OUTPUT
143143
echo "gdx_matrix=$(echo "${GDX_MATRIX}" | jq -c '.')" >> $GITHUB_OUTPUT
@@ -216,4 +216,4 @@ jobs:
216216
rechunk: true
217217
sbom: false
218218
publish: true
219-
remove-unwanted-software: true
219+
remove-unwanted-software: true

.github/workflows/build.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Build
22
on:
3-
pull_request:
3+
pull_request:
44
branches:
55
- main
66
paths:
@@ -21,32 +21,32 @@ on:
2121
default: 'all'
2222
type: choice
2323
options:
24-
- yellowfin
25-
- albacore
26-
# - skipjack
27-
# - bonito
28-
- all
24+
- yellowfin
25+
- albacore
26+
# - skipjack
27+
# - bonito
28+
- all
2929
build_variant:
3030
description: 'Build variant (base, dx, gdx)'
3131
required: false
3232
default: 'base,dx,gdx'
3333
type: choice
3434
options:
35-
- base
36-
- base,dx
37-
- base,dx,gdx
35+
- base
36+
- base,dx
37+
- base,dx,gdx
3838
platforms:
3939
description: 'Platforms to build (Be sure to build all on Main!)'
4040
required: false
4141
default: ''
4242
type: choice
4343
options:
44-
- ''
45-
- linux/amd64
46-
- linux/amd64/v2
47-
- linux/arm64
48-
- linux/amd64,linux/arm64
49-
- linux/amd64,linux/amd64/v2,linux/arm64
44+
- ''
45+
- linux/amd64
46+
- linux/amd64/v2
47+
- linux/arm64
48+
- linux/amd64,linux/arm64
49+
- linux/amd64,linux/amd64/v2,linux/arm64
5050

5151

5252
concurrency:
@@ -61,8 +61,8 @@ jobs:
6161
matrix: ${{ steps.set-matrix.outputs.matrix }}
6262
steps:
6363
- name: Checkout for config
64-
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v4
65-
64+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v4
65+
6666
- name: Generate image variant build matrix
6767
id: set-matrix
6868
run: |
@@ -79,7 +79,7 @@ jobs:
7979
IMAGE_VARIANTS="yellowfin albacore" # skipjack bonito"
8080
fi
8181
fi
82-
82+
8383
# Generate matrix
8484
MATRIX="{\"include\":[]}"
8585
for image_variant in $IMAGE_VARIANTS; do
@@ -106,7 +106,7 @@ jobs:
106106
PLATFORMS="linux/arm64,linux/amd64"
107107
;;
108108
esac
109-
109+
110110
# Determine image name and tag
111111
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
112112
IMAGE_NAME="${image_variant}"
@@ -115,7 +115,7 @@ jobs:
115115
IMAGE_NAME="${image_variant}"
116116
TAG="${{ (github.ref_name == 'main' && github.event_name != 'pull_request') && 'latest' || github.sha }}"
117117
fi
118-
118+
119119
# If Platforms is set
120120
if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ inputs.platforms }}" ]]; then
121121
PLATFORMS="${{ inputs.platforms }}"
@@ -129,10 +129,10 @@ jobs:
129129
\"description\": \"${DESCRIPTION}\",
130130
\"rechunk\": ${{ github.event_name != 'pull_request' }},
131131
\"sbom\": false,
132-
\"publish\": true,
132+
\"publish\": true,
133133
}]")"
134134
done
135-
135+
136136
echo "matrix=$(echo "${MATRIX}" | jq -c '.')" >> $GITHUB_OUTPUT
137137
138138
# Build base images (base for chaining)

.github/workflows/release-stable.yml

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -92,35 +92,61 @@ jobs:
9292
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
9393
aws-region: us-east-1
9494

95-
- name: Upload to S3
96-
run: |
97-
aws s3 cp output/qcow2/disk.qcow2 s3://${{ secrets.S3_BUCKET }}/tunaos-${{ github.ref_name }}.qcow2
98-
echo "IMAGE_URL=https://${{ secrets.S3_BUCKET }}.s3.amazonaws.com/tunaos-${{ github.ref_name }}.qcow2" >> $GITHUB_ENV
95+
- name: Upload to S3
9996

100-
- name: Setup openQA CLI
101-
run: |
102-
sudo apt-get update && sudo apt-get install -y jq
103-
# Installing openQA client (example, might need specific repo or container)
104-
# For now, assuming we can run it via container or it's available.
105-
# Let's use a container for the CLI to be safe.
106-
echo "alias openqa-cli='podman run --rm -e OPENQA_API_KEY=${{ secrets.OPENQA_API_KEY }} -e OPENQA_API_SECRET=${{ secrets.OPENQA_API_SECRET }} -e OPENQA_HOST=${{ secrets.OPENQA_HOST }} registry.opensuse.org/devel/openqa/containers/openqa_client:latest openqa-cli'" >> ~/.bashrc
107-
source ~/.bashrc
108-
109-
- name: Run openQA Test
110-
run: |
111-
# Source bashrc to get the alias
112-
source ~/.bashrc
113-
./scripts/openqa-trigger.sh "${{ env.IMAGE_URL }}" "${{ github.ref_name }}"
97+
run: |
11498
115-
- name: Promote to Stable
116-
if: success()
117-
run: |
118-
VERSION=${{ github.ref_name }}
119-
IMAGE_NAME="${{ steps.image.outputs.name }}"
120-
skopeo copy \
121-
docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${IMAGE_NAME}:testing \
122-
docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${IMAGE_NAME}:stable
123-
124-
skopeo copy \
125-
docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${IMAGE_NAME}:testing \
126-
docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${IMAGE_NAME}:${VERSION}
99+
aws s3 cp output/qcow2/disk.qcow2 s3://${{ secrets.S3_BUCKET }}/tunaos-${{ github.ref_name }}.qcow2
100+
101+
echo "IMAGE_URL=https://${{ secrets.S3_BUCKET }}.s3.amazonaws.com/tunaos-${{ github.ref_name }}.qcow2" >> $GITHUB_ENV
102+
103+
104+
- name: Setup openQA CLI
105+
106+
run: |
107+
108+
sudo apt-get update && sudo apt-get install -y jq
109+
110+
# Installing openQA client (example, might need specific repo or container)
111+
112+
# For now, assuming we can run it via container or it's available.
113+
114+
# Let's use a container for the CLI to be safe.
115+
116+
echo "alias openqa-cli='podman run --rm \
117+
118+
-e OPENQA_API_KEY=${{ secrets.OPENQA_API_KEY }} \
119+
120+
-e OPENQA_API_SECRET=${{ secrets.OPENQA_API_SECRET }} \
121+
122+
-e OPENQA_HOST=${{ secrets.OPENQA_HOST }} \
123+
124+
registry.opensuse.org/devel/openqa/containers/openqa_client:latest openqa-cli'" >> ~/.bashrc
125+
126+
source ~/.bashrc
127+
128+
129+
130+
- name: Run openQA Test
131+
132+
run: |
133+
134+
# Source bashrc to get the alias
135+
136+
source ~/.bashrc
137+
138+
./scripts/openqa-trigger.sh "${{ env.IMAGE_URL }}" "${{ github.ref_name }}"
139+
140+
- name: Promote to Stable
141+
if: success()
142+
run: |
143+
VERSION=${{ github.ref_name }}
144+
IMAGE_NAME="${{ steps.image.outputs.name }}"
145+
skopeo copy \
146+
docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${IMAGE_NAME}:testing \
147+
docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${IMAGE_NAME}:stable
148+
skopeo copy \
149+
docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${IMAGE_NAME}:testing \
150+
docker://${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${IMAGE_NAME}:${VERSION}
151+
152+

.github/workflows/reusable-build-image.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ jobs:
103103
MATRIX="$(echo "${MATRIX}" | jq ".include += [{\"platform\": \"${platform}\", \"safeplatform\": \"${safeplatform}\"}]")"
104104
done
105105
echo "matrix=$(echo "${MATRIX}" | jq -c '.')" >> $GITHUB_OUTPUT
106-
107106
108107
build_push:
109108
name: Build and push image
@@ -128,7 +127,7 @@ jobs:
128127
129128
- name: Checkout
130129
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v4
131-
130+
132131
- name: Maximize build space (remove-software)
133132
if: inputs.remove-unwanted-software && matrix.platform != 'arm64'
134133
uses: ublue-os/remove-unwanted-software@cc0becac701cf642c8f0a6613bbdaf5dc36b259e # v9
@@ -177,7 +176,6 @@ jobs:
177176
export SYFT_PARALLELISM=$(($(nproc)*2))
178177
sudo "$SYFT_CMD" "${IMAGE_REGISTRY}/${IMAGE}:${DEFAULT_TAG}" -o "spdx-json=${OUTPUT_PATH}"
179178
echo "OUTPUT_PATH=${OUTPUT_PATH}" >> "${GITHUB_OUTPUT}"
180-
181179
182180
- name: Run Rechunker
183181
if: ${{ inputs.rechunk && inputs.publish }}
@@ -311,7 +309,7 @@ jobs:
311309
- generate_matrix
312310
- build_push
313311
container:
314-
image: cgr.dev/chainguard/wolfi-base:latest
312+
image: cgr.dev/chainguard/wolfi-base:latest
315313
options: --privileged --security-opt seccomp=unconfined
316314
permissions:
317315
contents: read

scripts/build-bootc-diskimage.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ mkdir -p "$TMPDIR/output"
2121
TYPE="$1"
2222
IMAGE_URI="$2"
2323
TOML_FILE="$TYPE.toml"
24-
# TODO: make this setable
25-
ROOTFS="xfs"
2624

2725
if [ "$TYPE" = "iso" ]; then
2826
# TODO: enable user creation for KDE and server images, this is currently only for GNOME

scripts/qemu-test.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ trap cleanup EXIT
4141
echo "Waiting for SSH..."
4242
MAX_RETRIES=30
4343
RETRY_COUNT=0
44-
SSH_OPTS="-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 -p 2222"
45-
SSH_USER="admin"
46-
SSH_PASS="password" # In a real scenario, use keys or secrets. For now, we'll rely on the config.toml setting.
4744
# Note: For real testing, you might need a specific user/key injected via cloud-init or similar.
4845
# For this example, we'll assume there's a way to connect or just check the port.
4946
# If passwordless SSH isn't set up, we might just check if the port is open using netcat.

scripts/run-local-ci.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ fi
2020
# Try to get GITHUB_TOKEN from gh cli if not set
2121
if [ -z "$GITHUB_TOKEN" ] && command -v gh &> /dev/null; then
2222
echo "Fetching GITHUB_TOKEN from gh CLI..."
23-
export GITHUB_TOKEN=$(gh auth token)
23+
GITHUB_TOKEN=$(gh auth token)
24+
export GITHUB_TOKEN
2425
fi
2526

2627
if [ -z "$GITHUB_TOKEN" ] && ! grep -q "GITHUB_TOKEN" secrets.env 2>/dev/null; then
@@ -70,12 +71,12 @@ else
7071
echo "2. Promote to Testing (test-and-promote.yml)"
7172
echo "3. Release Stable (release-stable.yml)"
7273
echo "4. Run Full Pipeline (build → test → release)"
73-
read -p "Select workflow to run (1-4): " choice
74+
read -r -p "Select workflow to run (1-4): " choice
7475
fi
7576

7677
# Create temp directory for transformed workflows
7778
TMP_DIR=$(mktemp -d)
78-
trap "rm -rf $TMP_DIR" EXIT
79+
trap 'rm -rf $TMP_DIR' EXIT
7980

8081
case $choice in
8182
1)
@@ -114,13 +115,13 @@ case $choice in
114115
if [ -n "$2" ]; then
115116
variant=$2
116117
else
117-
read -p "Enter image variant (yellowfin/albacore): " variant
118+
read -r -p "Enter image variant (yellowfin/albacore): " variant
118119
fi
119120

120121
if [ -n "$3" ]; then
121122
flavor=$3
122123
else
123-
read -p "Enter flavor (base/dx/gdx): " flavor
124+
read -r -p "Enter flavor (base/dx/gdx): " flavor
124125
fi
125126

126127
# Determine image name

0 commit comments

Comments
 (0)