-
-
Notifications
You must be signed in to change notification settings - Fork 257
Expand file tree
/
Copy pathreusable-build-iso-anaconda.yml
More file actions
160 lines (145 loc) · 5.66 KB
/
Copy pathreusable-build-iso-anaconda.yml
File metadata and controls
160 lines (145 loc) · 5.66 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
---
name: Build ISOs (Live Anaconda)
on:
workflow_dispatch:
inputs:
image_version:
description: 'Which image version to build'
type: choice
required: true
default: 'lts'
options:
- lts
- gts
- stable
- all
upload_artifacts:
description: 'Upload ISOs as job artifacts'
type: boolean
default: false
upload_r2:
description: 'Upload ISOs to Cloudflare R2'
type: boolean
default: true
pull_request:
paths:
- ".github/workflows/reusable-build-iso-anaconda.yml"
- "iso_files/configure_iso_anaconda.sh"
env:
IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}"
IMAGE_NAME: "bluefin"
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Build ISOs
runs-on: ${{ matrix.platform == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }}
strategy:
fail-fast: false
matrix:
platform: [amd64]
flavor: ["main", "nvidia-open"]
image_version: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.image_version == 'all' && fromJSON('["gts", "stable", "lts"]') || fromJSON(format('["{0}"]', github.event.inputs.image_version))) || fromJSON('["gts", "stable"]') }}
include:
- platform: amd64
flavor: "main"
image_version: lts
- platform: arm64
flavor: "main"
image_version: lts
- platform: amd64
flavor: gdx
image_version: lts
- platform: arm64
flavor: gdx
image_version: lts
permissions:
contents: read
packages: read
id-token: write
steps:
- name: Install dependencies
if: matrix.platform == 'arm64'
run: |
set -x
sudo apt update -y
sudo apt install -y \
podman
- name: Maximize build space (remove-software)
if: matrix. platform != 'arm64'
uses: ublue-os/remove-unwanted-software@cc0becac701cf642c8f0a6613bbdaf5dc36b259e # v9
with:
remove-codeql: true
- name: Maximize build space
uses: ublue-os/container-storage-action@911baca08baf30c8654933e9e9723cb399892140
continue-on-error: true
with:
target-dir: /var/lib/containers
mount-opts: compress-force=zstd:2
loopback-free: 0.9
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Setup Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
- name: Check Just Syntax
shell: bash
run: |
just check
- name: Format image ref
id: image_ref
env:
FLAVOR: ${{ matrix.flavor }}
run: |
set -eoux pipefail
image_name=$(just image_name "bluefin" "${{ matrix.image_version}}" "${{ matrix.flavor}}")
image_ref="${IMAGE_REGISTRY}/${image_name}"
KARGS="NONE"
echo "image_ref=$image_ref" >> "${GITHUB_OUTPUT}"
echo "artifact_format="$image_name-${{ matrix.image_version }}-$(uname -m)"" >> "${GITHUB_OUTPUT}"
echo "kargs=$KARGS" >> "${GITHUB_OUTPUT}"
- name: Build ISO
id: build
uses: ublue-os/titanoboa@main
with:
image-ref: ${{ steps.image_ref.outputs.image_ref }}:${{ matrix.image_version }}
flatpaks-list: ${{ github.workspace }}/flatpaks/system-flatpaks.list
hook-post-rootfs: ${{ matrix.image_version == 'lts' && format('{0}/iso_files/configure_lts_iso_anaconda.sh', github.workspace) || format('{0}/iso_files/configure_iso_anaconda.sh', github.workspace) }}
kargs: ${{ steps.image_ref.outputs.kargs }}
builder-distro: ${{ matrix.image_version == 'lts' && 'centos' || 'fedora' }}
- name: Rename ISO
id: rename
env:
OUTPUT_PATH: ${{ steps.build.outputs.iso-dest }}
FLAVOR: ${{ matrix.flavor }}
OUTPUT_NAME: ${{ steps.image_ref.outputs.artifact_format }}
IMAGE_VERSION: ${{ matrix.image_version }}
run: |
set -x
mkdir -p output
OUTPUT_DIRECTORY="$(realpath output)"
sha256sum "${OUTPUT_PATH}" | tee "${OUTPUT_DIRECTORY}/${OUTPUT_NAME}.iso-CHECKSUM"
mv "${OUTPUT_PATH}" "${OUTPUT_DIRECTORY}/${OUTPUT_NAME}.iso"
echo "output_directory=$OUTPUT_DIRECTORY" >> "${GITHUB_OUTPUT}"
- name: Upload to Job Artifacts
if: github.ref_name == 'testing' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_artifacts)
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ steps.image_ref.outputs.artifact_format }}
if-no-files-found: error
path: ${{ steps.rename.outputs.output_directory }}
- name: Upload to CloudFlare
if: github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || github.event.inputs.upload_r2)
shell: bash
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID_2025 }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY_2025 }}
RCLONE_CONFIG_R2_REGION: auto
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.R2_ENDPOINT_2025 }}
SOURCE_DIR: ${{ steps.rename.outputs.output_directory }}
run: |
sudo apt-get update
sudo apt-get install -y rclone
rclone copy "${SOURCE_DIR}" R2:bluefin