95 lines
2.7 KiB
YAML
95 lines
2.7 KiB
YAML
name: Reusable Build
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
image_version:
|
|
description: 'Which image version to build'
|
|
type: string
|
|
required: true
|
|
image_tag:
|
|
description: 'Image tag to build from'
|
|
type: string
|
|
default: stable
|
|
upload_artifacts:
|
|
type: boolean
|
|
default: false
|
|
upload_r2:
|
|
type: boolean
|
|
default: true
|
|
|
|
env:
|
|
IMAGE_REGISTRY: "ghcr.io/humocs-man"
|
|
IMAGE_NAME: "fluffy-pancake"
|
|
|
|
jobs:
|
|
determine-matrix:
|
|
name: Determine Build Matrix
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
|
steps:
|
|
- id: set-matrix
|
|
run: |
|
|
matrix='{"include":[
|
|
{"platform":"amd64","flavor":"cosmic","image_version":"stable"}
|
|
]}'
|
|
echo "matrix=$(echo "$matrix" | jq -c .)" >> $GITHUB_OUTPUT
|
|
|
|
build:
|
|
name: Build COSMIC Live ISO
|
|
runs-on: ubuntu-24.04
|
|
needs: determine-matrix
|
|
strategy:
|
|
fail-fast: false
|
|
matrix: ${{ fromJSON(needs.determine-matrix.outputs.matrix) }}
|
|
permissions:
|
|
contents: read
|
|
packages: read
|
|
id-token: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
submodules: recursive
|
|
|
|
- uses: extractions/setup-just@v3
|
|
|
|
- name: Format image ref
|
|
id: image_ref
|
|
run: |
|
|
set -eoux pipefail
|
|
image_name="${IMAGE_NAME}"
|
|
image_ref="${IMAGE_REGISTRY}/${image_name}"
|
|
artifact_format="${image_name}-${{ matrix.image_version }}-cosmic-$(uname -m)"
|
|
echo "image_ref=$image_ref" >> $GITHUB_OUTPUT
|
|
echo "artifact_format=$artifact_format" >> $GITHUB_OUTPUT
|
|
echo "kargs=NONE" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build ISO
|
|
id: build
|
|
uses: ublue-os/titanoboa@main
|
|
with:
|
|
image-ref: ${{ steps.image_ref.outputs.image_ref }}:${{ inputs.image_tag }}
|
|
hook-post-rootfs: ${{ github.workspace }}/iso/enable_anaconda.sh
|
|
kargs: ${{ steps.image_ref.outputs.kargs }}
|
|
builder-distro: fedora
|
|
|
|
- name: Rename ISO
|
|
id: rename
|
|
env:
|
|
OUTPUT_PATH: ${{ steps.build.outputs.iso-dest }}
|
|
OUTPUT_NAME: ${{ steps.image_ref.outputs.artifact_format }}
|
|
run: |
|
|
mkdir -p output
|
|
mv "$OUTPUT_PATH" "output/${OUTPUT_NAME}.iso"
|
|
sha256sum "output/${OUTPUT_NAME}.iso" > "output/${OUTPUT_NAME}.iso-CHECKSUM"
|
|
echo "output_directory=$(realpath output)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Upload ISO Artifact
|
|
if: inputs.upload_artifacts
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: ${{ steps.image_ref.outputs.artifact_format }}
|
|
path: ${{ steps.rename.outputs.output_directory }}
|