blob: 4b8cb628f26de8118ad9a817618c054e818630e8 (
plain)
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
|
name: Build live installer
on:
workflow_dispatch:
inputs:
image_tag:
description: "AeroCore image tag to install"
required: false
default: latest
type: string
workflow_call:
workflow_run:
workflows:
- Build container image
types:
- completed
branches:
- main
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true
jobs:
build-live-installer:
name: Build KDE live installer
if: github.event_name != 'workflow_run' || (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push')
runs-on: ubuntu-24.04
permissions:
contents: read
packages: read
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
IMAGE_TAG: ${{ inputs.image_tag || 'latest' }}
ISO_FILE_TAG: ${{ github.ref_name == 'testing' && 'testing' || (inputs.image_tag || 'latest') }}
# Keep these aligned with the Fedora major used by the target bazzite-deck base image.
LIVE_BASE_IMAGE: quay.io/fedora/fedora-kinoite:43
FEDORA_VERSION: "43"
steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@cc0becac701cf642c8f0a6613bbdaf5dc36b259e # v9
with:
remove-codeql: true
- name: Mount container storage BTRFS loopback
run: |
sudo truncate -s 70G /mnt/podman-storage.img
sudo mkfs.btrfs -f /mnt/podman-storage.img
sudo podman system reset --force
sudo systemctl stop podman.service
sudo mount -o compress-force=zstd:2 /mnt/podman-storage.img /var/lib/containers/storage
sudo systemctl start podman.service
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- name: Install just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
- name: Prepare image references
run: |
image_name="$(just image_name)"
image_registry="${IMAGE_REGISTRY,,}"
echo "IMAGE_NAME=${image_name,,}" >> "$GITHUB_ENV"
echo "IMAGE_REGISTRY=${image_registry}" >> "$GITHUB_ENV"
- name: Login to GHCR
run: |
echo '${{ secrets.GITHUB_TOKEN }}' | sudo podman login ghcr.io \
--username '${{ github.actor }}' --password-stdin
- name: Pull AeroCore install image
run: |
sudo podman pull "${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}"
- name: Build live installer payload
run: |
mkdir -p output
sudo podman tag \
"${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}" \
localhost/aerocore-live-payload:latest
sudo podman save \
--format oci-archive \
--output output/install-payload.oci \
localhost/aerocore-live-payload:latest
sudo podman build \
--cap-add sys_admin \
--security-opt label=disable \
--build-arg "BASE_IMAGE=${LIVE_BASE_IMAGE}" \
--build-arg "INSTALL_IMAGE_PAYLOAD=localhost/aerocore-live-payload:latest" \
--build-arg "INSTALL_IMAGE_PAYLOAD_ARCHIVE=/install-payload.oci" \
--tag localhost/aerocore-live-payload:latest \
--file installer/Containerfile \
.
- name: Build ISO
id: build
uses: Zeglius/titanoboa@7737f4748458252ac827dca14b3d6dd09298472a # revamp-pr
with:
image-ref: localhost/aerocore-live-payload:latest
iso-dest: ${{ github.workspace }}/output/aerocore-os-${{ env.ISO_FILE_TAG }}-amd64.iso
- name: Display checksum
run: |
iso_path="output/aerocore-os-${ISO_FILE_TAG}-amd64.iso"
checksum_path="${iso_path}-CHECKSUM"
sha256sum "${iso_path}" | tee "${checksum_path}"
{
echo "# ISO Checksum (SHA256)"
echo
echo "ISO: $(basename "${iso_path}")"
echo
echo '```'
cat "${checksum_path}"
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: Prepare ISO upload files
run: |
iso_path="output/aerocore-os-${ISO_FILE_TAG}-amd64.iso"
upload_dir="output/upload"
mkdir -p "${upload_dir}"
mv "${iso_path}" "${upload_dir}/"
mv "${iso_path}-CHECKSUM" "${upload_dir}/"
- name: Upload ISO artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: aerocore-os-live-installer-${{ env.ISO_FILE_TAG }}
path: output/upload
if-no-files-found: error
compression-level: 0
- name: Upload ISO and checksum to R2
if: github.ref_name == 'testing' || github.ref_name == 'main'
shell: bash
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_REGION: auto
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.R2_ENDPOINT }}
SOURCE_DIR: ${{ github.workspace }}/output/upload
run: |
sudo apt-get update
sudo apt-get install -y rclone
rclone copy "$SOURCE_DIR" R2:bazzite
|