From c48c28120b9be9db71f8d15f0b4753461b8e80cb Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Fri, 16 Feb 2024 23:40:48 +0000 Subject: [PATCH 01/25] general fixes --- .devcontainer/devcontainer.json | 16 +++ ...enerator-image.yml => build-container.yml} | 8 +- .github/workflows/iso.yml | 87 ------------- .github/workflows/test-iso.yml | 43 ++++++ .gitignore | 2 +- CODEOWNERS | 2 + Containerfile | 21 +++ Dockerfile | 18 --- Makefile | 122 ++++++++++-------- README.md | 94 +++++++++++++- action.yml | 112 ++++++++++++++++ output/README.md | 1 - xorriso/gen_input.sh.in | 4 +- 13 files changed, 357 insertions(+), 173 deletions(-) create mode 100644 .devcontainer/devcontainer.json rename .github/workflows/{isogenerator-image.yml => build-container.yml} (96%) delete mode 100644 .github/workflows/iso.yml create mode 100644 .github/workflows/test-iso.yml create mode 100644 CODEOWNERS create mode 100644 Containerfile delete mode 100644 Dockerfile create mode 100644 action.yml delete mode 100644 output/README.md diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..babf01e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,16 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile +{ + "name": "Existing Dockerfile", + // "build": { + // "context": "..", + // "dockerfile": "../Containerfile", + // "args": { + // "version": "39" + // } + // }, + "image": "ghcr.io/ublue-os/isogenerator:latest", + "overrideCommand": true, + "shutdownAction": "stopContainer", + "privileged": true +} diff --git a/.github/workflows/isogenerator-image.yml b/.github/workflows/build-container.yml similarity index 96% rename from .github/workflows/isogenerator-image.yml rename to .github/workflows/build-container.yml index c6be3ba..3ce9188 100644 --- a/.github/workflows/isogenerator-image.yml +++ b/.github/workflows/build-container.yml @@ -1,5 +1,5 @@ --- -name: isogenerator-image +name: Create Container on: pull_request: branches: @@ -21,15 +21,9 @@ jobs: push-image: name: Build and push image runs-on: ubuntu-22.04 - permissions: contents: read packages: write - id-token: write - - strategy: - fail-fast: false - steps: # Checkout push-to-registry action GitHub repository - name: Checkout Push to Registry action diff --git a/.github/workflows/iso.yml b/.github/workflows/iso.yml deleted file mode 100644 index a3de020..0000000 --- a/.github/workflows/iso.yml +++ /dev/null @@ -1,87 +0,0 @@ -name: Create and publish an ISO - -on: - push: - branches: - - 'main' - tags: - - 'v*' - pull_request: - workflow_dispatch: - - workflow_call: - inputs: - ARCH: - required: true - type: string - IMAGE_NAME: - required: true - type: string - IMAGE_REPO: - required: true - type: string - IMAGE_TAG: - required: true - type: string - VARIANT: - required: true - type: string - VERSION: - required: true - type: string - WEB_UI: - required: true - type: string - BUILD_REPO: - required: false - type: string - default: ublue-os/isogenerator - BUILD_REF: - required: false - type: string - default: main - -env: - ARCH: ${{ inputs.ARCH || 'x86_64' }} - IMAGE_NAME: ${{ inputs.IMAGE_NAME || 'base-main' }} - IMAGE_REPO: ${{ inputs.IMAGE_REPO || 'ghcr.io/ublue-os' }} - IMAGE_TAG: ${{ inputs.IMAGE_TAG || 'latest' }} - VARIANT: ${{ inputs.VARIANT || 'Kinoite' }} - VERSION: ${{ inputs.VERSION || '39' }} - WEB_UI: ${{ inputs.WEB_UI || 'false' }} - CURR_REPO: ${{ inputs.BUILD_REPO || github.repository }} - CURR_REF: ${{ inputs.BUILD_REF || github.ref }} - -jobs: - build-and-push-iso: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Build ISO - shell: bash - run: | - set -eo pipefail - mkdir -p output - docker run \ - --rm --privileged \ - -v ./output:/isogenerator/output \ - -e ARCH="${{ env.ARCH }}" \ - -e IMAGE_NAME="${{ env.IMAGE_NAME }}" \ - -e IMAGE_REPO="${{ env.IMAGE_REPO }}" \ - -e IMAGE_TAG="${{ env.IMAGE_TAG }}" \ - -e VARIANT="${{ env.VARIANT }}" \ - -e VERSION="${{ env.VERSION }}" \ - -e WEB_UI="${{ env.WEB_UI }}" \ - ghcr.io/ublue-os/isogenerator:latest - - - name: Upload ISO as artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}.iso - path: output/*.iso - if-no-files-found: error - retention-days: 0 - compression-level: 0 - overwrite: true diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml new file mode 100644 index 0000000..4eb4425 --- /dev/null +++ b/.github/workflows/test-iso.yml @@ -0,0 +1,43 @@ +name: Test Generate ISO + +on: + push: + branches: + - 'main' + tags: + - 'v*' + pull_request: + +env: + ARCH: ${{ inputs.ARCH || 'x86_64' }} + IMAGE_NAME: ${{ inputs.IMAGE_NAME || 'base-main' }} + IMAGE_REPO: ${{ inputs.IMAGE_REPO || 'ghcr.io/ublue-os' }} + IMAGE_TAG: ${{ inputs.IMAGE_TAG || 'latest' }} + VARIANT: ${{ inputs.VARIANT || 'Kinoite' }} + VERSION: ${{ inputs.VERSION || '39' }} + WEB_UI: ${{ inputs.WEB_UI || 'false' }} + CURR_REPO: ${{ inputs.BUILD_REPO || github.repository }} + CURR_REF: ${{ inputs.BUILD_REF || github.ref }} + +jobs: + build-and-push-iso: + runs-on: ubuntu-latest + container: + image: fedora:39 + options: "--privileged" + permissions: + contents: read + packages: write + steps: + - name: Build ISO + uses: ublue-os/isogenerator + with: + ARCH: 'x86_64' + IMAGE_NAME: 'base-main' + IMAGE_REPO: 'ghcr.io/ublue-os' + IMAGE_TAG: 'latest' + VARIANT: 'Kinoite' + VERSION: '39' + WEB_UI: 'false' + CURR_REPO: ${{ github.repository }} + CURR_REF: ${{ github.ref }} diff --git a/.gitignore b/.gitignore index 03894b9..23d7903 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,5 @@ /original-pkgsizes.txt /final-pkgsizes.txt /lorax.conf -/*.iso +/output /*.log \ No newline at end of file diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..d446188 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +# Default owner of code within this repo +* @JasonN3 \ No newline at end of file diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..b783659 --- /dev/null +++ b/Containerfile @@ -0,0 +1,21 @@ +ARG version=39 + +FROM fedora:${version} + +ENV ARCH="x86_64" +ENV IMAGE_NAME="base-main" +ENV IMAGE_REPO="ghcr.io/ublue-os" +ENV IMAGE_TAG="${version}" +ENV VARIANT="Kinoite" +ENV VERSION="${version}" +ENV WEB_UI="false" + +COPY / /isogenerator +WORKDIR /isogenerator + +RUN dnf install -y make && make install-deps + +VOLUME /isogenerator/output + +ENTRYPOINT ["make" ] +CMD [ "ARCH=${ARCH}", "VERSION=${VERSION}", "IMAGE_REPO=${IMAGE_REPO}", "IMAGE_NAME=${IMAGE_NAME}", "IMAGE_TAG=${IMAGE_TAG}", "VARIANT=${VARIANT}", "WEB_UI=${WEB_UI}"] diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 652cbd1..0000000 --- a/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM fedora:latest - -ENV ARCH="x86_64" -ENV IMAGE_NAME="base-main" -ENV IMAGE_REPO="ghcr.io/ublue-os" -ENV IMAGE_TAG="$(version)" -ENV VARIANT="Kinoite" -ENV VERSION="39" -ENV WEB_UI="false" - -WORKDIR /isogenerator - -RUN dnf install -y make git && \ - git clone https://github.com/ublue-os/isogenerator.git . && \ - make install-deps - - -ENTRYPOINT ["make", "arch=${ARCH}", "version=${VERSION}", "image_repo=${IMAGE_REPO}", "image_name=${IMAGE_NAME}", "image_tag=${IMAGE_TAG}", "variant=${VARIANT}", "web_ui=${WEB_UI}"] diff --git a/Makefile b/Makefile index 317f774..27a4666 100644 --- a/Makefile +++ b/Makefile @@ -1,85 +1,97 @@ -arch = x86_64 -version = 39 -base_dir = $(shell pwd) -image_repo = ghcr.io/ublue-os -image_name = base-main -image_tag = $(version) -variant = Silverblue -web_ui = false +# Configuration vars +## Formatting = UPPERCASE +ARCH = x86_64 +VERSION = 39 +IMAGE_REPO = ghcr.io/ublue-os +IMAGE_NAME = base-main +IMAGE_TAG = $(version) +VARIANT = Silverblue +WEB_UI = false -image_repo_escaped = $(subst /,\/,$(image_repo)) -image_repo_double_escaped = $(subst \,\\\,$(image_repo_escaped)) +# Generated vars +## Formatting = _UPPERCASE +_BASE_DIR = $(shell pwd) +_IMAGE_REPO_ESCAPED = $(subst /,\/,$(IMAGE_REPO)) +_IMAGE_REPO_DOUBLE_ESCAPED = $(subst \,\\\,$(_IMAGE_REPO_ESCAPED)) -ifeq ($(variant),'Server') -lorax_args = --macboot --noupgrade +ifeq ($(VARIANT),'Server') +_LORAX_ARGS = --macboot --noupgrade else -lorax_args = --nomacboot +_LORAX_ARGS = --nomacboot endif -ifeq ($(web_ui),true) -lorax_args += -i anaconda-webui +ifeq ($(WEB_UI),true) +_LORAX_ARGS += -i anaconda-webui endif -$(image_name)-$(version).iso: boot.iso container/$(image_name)-$(image_tag) xorriso/input.txt - xorriso -dialog on < $(base_dir)/xorriso/input.txt +# Step 6: Build end ISO file +## Default action +$(IMAGE_NAME)-$(IMAGE_TAG).iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt + mkdir $(_BASE_DIR)/output + xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt +# Step 2: Build boot.iso using Lorax boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.tmpl - rm -Rf $(base_dir)/results - lorax -p $(image_name) -v $(version) -r $(version) -t $(variant) \ - --isfinal --buildarch=$(arch) --volid=$(image_name)-$(arch)-$(version) \ - $(lorax_args) \ + rm -Rf $(_BASE_DIR)/results + lorax -p $(IMAGE_NAME) -v $(VERSION) -r $(VERSION) -t $(VARIANT) \ + --isfinal --buildarch=$(ARCH) --volid=$(IMAGE_NAME)-$(ARCH)-$(VERSION) \ + $(_LORAX_ARGS) \ --repo /etc/yum.repos.d/fedora.repo \ --repo /etc/yum.repos.d/fedora-updates.repo \ - --add-template $(base_dir)/lorax_templates/set_installer.tmpl \ - --add-template $(base_dir)/lorax_templates/configure_upgrades.tmpl \ - $(base_dir)/results/ - mv $(base_dir)/results/images/boot.iso $(base_dir)/ + --add-template $(_BASE_DIR)/lorax_templates/set_installer.tmpl \ + --add-template $(_BASE_DIR)/lorax_templates/configure_upgrades.tmpl \ + $(_BASE_DIR)/results/ + mv $(_BASE_DIR)/results/images/boot.iso $(_BASE_DIR)/ -container/$(image_name)-$(image_tag): +# Step 3: Download container image +container/$(IMAGE_NAME)-$(IMAGE_TAG): mkdir container - podman pull $(image_repo)/$(image_name):$(image_tag) - podman save --format oci-dir -o $(base_dir)/container/$(image_name)-$(image_tag) $(image_repo)/$(image_name):$(image_tag) - podman rmi $(image_repo)/$(image_name):$(image_tag) + podman pull $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) + podman save --format oci-dir -o $(_BASE_DIR)/container/$(IMAGE_NAME)-$(IMAGE_TAG) $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) + podman rmi $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_TAG) install-deps: dnf install -y lorax xorriso podman git rpm-ostree - +# Step 1: Generate Lorax Templates lorax_templates/%.tmpl: lorax_templates/%.tmpl.in - sed 's/@IMAGE_NAME@/$(image_name)/' $(base_dir)/lorax_templates/$*.tmpl.in > $(base_dir)/lorax_templates/$*.tmpl - sed 's/@IMAGE_REPO@/$(image_repo_escaped)/' $(base_dir)/lorax_templates/$*.tmpl > $(base_dir)/lorax_templates/$*.tmpl.tmp - mv $(base_dir)/lorax_templates/$*.tmpl{.tmp,} - sed 's/@IMAGE_TAG@/$(image_tag)/' $(base_dir)/lorax_templates/$*.tmpl > $(base_dir)/lorax_templates/$*.tmpl.tmp - mv $(base_dir)/lorax_templates/$*.tmpl{.tmp,} - sed 's/@IMAGE_REPO_ESCAPED@/$(image_repo_double_escaped)/' $(base_dir)/lorax_templates/$*.tmpl > $(base_dir)/lorax_templates/$*.tmpl.tmp - mv $(base_dir)/lorax_templates/$*.tmpl{.tmp,} + sed 's/@IMAGE_NAME@/$(IMAGE_NAME)/' $(_BASE_DIR)/lorax_templates/$*.tmpl.in > $(_BASE_DIR)/lorax_templates/$*.tmpl + + sed 's/@IMAGE_TAG@/$(IMAGE_TAG)/' $(_BASE_DIR)/lorax_templates/$*.tmpl > $(_BASE_DIR)/lorax_templates/$*.tmpl.tmp + mv $(_BASE_DIR)/lorax_templates/$*.tmpl{.tmp,} + + sed 's/@IMAGE_REPO_ESCAPED@/$(_IMAGE_REPO_DOUBLE_ESCAPED)/' $(_BASE_DIR)/lorax_templates/$*.tmpl > $(_BASE_DIR)/lorax_templates/$*.tmpl.tmp + mv $(_BASE_DIR)/lorax_templates/$*.tmpl{.tmp,} +# Step 5: Generate xorriso input xorriso/input.txt: xorriso/gen_input.sh - bash $(base_dir)/xorriso/gen_input.sh | tee $(base_dir)/xorriso/input.txt + bash $(_BASE_DIR)/xorriso/gen_input.sh | tee $(_BASE_DIR)/xorriso/input.txt +# Step 4: Generate xorriso script xorriso/%.sh: xorriso/%.sh.in - sed 's/@IMAGE_NAME@/$(image_name)/' $(base_dir)/xorriso/$*.sh.in > $(base_dir)/xorriso/$*.sh.in2 - sed 's/@IMAGE_TAG@/$(image_tag)/' $(base_dir)/xorriso/$*.sh.in2 > $(base_dir)/xorriso/$*.sh - sed 's/@VERSION@/$(version)/' $(base_dir)/xorriso/$*.sh > $(base_dir)/xorriso/$*.sh.tmp - mv $(base_dir)/xorriso/$*.sh{.tmp,} - sed 's/@ARCH@/$(arch)/' $(base_dir)/xorriso/$*.sh > $(base_dir)/xorriso/$*.sh.tmp - mv $(base_dir)/xorriso/$*.sh{.tmp,} + sed 's/@IMAGE_NAME@/$(IMAGE_NAME)/' $(_BASE_DIR)/xorriso/$*.sh.in > $(_BASE_DIR)/xorriso/$*.sh + + sed 's/@IMAGE_TAG@/$(IMAGE_TAG)/' $(_BASE_DIR)/xorriso/$*.sh > $(_BASE_DIR)/xorriso/$*.sh.tmp + mv $(_BASE_DIR)/xorriso/$*.sh{.tmp,} + + sed 's/@ARCH@/$(ARCH)/' $(_BASE_DIR)/xorriso/$*.sh > $(_BASE_DIR)/xorriso/$*.sh.tmp + mv $(_BASE_DIR)/xorriso/$*.sh{.tmp,} clean: - rm -Rf $(base_dir)/container || true - rm -Rf $(base_dir)/debugdata || true - rm -Rf $(base_dir)/pkglists || true - rm -Rf $(base_dir)/results || true - rm -f $(base_dir)/lorax_templates/*.tmpl || true - rm -f $(base_dir)/xorriso/input.txt || true - rm -f $(base_dir)/xorriso/*.sh || true - rm -f $(base_dir)/{original,final}-pkgsizes.txt || true - rm -f $(base_dir)/lorax.conf || true - rm -f $(base_dir)/*.iso || true - rm -f $(base_dir)/*.log || true + rm -Rf $(_BASE_DIR)/container || true + rm -Rf $(_BASE_DIR)/debugdata || true + rm -Rf $(_BASE_DIR)/pkglists || true + rm -Rf $(_BASE_DIR)/results || true + rm -f $(_BASE_DIR)/lorax_templates/*.tmpl || true + rm -f $(_BASE_DIR)/xorriso/input.txt || true + rm -f $(_BASE_DIR)/xorriso/*.sh || true + rm -f $(_BASE_DIR)/{original,final}-pkgsizes.txt || true + rm -f $(_BASE_DIR)/lorax.conf || true + rm -f $(_BASE_DIR)/*.iso || true + rm -f $(_BASE_DIR)/*.log || true diff --git a/README.md b/README.md index 8d1402b..b489f0c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,92 @@ -# container-installer -Creates an ISO for installing a container image as an OS +# UBlueOS ISO Generator +This action is used to generate the ISO images for UBlueOS. + + +## Makefile +A Makefile is provided for ease of use. There are separate targets for each file generated, however `make` can be used to generate the final image and `make clean` can be used to clean up the workspace. + +See [Customizing](#customizing) for information about customizing the image that gets created. + +## Container +A container with the necessary tools already installed is provided at `ghcr.io/ublue-os/isogenerator:latest` + +To use the container file, run `docker --privileged --volume .:/isogenerator/output ghcr.io/ublue-os/isogenerator` + +See [Customizing](#customizing) for information about customizing the image that gets created. The variable can either be defined as environment variables or as command arguments. +Examples: +Environment Variable +```bash +docker --privileged --volume .:/isogenerator/output -e VERSION=39 ghcr.io/ublue-os/isogenerator +``` +Command Argument +```bash +docker --privileged --volume .:/isogenerator/output ghcr.io/ublue-os/isogenerator VERSION=39 +``` + +## Customizing +The following variables can be used to customize the create image. + +- ARCH + Architecture for image to build + Default Value: x86_64 +- VERSION + Fedora version of installer to build + Default Value: 39 +- IMAGE_REPO + Repository containing the source container image + Default Value: ghcr.io/ublue-os +- IMAGE_NAME + Name of the source container image + Default Value: base-main +- IMAGE_TAG + Tag of the source container image + Default Value: *VERSION* +- VARIANT + Source container variant + Silverblue +- WEB_UI + Enable Anaconda WebUI + false + +## VSCode Dev Container +There is a dev container configuration provided for development. By default it will use the existing container image available at `ghcr.io/ublue-os/isogenerator`, however, you can have it build a new image by editing `.devcontainer/devcontainer.json` and replacing `image` with `build`. `Ctrl+/` can be used to comment and uncomment blocks of code within VSCode. + +The code from VSCode will be available at `/workspaces/isogenerator` once the container has started. + +Privileged is required for access to loop devices for lorax. + +Use existing image +```json +{ + "name": "Existing Dockerfile", + // "build": { + // "context": "..", + // "dockerfile": "../Containerfile", + // "args": { + // "version": "39" + // } + // }, + "image": "ghcr.io/ublue-os/isogenerator:latest", + "overrideCommand": true, + "shutdownAction": "stopContainer", + "privileged": true +} +``` + +Build a new image +```json +{ + "name": "Existing Dockerfile", + "build": { + "context": "..", + "dockerfile": "../Containerfile", + "args": { + "version": "39" + } + }, + //"image": "ghcr.io/ublue-os/isogenerator:latest", + "overrideCommand": true, + "shutdownAction": "stopContainer", + "privileged": true +} +``` \ No newline at end of file diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..bba7ecb --- /dev/null +++ b/action.yml @@ -0,0 +1,112 @@ +name: Generate ISO +description: Creates an ISO for installing an OSTree container + +inputs: + ARCH: + description: Architecture for image to build + required: true + default: x86_64 + IMAGE_NAME: + description: Name of the source container image + required: true + default: base-main + IMAGE_REPO: + description: Repository containing the source container image + required: true + default: ghcr.io/ublue-os + IMAGE_TAG: + description: Tag of the source container image + required: true + default: ${{ inputs.VERSION }} + VARIANT: + description: Source container variant + required: true + default: Kinoite + VERSION: + description: Fedora version of installer to build + required: true + default: "39" + WEB_UI: + description: Enable Anaconda WebUI + required: true + default: "false" + BUILD_REPO: + description: Repository with the build tool + required: false + default: ${{ github.repository }} + BUILD_REF: + description: Repository ref for the build tool + required: false + default: ${{ github.ref }} + +runs: + using: composite + steps: + - name: Install make and git + shell: bash + run: dnf install -y make git + + - name: Checkout repository + uses: actions/checkout@v4 + with: + repository: ${{ inputs.BUILD_REPO }} + ref: ${{ inputs.BUILD_REF }} + submodules: recursive + + - name: Install dependencies + shell: bash + run: make install-deps + + - name: Lowercase Registry + id: registry_case + uses: ASzc/change-string-case-action@v6 + with: + string: ${{ inputs.IMAGE_REPO }} + + - name: Download image + shell: bash + run: | + make container/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG }} \ + ARCH=${{ inputs.ARCH }} \ + IMAGE_NAME=${{ inputs.IMAGE_NAME }} \ + IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \ + IMAGE_TAG=${{ inputs.IMAGE_TAG }} \ + VARIANT=${{ inputs.VARIANT }} \ + VERSION=${{ inputs.VERSION }} \ + WEB_UI=${{ inputs.WEB_UI }} + + - name: Create boot.iso + shell: bash + run: | + make boot.iso \ + ARCH=${{ inputs.ARCH }} \ + IMAGE_NAME=${{ inputs.IMAGE_NAME }} \ + IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \ + IMAGE_TAG=${{ inputs.IMAGE_TAG }} \ + VARIANT=${{ inputs.VARIANT }} \ + VERSION=${{ inputs.VERSION }} \ + WEB_UI=${{ inputs.WEB_UI }} + + - name: Create deploy.iso + shell: bash + run: | + make ${IMAGE_NAME}-${IMAGE_VERSION}.iso \ + ARCH=${{ inputs.ARCH }} \ + IMAGE_NAME=${{ inputs.IMAGE_NAME }} \ + IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \ + IMAGE_TAG=${{ inputs.IMAGE_TAG }} \ + VARIANT=${{ inputs.VARIANT }} \ + VERSION=${{ inputs.VERSION }} \ + WEB_UI=${{ inputs.WEB_UI }} + mkdir end_iso + mv output/${IMAGE_NAME}-${IMAGE_TAG}.iso end_iso/ + + - name: Upload ISO as artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_VERSION }}.iso + path: end_iso/*.iso + if-no-files-found: error + retention-days: 0 + compression-level: 0 + overwrite: true diff --git a/output/README.md b/output/README.md deleted file mode 100644 index fc50ae3..0000000 --- a/output/README.md +++ /dev/null @@ -1 +0,0 @@ -Final ISO gets output in this directory diff --git a/xorriso/gen_input.sh.in b/xorriso/gen_input.sh.in index 299cfc3..30d73fa 100644 --- a/xorriso/gen_input.sh.in +++ b/xorriso/gen_input.sh.in @@ -1,9 +1,9 @@ #!/bin/bash echo "-indev $(pwd)/boot.iso" -echo "-outdev $(pwd)/output/@IMAGE_NAME@-@VERSION@.iso" +echo "-outdev $(pwd)/output/@IMAGE_NAME@-@IMAGE_TAG@.iso" echo "-boot_image any replay" -echo "-volid @IMAGE_NAME@-@ARCH@-@VERSION@" +echo "-volid @IMAGE_NAME@-@ARCH@-@IMAGE_TAG@" echo "-joliet on" echo "-compliance joliet_long_names" cd container From 96b1379d6c54153d4c229f460787f59b3fdf7cf6 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:12:30 +0000 Subject: [PATCH 02/25] update workflow --- .github/workflows/build-container.yml | 73 +++++++-------------------- .github/workflows/test-iso.yml | 29 ++++++----- Containerfile | 8 +-- action.yml | 12 ++--- 4 files changed, 43 insertions(+), 79 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index 3ce9188..c502a6b 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -4,14 +4,9 @@ on: pull_request: branches: - main - paths: - - 'Dockerfile' push: branches: - main - paths: - - 'Dockerfile' - workflow_dispatch: env: IMAGE_NAME: isogenerator @@ -24,55 +19,23 @@ jobs: permissions: contents: read packages: write + strategy: + fail-fast: false + matrix: + version: + - 38 + - 39 + - 40 + include: + - version: 39 + support: latest steps: - # Checkout push-to-registry action GitHub repository - - name: Checkout Push to Registry action - uses: actions/checkout@v3 - - # Build metadata - - name: Image Metadata - uses: docker/metadata-action@v4 - id: meta + - name: Build image + uses: JasonN3/build-action@action with: - images: | - ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }} - - labels: | - io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/main/README.md - org.opencontainers.image.description=A container image for generating Universal Blue ISO files - org.opencontainers.image.title=${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - type=ref,event=pr - # set latest tag for default branch - type=raw,value=latest,enable={{is_default_branch}} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and Push Image - uses: docker/build-push-action@v4 - with: - context: ./ - file: ./Dockerfile - push: ${{ github.event_name != 'pull_request' }} - labels: ${{ steps.meta.outputs.labels }} - tags: ${{ steps.meta.outputs.tags }} - - check: - name: Check build successful - if: ${{ !cancelled() }} - runs-on: ubuntu-latest - needs: [push-image] - steps: - - name: Exit on failure - if: ${{ needs.push-image.result == 'failure' || needs.push-image.result == 'skipped' }} - shell: bash - run: exit 1 - - name: Exit - shell: bash - run: exit 0 + image_name: isogenerator + image_variant: main + version: ${{ matrix.version }} + support: ${{ matrix.support }} + signing_key: ${{ secrets.SIGNING_SECRET }} + continue-on-error: false diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 4eb4425..9deabf5 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -3,21 +3,22 @@ name: Test Generate ISO on: push: branches: - - 'main' + - main tags: - 'v*' + paths-ignore: + - 'Containerfile' + - '*.md' + - 'LICENSE' + - 'CODEOWNERS' pull_request: - -env: - ARCH: ${{ inputs.ARCH || 'x86_64' }} - IMAGE_NAME: ${{ inputs.IMAGE_NAME || 'base-main' }} - IMAGE_REPO: ${{ inputs.IMAGE_REPO || 'ghcr.io/ublue-os' }} - IMAGE_TAG: ${{ inputs.IMAGE_TAG || 'latest' }} - VARIANT: ${{ inputs.VARIANT || 'Kinoite' }} - VERSION: ${{ inputs.VERSION || '39' }} - WEB_UI: ${{ inputs.WEB_UI || 'false' }} - CURR_REPO: ${{ inputs.BUILD_REPO || github.repository }} - CURR_REF: ${{ inputs.BUILD_REF || github.ref }} + branches: + - main + paths-ignore: + - 'Containerfile' + - '*.md' + - 'LICENSE' + - 'CODEOWNERS' jobs: build-and-push-iso: @@ -39,5 +40,5 @@ jobs: VARIANT: 'Kinoite' VERSION: '39' WEB_UI: 'false' - CURR_REPO: ${{ github.repository }} - CURR_REF: ${{ github.ref }} + ACTION_REPO: ${{ github.repository }} + ACTION_REF: ${{ github.ref }} diff --git a/Containerfile b/Containerfile index b783659..32a4162 100644 --- a/Containerfile +++ b/Containerfile @@ -1,13 +1,13 @@ -ARG version=39 +ARG VERSION=39 -FROM fedora:${version} +FROM fedora:${VERSION} ENV ARCH="x86_64" ENV IMAGE_NAME="base-main" ENV IMAGE_REPO="ghcr.io/ublue-os" -ENV IMAGE_TAG="${version}" +ENV IMAGE_TAG="${VERSION}" ENV VARIANT="Kinoite" -ENV VERSION="${version}" +ENV VERSION="${VERSION}" ENV WEB_UI="false" COPY / /isogenerator diff --git a/action.yml b/action.yml index bba7ecb..fd5da35 100644 --- a/action.yml +++ b/action.yml @@ -30,12 +30,12 @@ inputs: description: Enable Anaconda WebUI required: true default: "false" - BUILD_REPO: - description: Repository with the build tool + ACTION_REPO: + description: Repository with the build action required: false default: ${{ github.repository }} - BUILD_REF: - description: Repository ref for the build tool + ACTION_REF: + description: Repository ref for the build action required: false default: ${{ github.ref }} @@ -49,8 +49,8 @@ runs: - name: Checkout repository uses: actions/checkout@v4 with: - repository: ${{ inputs.BUILD_REPO }} - ref: ${{ inputs.BUILD_REF }} + repository: ${{ inputs.ACTION_REPO }} + ref: ${{ inputs.ACTION_REF }} submodules: recursive - name: Install dependencies From 6ab23f79d237ae056d3fc7c9738c3d3692de8653 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:30:20 +0000 Subject: [PATCH 03/25] reference file directly --- .github/workflows/test-iso.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 9deabf5..5ef81bd 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -31,7 +31,7 @@ jobs: packages: write steps: - name: Build ISO - uses: ublue-os/isogenerator + uses: ./action.yml with: ARCH: 'x86_64' IMAGE_NAME: 'base-main' From 73b0799030ab3208db1a56713c1da938c82f7090 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:38:08 +0000 Subject: [PATCH 04/25] checkout before run --- .github/workflows/build-container.yml | 11 +++++------ .github/workflows/test-iso.yml | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index c502a6b..bbce12d 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -1,5 +1,5 @@ --- -name: Create Container +name: Build Container on: pull_request: branches: @@ -8,13 +8,9 @@ on: branches: - main -env: - IMAGE_NAME: isogenerator - IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}" - jobs: push-image: - name: Build and push image + name: Build and push container image runs-on: ubuntu-22.04 permissions: contents: read @@ -30,6 +26,9 @@ jobs: - version: 39 support: latest steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build image uses: JasonN3/build-action@action with: diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 5ef81bd..d3d9468 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -22,6 +22,7 @@ on: jobs: build-and-push-iso: + name: Build ISO runs-on: ubuntu-latest container: image: fedora:39 @@ -29,6 +30,16 @@ jobs: permissions: contents: read packages: write + strategy: + fail-fast: false + matrix: + version: + - 38 + - 39 + - 40 + include: + - version: 40 + web_ui: 'true' steps: - name: Build ISO uses: ./action.yml @@ -38,7 +49,7 @@ jobs: IMAGE_REPO: 'ghcr.io/ublue-os' IMAGE_TAG: 'latest' VARIANT: 'Kinoite' - VERSION: '39' - WEB_UI: 'false' + VERSION: ${{ matrix.version }} + WEB_UI: ${{ matrix.web_ui }} ACTION_REPO: ${{ github.repository }} ACTION_REF: ${{ github.ref }} From 91141ce742471bc1e4587557f83655b779bf3e71 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:39:31 +0000 Subject: [PATCH 05/25] fix: add checkout to right workflow --- .github/workflows/build-container.yml | 3 --- .github/workflows/test-iso.yml | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index bbce12d..85e3a62 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -26,9 +26,6 @@ jobs: - version: 39 support: latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build image uses: JasonN3/build-action@action with: diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index d3d9468..c16ad45 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -41,6 +41,9 @@ jobs: - version: 40 web_ui: 'true' steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build ISO uses: ./action.yml with: From 2c16c58fbc0a6e3ac25c4c6d91a96039698b5684 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:43:20 +0000 Subject: [PATCH 06/25] test action in root --- .github/workflows/test-iso.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index c16ad45..e68822e 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -43,9 +43,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - + - name: Build ISO - uses: ./action.yml + uses: ./ with: ARCH: 'x86_64' IMAGE_NAME: 'base-main' From 50bf71eab5978c83e9e6ce4bdfa426199f3a3820 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sun, 18 Feb 2024 19:53:12 +0000 Subject: [PATCH 07/25] fixes --- Containerfile | 2 +- Makefile | 3 +++ action.yml | 21 ++++++++++----------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Containerfile b/Containerfile index 32a4162..e5f3d74 100644 --- a/Containerfile +++ b/Containerfile @@ -17,5 +17,5 @@ RUN dnf install -y make && make install-deps VOLUME /isogenerator/output -ENTRYPOINT ["make" ] +ENTRYPOINT ["make", "output/${IMAGE_NAME}-${IMAGE_TAG}.iso"] CMD [ "ARCH=${ARCH}", "VERSION=${VERSION}", "IMAGE_REPO=${IMAGE_REPO}", "IMAGE_NAME=${IMAGE_NAME}", "IMAGE_TAG=${IMAGE_TAG}", "VARIANT=${VARIANT}", "WEB_UI=${WEB_UI}"] diff --git a/Makefile b/Makefile index 27a4666..28cadcb 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,9 @@ $(IMAGE_NAME)-$(IMAGE_TAG).iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xo mkdir $(_BASE_DIR)/output xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt +output/$(IMAGE_NAME)-$(IMAGE_TAG).iso: $(IMAGE_NAME)-$(IMAGE_TAG).iso + cp $(IMAGE_NAME)-$(IMAGE_TAG).iso output/$(IMAGE_NAME)-$(IMAGE_TAG).iso + # Step 2: Build boot.iso using Lorax boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.tmpl rm -Rf $(_BASE_DIR)/results diff --git a/action.yml b/action.yml index fd5da35..0944290 100644 --- a/action.yml +++ b/action.yml @@ -14,10 +14,6 @@ inputs: description: Repository containing the source container image required: true default: ghcr.io/ublue-os - IMAGE_TAG: - description: Tag of the source container image - required: true - default: ${{ inputs.VERSION }} VARIANT: description: Source container variant required: true @@ -26,6 +22,9 @@ inputs: description: Fedora version of installer to build required: true default: "39" + IMAGE_TAG: + description: Tag of the source container image + required: false WEB_UI: description: Enable Anaconda WebUI required: true @@ -66,11 +65,11 @@ runs: - name: Download image shell: bash run: | - make container/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG }} \ + make container/${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }} \ ARCH=${{ inputs.ARCH }} \ IMAGE_NAME=${{ inputs.IMAGE_NAME }} \ IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \ - IMAGE_TAG=${{ inputs.IMAGE_TAG }} \ + IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \ VARIANT=${{ inputs.VARIANT }} \ VERSION=${{ inputs.VERSION }} \ WEB_UI=${{ inputs.WEB_UI }} @@ -82,7 +81,7 @@ runs: ARCH=${{ inputs.ARCH }} \ IMAGE_NAME=${{ inputs.IMAGE_NAME }} \ IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \ - IMAGE_TAG=${{ inputs.IMAGE_TAG }} \ + IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \ VARIANT=${{ inputs.VARIANT }} \ VERSION=${{ inputs.VERSION }} \ WEB_UI=${{ inputs.WEB_UI }} @@ -90,21 +89,21 @@ runs: - name: Create deploy.iso shell: bash run: | - make ${IMAGE_NAME}-${IMAGE_VERSION}.iso \ + make ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso \ ARCH=${{ inputs.ARCH }} \ IMAGE_NAME=${{ inputs.IMAGE_NAME }} \ IMAGE_REPO=${{ steps.registry_case.outputs.lowercase }} \ - IMAGE_TAG=${{ inputs.IMAGE_TAG }} \ + IMAGE_TAG=${{ inputs.IMAGE_TAG || inputs.VERSION }} \ VARIANT=${{ inputs.VARIANT }} \ VERSION=${{ inputs.VERSION }} \ WEB_UI=${{ inputs.WEB_UI }} mkdir end_iso - mv output/${IMAGE_NAME}-${IMAGE_TAG}.iso end_iso/ + mv ${{ IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso end_iso/ - name: Upload ISO as artifact uses: actions/upload-artifact@v4 with: - name: ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_VERSION }}.iso + name: ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso path: end_iso/*.iso if-no-files-found: error retention-days: 0 From 2290aa62097d035573a13d338c24379dacd9ffb9 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Sun, 18 Feb 2024 20:03:42 +0000 Subject: [PATCH 08/25] missing inputs --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 0944290..064cee2 100644 --- a/action.yml +++ b/action.yml @@ -98,7 +98,7 @@ runs: VERSION=${{ inputs.VERSION }} \ WEB_UI=${{ inputs.WEB_UI }} mkdir end_iso - mv ${{ IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso end_iso/ + mv ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso end_iso/ - name: Upload ISO as artifact uses: actions/upload-artifact@v4 From 31b6b39b23caab7da79d10213a8c8706e37db7d4 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:20:08 +0000 Subject: [PATCH 09/25] allow multiple output locations --- .github/workflows/test-iso.yml | 5 ----- Makefile | 8 ++++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index e68822e..50f75ea 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -36,10 +36,6 @@ jobs: version: - 38 - 39 - - 40 - include: - - version: 40 - web_ui: 'true' steps: - name: Checkout uses: actions/checkout@v4 @@ -53,6 +49,5 @@ jobs: IMAGE_TAG: 'latest' VARIANT: 'Kinoite' VERSION: ${{ matrix.version }} - WEB_UI: ${{ matrix.web_ui }} ACTION_REPO: ${{ github.repository }} ACTION_REF: ${{ github.ref }} diff --git a/Makefile b/Makefile index 28cadcb..d8499ff 100644 --- a/Makefile +++ b/Makefile @@ -26,13 +26,13 @@ endif # Step 6: Build end ISO file ## Default action -$(IMAGE_NAME)-$(IMAGE_TAG).iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt +$(IMAGE_NAME)-$(IMAGE_TAG).iso: output/$(IMAGE_NAME)-$(IMAGE_TAG).iso + mv output/$(IMAGE_NAME)-$(IMAGE_TAG).iso $(IMAGE_NAME)-$(IMAGE_TAG).iso + +output/$(IMAGE_NAME)-$(IMAGE_TAG).iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt mkdir $(_BASE_DIR)/output xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt -output/$(IMAGE_NAME)-$(IMAGE_TAG).iso: $(IMAGE_NAME)-$(IMAGE_TAG).iso - cp $(IMAGE_NAME)-$(IMAGE_TAG).iso output/$(IMAGE_NAME)-$(IMAGE_TAG).iso - # Step 2: Build boot.iso using Lorax boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.tmpl rm -Rf $(_BASE_DIR)/results From c720fb3dc51f69f82ea16cfa6551308977349574 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:39:03 +0000 Subject: [PATCH 10/25] move codeowners --- CODEOWNERS => .github/CODEOWNERS | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CODEOWNERS => .github/CODEOWNERS (100%) diff --git a/CODEOWNERS b/.github/CODEOWNERS similarity index 100% rename from CODEOWNERS rename to .github/CODEOWNERS From 5ab0abdb2f80b0bfc960abc2cd124a70c100d8b2 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:15:22 -0500 Subject: [PATCH 11/25] make pr check requirements easier --- .github/workflows/build-container.yml | 15 +++++++++++++++ .github/workflows/test-iso.yml | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index 85e3a62..bd35ade 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -35,3 +35,18 @@ jobs: support: ${{ matrix.support }} signing_key: ${{ secrets.SIGNING_SECRET }} continue-on-error: false + + check: + name: Check build successful + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + needs: + - push-image + steps: + - name: Exit on failure for main + if: ${{ needs.push-image.result == 'failure' || needs.push-image.result == 'skipped' }} + shell: bash + run: exit 1 + - name: Exit + shell: bash + run: exit 0 \ No newline at end of file diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 50f75ea..9b818f5 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -51,3 +51,18 @@ jobs: VERSION: ${{ matrix.version }} ACTION_REPO: ${{ github.repository }} ACTION_REF: ${{ github.ref }} + + check: + name: Check build successful + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + needs: + - build-and-push-iso + steps: + - name: Exit on failure for main + if: ${{ needs.build-and-push-iso.result == 'failure' || needs.build-and-push-iso.result == 'skipped' }} + shell: bash + run: exit 1 + - name: Exit + shell: bash + run: exit 0 \ No newline at end of file From cda1689641f551ebde52623807dbe6842e493533 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:18:18 -0500 Subject: [PATCH 12/25] doc: update VARIANT description to include how to find options --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 064cee2..119679c 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ inputs: required: true default: ghcr.io/ublue-os VARIANT: - description: Source container variant + description: "Source container variant. Available options can be found by running `dnf provides system-release`. Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinonite" required: true default: Kinoite VERSION: From e7172778d0aa5fd9e7895986ddb76f06dc36e9b9 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:18:37 -0500 Subject: [PATCH 13/25] doc: re-order to put steps in order --- Makefile | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index d8499ff..49945e2 100644 --- a/Makefile +++ b/Makefile @@ -24,15 +24,26 @@ ifeq ($(WEB_UI),true) _LORAX_ARGS += -i anaconda-webui endif -# Step 6: Build end ISO file +# Step 7: Move end ISO to root ## Default action $(IMAGE_NAME)-$(IMAGE_TAG).iso: output/$(IMAGE_NAME)-$(IMAGE_TAG).iso mv output/$(IMAGE_NAME)-$(IMAGE_TAG).iso $(IMAGE_NAME)-$(IMAGE_TAG).iso +# Step 6: Build end ISO file output/$(IMAGE_NAME)-$(IMAGE_TAG).iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt mkdir $(_BASE_DIR)/output xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt +# Step 1: Generate Lorax Templates +lorax_templates/%.tmpl: lorax_templates/%.tmpl.in + sed 's/@IMAGE_NAME@/$(IMAGE_NAME)/' $(_BASE_DIR)/lorax_templates/$*.tmpl.in > $(_BASE_DIR)/lorax_templates/$*.tmpl + + sed 's/@IMAGE_TAG@/$(IMAGE_TAG)/' $(_BASE_DIR)/lorax_templates/$*.tmpl > $(_BASE_DIR)/lorax_templates/$*.tmpl.tmp + mv $(_BASE_DIR)/lorax_templates/$*.tmpl{.tmp,} + + sed 's/@IMAGE_REPO_ESCAPED@/$(_IMAGE_REPO_DOUBLE_ESCAPED)/' $(_BASE_DIR)/lorax_templates/$*.tmpl > $(_BASE_DIR)/lorax_templates/$*.tmpl.tmp + mv $(_BASE_DIR)/lorax_templates/$*.tmpl{.tmp,} + # Step 2: Build boot.iso using Lorax boot.iso: lorax_templates/set_installer.tmpl lorax_templates/configure_upgrades.tmpl rm -Rf $(_BASE_DIR)/results @@ -56,23 +67,6 @@ container/$(IMAGE_NAME)-$(IMAGE_TAG): install-deps: dnf install -y lorax xorriso podman git rpm-ostree - -# Step 1: Generate Lorax Templates -lorax_templates/%.tmpl: lorax_templates/%.tmpl.in - sed 's/@IMAGE_NAME@/$(IMAGE_NAME)/' $(_BASE_DIR)/lorax_templates/$*.tmpl.in > $(_BASE_DIR)/lorax_templates/$*.tmpl - - sed 's/@IMAGE_TAG@/$(IMAGE_TAG)/' $(_BASE_DIR)/lorax_templates/$*.tmpl > $(_BASE_DIR)/lorax_templates/$*.tmpl.tmp - mv $(_BASE_DIR)/lorax_templates/$*.tmpl{.tmp,} - - sed 's/@IMAGE_REPO_ESCAPED@/$(_IMAGE_REPO_DOUBLE_ESCAPED)/' $(_BASE_DIR)/lorax_templates/$*.tmpl > $(_BASE_DIR)/lorax_templates/$*.tmpl.tmp - mv $(_BASE_DIR)/lorax_templates/$*.tmpl{.tmp,} - - - -# Step 5: Generate xorriso input -xorriso/input.txt: xorriso/gen_input.sh - bash $(_BASE_DIR)/xorriso/gen_input.sh | tee $(_BASE_DIR)/xorriso/input.txt - # Step 4: Generate xorriso script xorriso/%.sh: xorriso/%.sh.in sed 's/@IMAGE_NAME@/$(IMAGE_NAME)/' $(_BASE_DIR)/xorriso/$*.sh.in > $(_BASE_DIR)/xorriso/$*.sh @@ -83,6 +77,10 @@ xorriso/%.sh: xorriso/%.sh.in sed 's/@ARCH@/$(ARCH)/' $(_BASE_DIR)/xorriso/$*.sh > $(_BASE_DIR)/xorriso/$*.sh.tmp mv $(_BASE_DIR)/xorriso/$*.sh{.tmp,} +# Step 5: Generate xorriso input +xorriso/input.txt: xorriso/gen_input.sh + bash $(_BASE_DIR)/xorriso/gen_input.sh | tee $(_BASE_DIR)/xorriso/input.txt + clean: rm -Rf $(_BASE_DIR)/container || true @@ -97,4 +95,4 @@ clean: rm -f $(_BASE_DIR)/*.iso || true rm -f $(_BASE_DIR)/*.log || true - +.PHONY: clean From 1a58c1260876f4e7502a4be1744bfb0956d850b2 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:32:42 -0500 Subject: [PATCH 14/25] fix: don't push the iso during testing --- .github/workflows/test-iso.yml | 1 + action.yml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 9b818f5..d39a260 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -51,6 +51,7 @@ jobs: VERSION: ${{ matrix.version }} ACTION_REPO: ${{ github.repository }} ACTION_REF: ${{ github.ref }} + PUSH_ISO: "false" check: name: Check build successful diff --git a/action.yml b/action.yml index 119679c..afe87da 100644 --- a/action.yml +++ b/action.yml @@ -37,6 +37,10 @@ inputs: description: Repository ref for the build action required: false default: ${{ github.ref }} + PUSH_ISO: + description: Push ISO when done building + required: false + default: "true" runs: using: composite @@ -101,6 +105,7 @@ runs: mv ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso end_iso/ - name: Upload ISO as artifact + if: inputs.PUSH_ISO == "true" uses: actions/upload-artifact@v4 with: name: ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso From a0cfe4e05a75d81b1d0c10055f1d5479f3aedb07 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:34:01 -0500 Subject: [PATCH 15/25] single quotes --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index afe87da..d3140ce 100644 --- a/action.yml +++ b/action.yml @@ -105,7 +105,7 @@ runs: mv ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso end_iso/ - name: Upload ISO as artifact - if: inputs.PUSH_ISO == "true" + if: inputs.PUSH_ISO == 'true' uses: actions/upload-artifact@v4 with: name: ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso From 0f9cb8812cb1950dca74be0f7a4737a3318d6051 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:38:14 -0500 Subject: [PATCH 16/25] fix: always push for testing and include variant in ISO name --- .github/workflows/test-iso.yml | 1 - action.yml | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index d39a260..9b818f5 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -51,7 +51,6 @@ jobs: VERSION: ${{ matrix.version }} ACTION_REPO: ${{ github.repository }} ACTION_REF: ${{ github.ref }} - PUSH_ISO: "false" check: name: Check build successful diff --git a/action.yml b/action.yml index d3140ce..4d73841 100644 --- a/action.yml +++ b/action.yml @@ -37,10 +37,6 @@ inputs: description: Repository ref for the build action required: false default: ${{ github.ref }} - PUSH_ISO: - description: Push ISO when done building - required: false - default: "true" runs: using: composite @@ -105,10 +101,9 @@ runs: mv ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso end_iso/ - name: Upload ISO as artifact - if: inputs.PUSH_ISO == 'true' uses: actions/upload-artifact@v4 with: - name: ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}.iso + name: ${{ inputs.IMAGE_NAME }}-${{ inputs.IMAGE_TAG || inputs.VERSION }}-${{ inputs.VARIANT }}.iso path: end_iso/*.iso if-no-files-found: error retention-days: 0 From 0a69cfe2e9df26d6935c8e37331971f2c7fbd314 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 12:41:39 -0500 Subject: [PATCH 17/25] fix: only run test on PR --- .github/workflows/test-iso.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 9b818f5..2e1d99f 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -1,16 +1,6 @@ name: Test Generate ISO on: - push: - branches: - - main - tags: - - 'v*' - paths-ignore: - - 'Containerfile' - - '*.md' - - 'LICENSE' - - 'CODEOWNERS' pull_request: branches: - main From d4eb37fc5f721f524d94dcf8ed363c822b8e1d99 Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:17:27 -0500 Subject: [PATCH 18/25] doc: copy variant description from action --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b489f0c..e5edc2c 100644 --- a/README.md +++ b/README.md @@ -42,11 +42,12 @@ The following variables can be used to customize the create image. Tag of the source container image Default Value: *VERSION* - VARIANT - Source container variant - Silverblue + Source container variant + Source container variant. Available options can be found by running `dnf provides system-release`. Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinonite + Default Value: Silverblue - WEB_UI Enable Anaconda WebUI - false + Default Value: false ## VSCode Dev Container There is a dev container configuration provided for development. By default it will use the existing container image available at `ghcr.io/ublue-os/isogenerator`, however, you can have it build a new image by editing `.devcontainer/devcontainer.json` and replacing `image` with `build`. `Ctrl+/` can be used to comment and uncomment blocks of code within VSCode. @@ -89,4 +90,4 @@ Build a new image "shutdownAction": "stopContainer", "privileged": true } -``` \ No newline at end of file +``` From 8faf73deaae3f4b2a8eace04fdd1dceaa24784e1 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:56:42 -0500 Subject: [PATCH 19/25] remove duplicate text and upgrade build version --- .github/workflows/build-container.yml | 3 ++- README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index bd35ade..76b97aa 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -27,13 +27,14 @@ jobs: support: latest steps: - name: Build image - uses: JasonN3/build-action@action + uses: ublue-os/build-action@1.0.1 with: image_name: isogenerator image_variant: main version: ${{ matrix.version }} support: ${{ matrix.support }} signing_key: ${{ secrets.SIGNING_SECRET }} + target: main continue-on-error: false check: diff --git a/README.md b/README.md index e5edc2c..b3575d0 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ The following variables can be used to customize the create image. Default Value: *VERSION* - VARIANT Source container variant - Source container variant. Available options can be found by running `dnf provides system-release`. Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinonite + Available options can be found by running `dnf provides system-release`. Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinonite Default Value: Silverblue - WEB_UI Enable Anaconda WebUI From fe7443ffccd14b77fdf169025f0b1f84369dbf52 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Mon, 19 Feb 2024 22:21:27 -0500 Subject: [PATCH 20/25] fix: remove target --- .github/workflows/build-container.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index 76b97aa..b4c3674 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -34,7 +34,6 @@ jobs: version: ${{ matrix.version }} support: ${{ matrix.support }} signing_key: ${{ secrets.SIGNING_SECRET }} - target: main continue-on-error: false check: From ea1a7c96239f8f189389b54c2beb87cedc1f7634 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:25:29 -0500 Subject: [PATCH 21/25] free up extra space --- action.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/action.yml b/action.yml index 4d73841..c08f1ee 100644 --- a/action.yml +++ b/action.yml @@ -41,6 +41,25 @@ inputs: runs: using: composite steps: + - name: Cleanup host + shell: bash + run: | + if [[ -d /host ]] + then + df -h /host + # Remove Android Library + rm -Rf /host/usr/local/lib/android + # Remove .NET runtime + rm -Rf /host/usr/share/dotnet + # Remove Haskell runtime + rm -rf /host/opt/ghc + rm -rf /host/usr/local/.ghcup + chroot /host docker image prune --all --force + df -h /host + else + echo "Host must be mounted as /host in order to make more space" + fi + - name: Install make and git shell: bash run: dnf install -y make git From 6e7bef78061860855a3f2893e46641e6b06b178c Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:45:01 -0500 Subject: [PATCH 22/25] don't include tag --- .github/workflows/test-iso.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 2e1d99f..916a40d 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -36,9 +36,8 @@ jobs: ARCH: 'x86_64' IMAGE_NAME: 'base-main' IMAGE_REPO: 'ghcr.io/ublue-os' - IMAGE_TAG: 'latest' VARIANT: 'Kinoite' - VERSION: ${{ matrix.version }} + VERSION: 39 ACTION_REPO: ${{ github.repository }} ACTION_REF: ${{ github.ref }} From 441364b76eaf0feddf3f0cf4aab601c73a77cc46 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:59:35 -0500 Subject: [PATCH 23/25] use var --- .github/workflows/test-iso.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 916a40d..4039402 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -37,7 +37,7 @@ jobs: IMAGE_NAME: 'base-main' IMAGE_REPO: 'ghcr.io/ublue-os' VARIANT: 'Kinoite' - VERSION: 39 + VERSION: ${{ matrix.version }} ACTION_REPO: ${{ github.repository }} ACTION_REF: ${{ github.ref }} From 21687175339947683509b4ebd0fa2b586d1efd38 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 20 Feb 2024 11:55:52 -0500 Subject: [PATCH 24/25] fix: expand name --- .github/workflows/build-container.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index b4c3674..0c17baa 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -1,5 +1,5 @@ --- -name: Build Container +name: Build Container Image on: pull_request: branches: From b3e24eabda91db663f51398306a42f3faad5e585 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Tue, 20 Feb 2024 13:13:56 -0500 Subject: [PATCH 25/25] fix: match action defaults --- .../{build-container.yml => build-container-image.yml} | 0 .github/workflows/test-iso.yml | 1 + Makefile | 2 +- 3 files changed, 2 insertions(+), 1 deletion(-) rename .github/workflows/{build-container.yml => build-container-image.yml} (100%) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container-image.yml similarity index 100% rename from .github/workflows/build-container.yml rename to .github/workflows/build-container-image.yml diff --git a/.github/workflows/test-iso.yml b/.github/workflows/test-iso.yml index 4039402..0465b1b 100644 --- a/.github/workflows/test-iso.yml +++ b/.github/workflows/test-iso.yml @@ -1,6 +1,7 @@ name: Test Generate ISO on: + merge_group: pull_request: branches: - main diff --git a/Makefile b/Makefile index 49945e2..b189d20 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ VERSION = 39 IMAGE_REPO = ghcr.io/ublue-os IMAGE_NAME = base-main IMAGE_TAG = $(version) -VARIANT = Silverblue +VARIANT = Kinoite WEB_UI = false # Generated vars