add ISO workflow (#3)

This commit is contained in:
inffy 2026-01-11 12:11:15 +02:00 committed by GitHub
parent b83ff54271
commit 455de11be2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,124 @@
---
name: Build ISOs (Live with Webui)
on:
workflow_dispatch:
pull_request:
paths:
- ".github/workflows/reusable-build-iso-anaconda-webui.yml"
- "iso_files/configure_iso_anaconda-webui.sh"
schedule:
- cron: "0 2 1 * *" # First day of each month at 2:00 AM UTC
env:
IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}"
IMAGE_NAME: "aurora"
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' }}
strategy:
fail-fast: false
matrix:
platform: [amd64]
flavor: ["main", "nvidia-open"]
image_version: ["stable"]
include:
- platform: amd64
flavor: "main"
image_version: stable
permissions:
contents: read
packages: read
id-token: write
steps:
- name: Maximize build space
if: matrix.platform != 'arm64'
uses: ublue-os/remove-unwanted-software@695eb75bc387dbcd9685a8e72d23439d8686cba6 # v10
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6
- 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 "aurora" "${{ 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 }}-webui-$(uname -m)"" >> "${GITHUB_OUTPUT}"
echo "kargs=$KARGS" >> "${GITHUB_OUTPUT}"
- name: Generate titanoboa-compatible file list
id: flatpak_list
run: |
set -eoux pipefail
FILE_LIST="$(mktemp)"
git clone https://github.com/get-aurora-dev/common.git common
find common -iname "*system-flatpaks.Brewfile" -exec cat '{}' ';' | grep -v '#' | grep -F -e "flatpak" | sed 's/flatpak //' | tr -d '"' | tee "${FILE_LIST}"
echo "file_list_path=${FILE_LIST}" | tee "${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: ${{ steps.flatpak_list.outputs.file_list_path }}
hook-post-rootfs: ${{ github.workspace }}/iso_files/configure_iso_anaconda-webui.sh
kargs: ${{ steps.image_ref.outputs.kargs }}
- 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.event_name == 'pull_request'
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
with:
name: ${{ steps.image_ref.outputs.artifact_format }}
if-no-files-found: error
path: ${{ steps.rename.outputs.output_directory }}
- name: Upload to CloudFlare
if: contains(matrix.image_version, 'stable') && github.event_name != 'pull_request'
shell: bash
env:
RCLONE_CONFIG_R2_TYPE: s3
RCLONE_CONFIG_R2_PROVIDER: Cloudflare
RCLONE_CONFIG_R2_ACCESS_KEY_ID: ${{ secrets.AURORA_R2_ACCESS_KEY_ID }}
RCLONE_CONFIG_R2_SECRET_ACCESS_KEY: ${{ secrets.AURORA_R2_SECRET_ACCESS_KEY }}
RCLONE_CONFIG_R2_REGION: auto
RCLONE_CONFIG_R2_ENDPOINT: ${{ secrets.AURORA_R2_ENDPOINT }}
SOURCE_DIR: ${{ steps.rename.outputs.output_directory }}
run: |
sudo apt-get update
sudo apt-get install -y rclone
rclone copy "${SOURCE_DIR}" R2:aurora-dl