From 56c444279e182453ac969b12d8116c86c0ed5c98 Mon Sep 17 00:00:00 2001 From: Robert Sturla Date: Fri, 9 Aug 2024 00:22:45 +0100 Subject: [PATCH] Initial ISO draft --- .github/actions/build-iso/action.yml | 85 ++++++++++++++++++++++++++++ .github/workflows/iso.yml | 22 +++++++ flatpaks.txt | 13 +++++ 3 files changed, 120 insertions(+) create mode 100644 .github/actions/build-iso/action.yml create mode 100644 .github/workflows/iso.yml create mode 100644 flatpaks.txt diff --git a/.github/actions/build-iso/action.yml b/.github/actions/build-iso/action.yml new file mode 100644 index 00000000..c11fa275 --- /dev/null +++ b/.github/actions/build-iso/action.yml @@ -0,0 +1,85 @@ +name: Build Image + +inputs: + flatpak-manifest-list: + description: "The list of Flatpak packages to include in the image" + required: true + installer-version: + description: "The version of the Fedora installer to use" + required: true + image-registry: + description: "The registry to pull the image from" + required: true + image-name: + description: "The name of the image to build" + required: true + image-tag: + description: "The tag to apply to the image" + required: true + +outputs: + iso-file: + description: "The ISO file location" + value: "" + checksum-file: + description: "The checksum file location" + value: "" + +runs: + using: "composite" + steps: + - name: Get Flatpak dependencies + id: flatpak-dependencies + env: + IMAGE_FULL: ${{ inputs.image-registry }}/${{ inputs.image-name }}:${{ inputs.image-tag }} + shell: bash + run: | + set -euo pipefail + + IMAGE="${IMAGE_FULL}" + + # Create temporary directory + TEMP_FLATPAK_INSTALL_DIR=$(mktemp -d -p /tmp flatpak-XXXXXX) + + # Read the list of Flatpak packages from the manifest + FLATPAK_REFS=() + while IFS= read -r line; do + FLATPAK_REFS+=("$line") + done < "${{ inputs.flatpak-manifest-list }}" + + # Generate installation script + cat < "${TEMP_FLATPAK_INSTALL_DIR}/install-flatpaks.sh" + mkdir -p /flatpak/flatpak /flatpak/triggers + mkdir /var/tmp + chmod -R 1777 /var/tmp + flatpak config --system --set languages "*" + flatpak remote add --system flathub https://flathub.org/repo/flathub.flatpakrepo + flatpak install --system -y flathub ${FLATPAK_REFS[@]} + ostree refs --repo=\${FLATPAK_SYSTEM_DIR}/repo | grep '^deploy/' | grep -v 'org\.freedesktop\.Platform\.openh264' | sed 's/^deploy\///g' > /output/flatpaks-with-deps + EOF + docker run --rm --privileged \ + --entrypoint /bin/bash \ + -e FLATPAK_SYSTEM_DIR=/flatpak/flatpak \ + -e FLATPAK_TRIGGERS_DIR=/flatpak/triggers \ + -v ${FLATPAK_REFS_DIR}:/output \ + -v ${TEMP_FLATPAK_INSTALL_DIR}:/temp_flatpak_install_dir \ + ${IMAGE} /temp_flatpak_install_dir/install-flatpaks.sh + docker rmi ${IMAGE} + + - name: Build ISO + uses: jasonn3/build-container-installer@v1.2.2 + id: build-iso + with: + arch: x86_64 + image_name: ${{ inputs.image-name }} + image_repo: ${{ inputs.image-registry }} + image_tag: ${{ inputs.image-tag }} + variant: Kinoite + version: ${{ inputs.installer-version }} + secure_boot_key_url: "https://github.com/rsturla/akmods/raw/main/_certs/public_key.der" + enrollment_password: "password" + iso_name: "${{ inputs.image-name }}-${{ inputs.installer-version }}-${{ inputs.image-tag }}.iso" + enable_cache_dnf: false + enable_cache_skopeo: false + flatpak_remote_refs_dir: ${{ inputs.flatpak-manifest-list }} + enable_flatpak_dependencies: false diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml new file mode 100644 index 00000000..dd5d1893 --- /dev/null +++ b/.github/workflows/iso.yml @@ -0,0 +1,22 @@ +name: Build ISOs + +on: + pull_request: + paths: + - ".github/actions/build-iso/**" + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build ISO + uses: ./.github/actions/build-iso + with: + flatpak-manifest-list: ./flatpaks.txt + installer-version: 40 + image-registry: ghcr.io/rsturla/eternal-linux/main + image-name: silverblue + image-tag: 40 diff --git a/flatpaks.txt b/flatpaks.txt new file mode 100644 index 00000000..1c967cf2 --- /dev/null +++ b/flatpaks.txt @@ -0,0 +1,13 @@ +app/io.github.dvlv.boxbuddyrs/x86_64/stable +app/com.github.rafostar.Clapper/x86_64/stable +app/org.fedoraproject.MediaWriter/x86_64/stable +app/com.github.tchx84.Flatseal/x86_64/stable +app/io.github.flattool.Warehouse/x86_64/stable +app/org.gnome.baobab/x86_64/stable +app/org.gnome.Calculator/x86_64/stable +app/org.gnome.Calendar/x86_64/stable +app/org.gnome.Characters/x86_64/stable +app/org.gnome.clocks/x86_64/stable +app/org.gnome.Connections/x86_64/stable +app/org.gnome.Contacts/x86_64/stable +app/org.gnome.DejaDup/x86_64/stable