Skip to content

Build Live ISOs

Build Live ISOs #66

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build Live ISOs
on:
workflow_dispatch:
workflow_call:
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-iso
cancel-in-progress: true
jobs:
build-iso:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
matrix:
image_name:
- bazzite
- bazzite-nvidia
- bazzite-nvidia-open
- bazzite-gnome
- bazzite-gnome-nvidia
- bazzite-gnome-nvidia-open
- bazzite-deck
- bazzite-deck-gnome
- bazzite-deck-nvidia
# - bazzite-deck-nvidia-gnome
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
- name: Checkout Repo
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- name: Set Image Tag
id: generate-tag
shell: bash
run: |
TAG="stable"
if [[ "${{ github.ref_name }}" == "testing" ]]; then
TAG="testing"
fi
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Set Flatpaks Directory Shortname
id: generate-flatpak-dir-shortname
shell: bash
run: |
FLATPAK_DIR_SHORTNAME="installer/kde_flatpaks"
if [[ "${{ matrix.image_name }}" =~ "gnome" ]]; then
FLATPAK_DIR_SHORTNAME="installer/gnome_flatpaks"
fi
echo "flatpak-dir-shortname=$(realpath ${FLATPAK_DIR_SHORTNAME})" >> $GITHUB_OUTPUT
# Docker requires lowercase registry references
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@d0603cd0a7dd490be678164909f65c7737470a7f # v6
with:
string: ${{ env.IMAGE_REGISTRY }}
# - name: Setup Bazzite Repo
# id: setup-bazzite-repo
# shell: bash
# run: |
# curl -Lo ${{ github.workspace }}/bazzite.repo https://copr.fedorainfracloud.org/coprs/bazzite-org/bazzite/repo/fedora-${{ matrix.major_version }}/bazzite-org-bazzite-fedora-${{ matrix.major_version }}.repo
# We need this as we use the desktop image as the runtime for
# the livecds.
- name: Obtain non-deck image ref
id: get-nondeck-ref
run: |
ref="${{ matrix.image_name }}"
ref="${ref/-deck/}"
echo "ref=${ref}" >> $GITHUB_OUTPUT
- name: Build ISOs
uses: ublue-os/titanoboa@main
id: build
with:
image-ref: ${{ steps.registry_case.outputs.lowercase }}/${{ steps.get-nondeck-ref.outputs.ref }}:${{ steps.generate-tag.outputs.tag }}
container-image: ${{ steps.registry_case.outputs.lowercase }}/${{ matrix.image_name }}:${{ steps.generate-tag.outputs.tag }}
# TODO (@Zeglius): Remove "liveiso" prefix once this becomes the main ISO
iso-dest: ${{ matrix.image_name }}-${{ steps.generate-tag.outputs.tag }}-live.iso
flatpaks-list: ${{ steps.generate-flatpak-dir-shortname.outputs.flatpak-dir-shortname }}/flatpaks
hook-pre-initramfs: ${{ github.workspace }}/installer/titanoboa_hook_preinitramfs.sh
hook-post-rootfs: ${{ github.workspace }}/installer/titanoboa_hook_postrootfs.sh
- name: Move ISOs to Upload Directory
id: upload-directory
shell: bash
run: |
ISO_UPLOAD_DIR=${{ github.workspace }}/upload
DEST=${ISO_UPLOAD_DIR}/$(basename ${{ steps.build.outputs.iso-dest }})
mkdir -p ${ISO_UPLOAD_DIR}
mv ${{ steps.build.outputs.iso-dest }} ${DEST}
sha256sum ${DEST} > ${DEST}-CHECKSUM
echo "iso-upload-dir=${ISO_UPLOAD_DIR}" >> $GITHUB_OUTPUT
- name: Upload ISOs and Checksum to Job Artifacts
if: github.ref_name == 'testing'
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ matrix.image_name }}-${{ steps.generate-tag.outputs.tag }}-${{ matrix.major_version}}
path: ${{ steps.upload-directory.outputs.iso-upload-dir }}
if-no-files-found: error
retention-days: 0
compression-level: 0
overwrite: true
- name: Upload ISOs and Checksum to R2
if: github.event_name == 'workflow_dispatch' && 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: ${{ steps.upload-directory.outputs.iso-upload-dir }}
run: |
sudo apt-get update
sudo apt-get install -y rclone
rclone copy $SOURCE_DIR R2:bazzite