From 3d0422380057692133d0633fd30ed1a4c37e1b71 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 14:04:56 -0600 Subject: [PATCH 01/57] fix: initial attempt --- Containerfile | 2 ++ entrypoint.sh | 12 +++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Containerfile b/Containerfile index 6ca8af49..57d5e54a 100644 --- a/Containerfile +++ b/Containerfile @@ -9,8 +9,10 @@ ENV IMAGE_TAG="${VERSION}" ENV VARIANT="Server" ENV VERSION="${VERSION}" ENV WEB_UI="false" +ENV OUTPUT_DIR="/github/workspace/build" RUN mkdir /build-container-installer + COPY / /build-container-installer/ WORKDIR /build-container-installer diff --git a/entrypoint.sh b/entrypoint.sh index 50057378..0570d5bd 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,9 +2,8 @@ set -ex -for entry in $@ -do - export $entry +for entry in $@; do + export $entry done # Pull container @@ -17,9 +16,8 @@ make boot.iso $@ make build/deploy.iso $@ # Make output dir in github workspace -mkdir /github/workspace/build || true +mkdir ${OUTPUT_DIR} || true # Copy resulting iso to github workspace and fix permissions -cp build/deploy.iso /github/workspace/build -chmod -R ugo=rwX /github/workspace/build - +cp build/deploy.iso ${OUTPUT_DIR} +chmod -R ugo=rwX ${OUTPUT_DIR} From d1d9713d80452fdd209eaa65c10d8e5b05b8be51 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 14:10:32 -0600 Subject: [PATCH 02/57] fix: updated volume and added output_dir to inputs --- Containerfile | 2 +- action.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Containerfile b/Containerfile index 57d5e54a..8f620342 100644 --- a/Containerfile +++ b/Containerfile @@ -19,7 +19,7 @@ WORKDIR /build-container-installer RUN dnf install -y make && make install-deps -VOLUME /build-container-installer/build +VOLUME ${OUTPUT_DIR} ENTRYPOINT ["/bin/bash", "/build-container-installer/entrypoint.sh"] diff --git a/action.yml b/action.yml index 22914f1d..dda21ad4 100644 --- a/action.yml +++ b/action.yml @@ -36,6 +36,9 @@ inputs: secure_boot_key_url: description: Secure boot key that is installed from URL location required: false + output_dir: + description: Define a specific output directory + required: false action_version: description: Version of the action container to run deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version. @@ -63,5 +66,6 @@ runs: WEB_UI=${{ inputs.web_ui }} \ ENROLLMENT_PASSWORD=${{ inputs.enrollment_password }} \ SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \ + OUTPUT_DIR=${{ inputs.output_dir }} "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" From 3536ef5d9eae47a8dafc768bb2eed05e44855d26 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 14:15:54 -0600 Subject: [PATCH 03/57] fix: added output command to add to github outputs --- entrypoint.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 0570d5bd..e3ee778b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,3 +21,5 @@ mkdir ${OUTPUT_DIR} || true # Copy resulting iso to github workspace and fix permissions cp build/deploy.iso ${OUTPUT_DIR} chmod -R ugo=rwX ${OUTPUT_DIR} + +echo "::set-output name=iso::${OUTPUT_DIR/deploy.iso/}" From 44c82b5909a5aa8f9820408cd12f83ba03550ea6 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 14:17:20 -0600 Subject: [PATCH 04/57] fix: formatting --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index e3ee778b..5bc11450 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,8 @@ set -ex -for entry in $@; do +for entry in $@; +do export $entry done @@ -21,5 +22,4 @@ mkdir ${OUTPUT_DIR} || true # Copy resulting iso to github workspace and fix permissions cp build/deploy.iso ${OUTPUT_DIR} chmod -R ugo=rwX ${OUTPUT_DIR} - echo "::set-output name=iso::${OUTPUT_DIR/deploy.iso/}" From 84995c0c4e18f93e79c24bec4e880b799bdd15a3 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 14:19:33 -0600 Subject: [PATCH 05/57] fix: set-output --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 5bc11450..c7774452 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,7 @@ set -ex -for entry in $@; +for entry in $@ do export $entry done @@ -22,4 +22,4 @@ mkdir ${OUTPUT_DIR} || true # Copy resulting iso to github workspace and fix permissions cp build/deploy.iso ${OUTPUT_DIR} chmod -R ugo=rwX ${OUTPUT_DIR} -echo "::set-output name=iso::${OUTPUT_DIR/deploy.iso/}" +echo "::set-output name=iso::${OUTPUT_DIR}/deploy.iso" From 9ca8ff36cd4f92647506e9f4e4e2f95286378b41 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 14:20:23 -0600 Subject: [PATCH 06/57] replaced tab with spaces --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index c7774452..3405ae44 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ set -ex for entry in $@ do - export $entry + export $entry done # Pull container From 4f5dd41a39a5e6a07fc4af605d1c45600894f93c Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 14:20:55 -0600 Subject: [PATCH 07/57] fixed: again... --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 3405ae44..1162d6cb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ set -ex for entry in $@ do - export $entry + export $entry done # Pull container From c2fb744df68f8a3af2566017598e48b076ca2649 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 15:34:40 -0600 Subject: [PATCH 08/57] fix: added backslash --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index dda21ad4..49c4a280 100644 --- a/action.yml +++ b/action.yml @@ -66,6 +66,6 @@ runs: WEB_UI=${{ inputs.web_ui }} \ ENROLLMENT_PASSWORD=${{ inputs.enrollment_password }} \ SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \ - OUTPUT_DIR=${{ inputs.output_dir }} + OUTPUT_DIR=${{ inputs.output_dir }} \ "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" From 0067705b68709b27d64db4fa29d5e77f14c06411 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 16:49:32 -0600 Subject: [PATCH 09/57] fix: added default --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 49c4a280..c23a3f6a 100644 --- a/action.yml +++ b/action.yml @@ -39,6 +39,7 @@ inputs: output_dir: description: Define a specific output directory required: false + default: "/github/workspace/build" action_version: description: Version of the action container to run deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version. From 3490ea25a6c5d287aca636ee5cc90de604dcac37 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 17:07:44 -0600 Subject: [PATCH 10/57] fix: rename ISO and Upload --- .github/workflows/build-and-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2981e793..6f6ec9ca 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -17,6 +17,7 @@ env: VARIANT: 'Server' SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' ENROLLMENT_PASSWORD: 'container-installer' + OUTPUT_DIR: '/github/workspace/build' jobs: @@ -95,14 +96,14 @@ jobs: - name: Rename ISO run: | - mv build/deploy.iso build/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso + mv ${{ env.OUTPUT_DIR }}/deploy.iso ${{ env.OUTPUT_DIR }}/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso - name: Upload ISO as artifact id: upload uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso - path: build/*.iso + path: ${{ env.OUTPUT_DIR }}/*.iso if-no-files-found: error retention-days: 0 compression-level: 0 From 1f13050cd32aab0479f6805d295e41ef6c567e22 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 22:55:11 -0600 Subject: [PATCH 11/57] fix: use whole path --- entrypoint.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 1162d6cb..c5904445 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,9 +2,8 @@ set -ex -for entry in $@ -do - export $entry +for entry in $@; do + export $entry done # Pull container @@ -20,6 +19,5 @@ make build/deploy.iso $@ mkdir ${OUTPUT_DIR} || true # Copy resulting iso to github workspace and fix permissions -cp build/deploy.iso ${OUTPUT_DIR} +cp /build-container-installer/build/deploy.iso ${OUTPUT_DIR} chmod -R ugo=rwX ${OUTPUT_DIR} -echo "::set-output name=iso::${OUTPUT_DIR}/deploy.iso" From fd273e03299d16af2b12b76626e2377f839743a8 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 23:21:02 -0600 Subject: [PATCH 12/57] fix: simplified build process --- .github/workflows/build-and-test.yml | 2 +- Containerfile | 2 +- entrypoint.sh | 7 ------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6f6ec9ca..23df421a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -17,7 +17,7 @@ env: VARIANT: 'Server' SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' ENROLLMENT_PASSWORD: 'container-installer' - OUTPUT_DIR: '/github/workspace/build' + OUTPUT_DIR: '/build-container-installer/build' jobs: diff --git a/Containerfile b/Containerfile index 8f620342..6cce8cdf 100644 --- a/Containerfile +++ b/Containerfile @@ -9,7 +9,7 @@ ENV IMAGE_TAG="${VERSION}" ENV VARIANT="Server" ENV VERSION="${VERSION}" ENV WEB_UI="false" -ENV OUTPUT_DIR="/github/workspace/build" +ENV OUTPUT_DIR="/build-container-installer/build" RUN mkdir /build-container-installer diff --git a/entrypoint.sh b/entrypoint.sh index c5904445..d8602a84 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,10 +14,3 @@ make boot.iso $@ # Add container to ISO make build/deploy.iso $@ - -# Make output dir in github workspace -mkdir ${OUTPUT_DIR} || true - -# Copy resulting iso to github workspace and fix permissions -cp /build-container-installer/build/deploy.iso ${OUTPUT_DIR} -chmod -R ugo=rwX ${OUTPUT_DIR} From 01d12228dd3c13d8980efd11536ca1a5365a7a56 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 23:25:18 -0600 Subject: [PATCH 13/57] fix: fixed default --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c23a3f6a..ab258102 100644 --- a/action.yml +++ b/action.yml @@ -39,7 +39,7 @@ inputs: output_dir: description: Define a specific output directory required: false - default: "/github/workspace/build" + default: "/build-container-installer/build" action_version: description: Version of the action container to run deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version. From 288976f017d276d14a5c4bb2fabce7da6b01a012 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Tue, 5 Mar 2024 23:57:11 -0600 Subject: [PATCH 14/57] fix: added move to entrypoint --- .github/workflows/build-and-test.yml | 6 +----- Containerfile | 3 +-- action.yml | 7 +------ entrypoint.sh | 2 ++ 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 23df421a..d03316b4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -94,16 +94,12 @@ jobs: secure_boot_key_url: ${{ env.SECURE_BOOT_KEY_URL }} enrollment_password: ${{ env.ENROLLMENT_PASSWORD }} - - name: Rename ISO - run: | - mv ${{ env.OUTPUT_DIR }}/deploy.iso ${{ env.OUTPUT_DIR }}/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso - - name: Upload ISO as artifact id: upload uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso - path: ${{ env.OUTPUT_DIR }}/*.iso + path: ${{ github.workspace}}/{{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso if-no-files-found: error retention-days: 0 compression-level: 0 diff --git a/Containerfile b/Containerfile index 6cce8cdf..74881392 100644 --- a/Containerfile +++ b/Containerfile @@ -9,7 +9,6 @@ ENV IMAGE_TAG="${VERSION}" ENV VARIANT="Server" ENV VERSION="${VERSION}" ENV WEB_UI="false" -ENV OUTPUT_DIR="/build-container-installer/build" RUN mkdir /build-container-installer @@ -19,7 +18,7 @@ WORKDIR /build-container-installer RUN dnf install -y make && make install-deps -VOLUME ${OUTPUT_DIR} +VOLUME /build-container-installer/build ENTRYPOINT ["/bin/bash", "/build-container-installer/entrypoint.sh"] diff --git a/action.yml b/action.yml index ab258102..27b52b68 100644 --- a/action.yml +++ b/action.yml @@ -36,10 +36,6 @@ inputs: secure_boot_key_url: description: Secure boot key that is installed from URL location required: false - output_dir: - description: Define a specific output directory - required: false - default: "/build-container-installer/build" action_version: description: Version of the action container to run deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version. @@ -57,7 +53,7 @@ runs: # Check if running inside of the action repo if [[ -z "${{ github.action_ref }}" ]]; then if [[ "${{ github.ref_name }}" =~ (.*)/merge ]]; then tag=pr-${BASH_REMATCH[1]}; else tag=${{ github.ref_name }}; fi; fi if [[ -z "${tag}" ]]; then tag=${{ github.action_ref }}; fi - docker run --privileged --volume ${{ github.workspace }}:/github/workspace/ ghcr.io/jasonn3/build-container-installer:${tag} \ + docker run --privileged --volume ${{ github.workspace }}:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:${tag} \ ARCH=${{ inputs.arch }} \ IMAGE_NAME=${{ inputs.image_name }} \ IMAGE_REPO=${{ inputs.image_repo }} \ @@ -67,6 +63,5 @@ runs: WEB_UI=${{ inputs.web_ui }} \ ENROLLMENT_PASSWORD=${{ inputs.enrollment_password }} \ SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \ - OUTPUT_DIR=${{ inputs.output_dir }} \ "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" diff --git a/entrypoint.sh b/entrypoint.sh index d8602a84..2128598b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,3 +14,5 @@ make boot.iso $@ # Add container to ISO make build/deploy.iso $@ + +mv build/deploy.iso build/${IMAGE_NAME}-${VERSION}.iso From cf2f1367787b3239e6f659592ad03f22360fcf41 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 00:01:03 -0600 Subject: [PATCH 15/57] fix: removed OUTPUT_DIR --- .github/workflows/build-and-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d03316b4..ce1b74a5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -17,7 +17,6 @@ env: VARIANT: 'Server' SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' ENROLLMENT_PASSWORD: 'container-installer' - OUTPUT_DIR: '/build-container-installer/build' jobs: From 7a639d64453a740d3a4c30796d1508b458a5b4de Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 00:16:33 -0600 Subject: [PATCH 16/57] fix: missed $ --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ce1b74a5..0371e3cf 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -98,7 +98,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso - path: ${{ github.workspace}}/{{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso + path: ${{ github.workspace}}/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso if-no-files-found: error retention-days: 0 compression-level: 0 From f06a0ad6f47635fc10ef091d7d08e99fb8c32b7b Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 00:37:28 -0600 Subject: [PATCH 17/57] feat: added ISO_NAME as param --- .github/workflows/build-and-test.yml | 6 ++++-- Containerfile | 1 + action.yml | 5 +++++ entrypoint.sh | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0371e3cf..2f020666 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -17,6 +17,7 @@ env: VARIANT: 'Server' SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' ENROLLMENT_PASSWORD: 'container-installer' + ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }} jobs: @@ -92,13 +93,14 @@ jobs: variant: ${{ env.VARIANT }} secure_boot_key_url: ${{ env.SECURE_BOOT_KEY_URL }} enrollment_password: ${{ env.ENROLLMENT_PASSWORD }} + iso_name: ${{ env.ISO_NAME }} - name: Upload ISO as artifact id: upload uses: actions/upload-artifact@v4 with: - name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso - path: ${{ github.workspace}}/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso + name: ${{ env.ISO_NAME }}.iso + path: ${{ github.workspace}}/${{ env.ISO_NAME }}.iso if-no-files-found: error retention-days: 0 compression-level: 0 diff --git a/Containerfile b/Containerfile index 74881392..a1cbe075 100644 --- a/Containerfile +++ b/Containerfile @@ -9,6 +9,7 @@ ENV IMAGE_TAG="${VERSION}" ENV VARIANT="Server" ENV VERSION="${VERSION}" ENV WEB_UI="false" +ENV ISO_NAME="${IMAGE_NAME}-${IMAGE_TAG}" RUN mkdir /build-container-installer diff --git a/action.yml b/action.yml index 27b52b68..5106143e 100644 --- a/action.yml +++ b/action.yml @@ -29,6 +29,10 @@ inputs: description: Enable Anaconda WebUI required: false default: "false" + iso_name: + description: Used for specifying the name of the output iso + required: false + default: "${{ inputs.image_name }}-${{ inputs.image_tag || inputs.version }}" enrollment_password: description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) required: false @@ -61,6 +65,7 @@ runs: VERSION=${{ inputs.version }} \ IMAGE_TAG=${{ inputs.image_tag || inputs.version }} \ WEB_UI=${{ inputs.web_ui }} \ + ISO_NAME=${{ inputs.iso_name }} \ ENROLLMENT_PASSWORD=${{ inputs.enrollment_password }} \ SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \ "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" diff --git a/entrypoint.sh b/entrypoint.sh index 2128598b..78db352f 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,4 +15,4 @@ make boot.iso $@ # Add container to ISO make build/deploy.iso $@ -mv build/deploy.iso build/${IMAGE_NAME}-${VERSION}.iso +mv build/deploy.iso build/${ISO_NAME}.iso From fb248cd54cb045e25133c40a23f2120ba472624b Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 00:41:58 -0600 Subject: [PATCH 18/57] fix: added env to job that needs it --- .github/workflows/build-and-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2f020666..a31b3e9b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -17,7 +17,6 @@ env: VARIANT: 'Server' SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' ENROLLMENT_PASSWORD: 'container-installer' - ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }} jobs: @@ -84,6 +83,8 @@ jobs: type=ref,event=pr - name: Build ISO with new container + env: + ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }} uses: ./ with: arch: ${{ env.ARCH}} From ddb61d80c39d00d084c4288a98e47d43a85c3e69 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 00:43:09 -0600 Subject: [PATCH 19/57] fix: added env to both places it is needed --- .github/workflows/build-and-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a31b3e9b..d324bd5b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -97,6 +97,8 @@ jobs: iso_name: ${{ env.ISO_NAME }} - name: Upload ISO as artifact + env: + ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }} id: upload uses: actions/upload-artifact@v4 with: From 8cafb5b139fd6e32d6cc7390cc6d9f059c622856 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 00:48:11 -0600 Subject: [PATCH 20/57] fix: removed default --- action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/action.yml b/action.yml index 5106143e..1524e268 100644 --- a/action.yml +++ b/action.yml @@ -32,7 +32,6 @@ inputs: iso_name: description: Used for specifying the name of the output iso required: false - default: "${{ inputs.image_name }}-${{ inputs.image_tag || inputs.version }}" enrollment_password: description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) required: false From 3fd50d41bda8a7915c5c34d99332fe61c54ba330 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 00:52:03 -0600 Subject: [PATCH 21/57] fix: variable names --- .github/workflows/build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d324bd5b..caea6b72 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -84,7 +84,7 @@ jobs: - name: Build ISO with new container env: - ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }} + ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.VERSION }} uses: ./ with: arch: ${{ env.ARCH}} @@ -98,7 +98,7 @@ jobs: - name: Upload ISO as artifact env: - ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }} + ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.VERSION }} id: upload uses: actions/upload-artifact@v4 with: From a51e4d59b4aac30392c306488d41f681e8fde26b Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 01:01:47 -0600 Subject: [PATCH 22/57] fix: deduplicated env --- .github/workflows/build-and-test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index caea6b72..4c42fee4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -64,6 +64,8 @@ jobs: permissions: contents: read packages: write + env: + ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.VERSION }} steps: - name: Checkout repo uses: actions/checkout@v4 @@ -83,8 +85,6 @@ jobs: type=ref,event=pr - name: Build ISO with new container - env: - ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.VERSION }} uses: ./ with: arch: ${{ env.ARCH}} @@ -97,8 +97,6 @@ jobs: iso_name: ${{ env.ISO_NAME }} - name: Upload ISO as artifact - env: - ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.VERSION }} id: upload uses: actions/upload-artifact@v4 with: From 36f4bf1e00eae4bcaa9a369b2c42ef1728aeb3a1 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 01:06:40 -0600 Subject: [PATCH 23/57] fix: moved env before needs --- .github/workflows/build-and-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4c42fee4..0de06a57 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -59,13 +59,13 @@ jobs: build-and-push-iso: runs-on: ubuntu-latest + env: + ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.VERSION }} needs: - build-container permissions: contents: read packages: write - env: - ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.VERSION }} steps: - name: Checkout repo uses: actions/checkout@v4 From f19c5c72dfc5bf8b44de98647b2a6ba511d7a79c Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 01:10:33 -0600 Subject: [PATCH 24/57] fix: removed whitespace --- .github/workflows/build-and-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0de06a57..22064e3a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -18,7 +18,6 @@ env: SECURE_BOOT_KEY_URL: 'https://github.com/ublue-os/akmods/raw/main/certs/public_key.der' ENROLLMENT_PASSWORD: 'container-installer' - jobs: build-container: runs-on: ubuntu-latest @@ -56,7 +55,6 @@ jobs: username: ${{ github.actor }} password: ${{ github.token }} - build-and-push-iso: runs-on: ubuntu-latest env: From b528b8ab7f651e8fddb6c6e81e4f28c20bf469bd Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 01:15:02 -0600 Subject: [PATCH 25/57] fix: generate environment variable for ISO_NAME --- .github/workflows/build-and-test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 22064e3a..f39d4bbb 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -57,14 +57,16 @@ jobs: build-and-push-iso: runs-on: ubuntu-latest - env: - ISO_NAME: ${{ env.IMAGE_NAME }}-${{ env.VERSION }} needs: - build-container permissions: contents: read packages: write steps: + - name: Set Environment Variables + run: | + echo "ISO_NAME=${{ env.IMAGE_NAME }}-${{ env.VERSION }}" >> $GITHUB_ENV + - name: Checkout repo uses: actions/checkout@v4 From f15867f2dc65765fae25e4317b1feacb927d933e Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 01:48:51 -0600 Subject: [PATCH 26/57] fix: added mv command to makefile --- .github/workflows/build-and-test.yml | 2 +- Containerfile | 1 - Makefile | 2 ++ entrypoint.sh | 2 -- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index f39d4bbb..0c6aba40 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -46,7 +46,7 @@ jobs: with: containerfiles: Containerfile tags: ${{ steps.meta.outputs.tags }} - + - name: Push image uses: redhat-actions/push-to-registry@v2 with: diff --git a/Containerfile b/Containerfile index a1cbe075..74881392 100644 --- a/Containerfile +++ b/Containerfile @@ -9,7 +9,6 @@ ENV IMAGE_TAG="${VERSION}" ENV VARIANT="Server" ENV VERSION="${VERSION}" ENV WEB_UI="false" -ENV ISO_NAME="${IMAGE_NAME}-${IMAGE_TAG}" RUN mkdir /build-container-installer diff --git a/Makefile b/Makefile index 81db8817..6338fc46 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ ENROLLMENT_PASSWORD = SECURE_BOOT_KEY_URL = ADDITIONAL_TEMPLATES = ROOTFS_SIZE = 4 +ISO_NAME = $(IMAGE_NAME)-$(IMAGE_TAG) # Generated vars ## Formatting = _UPPERCASE @@ -39,6 +40,7 @@ build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.t mkdir $(_BASE_DIR)/build || true xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt implantisomd5 build/deploy.iso + mv build/deploy.iso build/$(ISO_NAME).iso # Step 1: Generate Lorax Templates lorax_templates/post_%.tmpl: lorax_templates/scripts/post/% diff --git a/entrypoint.sh b/entrypoint.sh index 78db352f..d8602a84 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -14,5 +14,3 @@ make boot.iso $@ # Add container to ISO make build/deploy.iso $@ - -mv build/deploy.iso build/${ISO_NAME}.iso From 87508ad71fb943257bb52a65787434aba3d7e34e Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 02:08:03 -0600 Subject: [PATCH 27/57] feat: added sha256 checksum generation --- .github/workflows/build-and-test.yml | 2 +- Makefile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0c6aba40..b7a8217c 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -101,7 +101,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.ISO_NAME }}.iso - path: ${{ github.workspace}}/${{ env.ISO_NAME }}.iso + path: ${{ github.workspace}}/* if-no-files-found: error retention-days: 0 compression-level: 0 diff --git a/Makefile b/Makefile index 6338fc46..6089a777 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,8 @@ build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.t xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt implantisomd5 build/deploy.iso mv build/deploy.iso build/$(ISO_NAME).iso + cd build + sha256sum $(ISO_NAME).iso > $(ISO_NAME)-CHECKSUM # Step 1: Generate Lorax Templates lorax_templates/post_%.tmpl: lorax_templates/scripts/post/% @@ -176,7 +178,7 @@ clean: rm -f $(_BASE_DIR)/*.log || true install-deps: - dnf install -y lorax xorriso skopeo + dnf install -y lorax xorriso skopeo coreutils test-iso: $(eval _TESTS = $(filter-out README.md,$(shell ls tests/iso))) From 2387d111d39f2e7f131d99dff3c5e572a3b289a3 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 02:09:16 -0600 Subject: [PATCH 28/57] fix: spelling --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6089a777..b4b73c81 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ ifeq ($(WEB_UI),true) _LORAX_ARGS += -i anaconda-webui endif -# Step 7: Buid end ISO +# Step 7: Build end ISO ## Default action build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.txt mkdir $(_BASE_DIR)/build || true From 72368ef27cc2b45d0ab61d32b4281728ed8c1185 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 02:29:08 -0600 Subject: [PATCH 29/57] fix: issues with sha256sum finding iso --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b4b73c81..1ddd10b8 100644 --- a/Makefile +++ b/Makefile @@ -41,8 +41,9 @@ build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.t xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt implantisomd5 build/deploy.iso mv build/deploy.iso build/$(ISO_NAME).iso - cd build + pushd $(_BASE_DIR)/build sha256sum $(ISO_NAME).iso > $(ISO_NAME)-CHECKSUM + popd # Step 1: Generate Lorax Templates lorax_templates/post_%.tmpl: lorax_templates/scripts/post/% From 9b395677b022f9b0075ca7c4389f5c6156bec372 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 02:50:18 -0600 Subject: [PATCH 30/57] fix: adding ls command to determine if relative path is working --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1ddd10b8..e904ab63 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,8 @@ build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.t xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt implantisomd5 build/deploy.iso mv build/deploy.iso build/$(ISO_NAME).iso - pushd $(_BASE_DIR)/build + ls build/ + pushd build/ sha256sum $(ISO_NAME).iso > $(ISO_NAME)-CHECKSUM popd From 7b11754a5dfce5c35968ff1dc87f72bab7d330eb Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 03:35:28 -0600 Subject: [PATCH 31/57] fixed cd issue --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e904ab63..c87cd306 100644 --- a/Makefile +++ b/Makefile @@ -41,10 +41,7 @@ build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.t xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt implantisomd5 build/deploy.iso mv build/deploy.iso build/$(ISO_NAME).iso - ls build/ - pushd build/ - sha256sum $(ISO_NAME).iso > $(ISO_NAME)-CHECKSUM - popd + cd build && sha256sum $(ISO_NAME).iso > $(ISO_NAME)-CHECKSUM # Step 1: Generate Lorax Templates lorax_templates/post_%.tmpl: lorax_templates/scripts/post/% From 70be95cd83fd7c74eb5cd1fd451a489e79420099 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 03:55:38 -0600 Subject: [PATCH 32/57] fix: updated action to use outputs and build-and-test to use outputs --- .github/workflows/build-and-test.yml | 5 ++++- action.yml | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b7a8217c..5b96bccf 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -86,6 +86,7 @@ jobs: - name: Build ISO with new container uses: ./ + id: build with: arch: ${{ env.ARCH}} image_name: ${{ env.IMAGE_NAME}} @@ -101,7 +102,9 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.ISO_NAME }}.iso - path: ${{ github.workspace}}/* + path: | + ${{ steps.build.outputs.iso-path }} + ${{ steps.build.outputs.checksum-path }} if-no-files-found: error retention-days: 0 compression-level: 0 diff --git a/action.yml b/action.yml index 1524e268..f9d4a4c7 100644 --- a/action.yml +++ b/action.yml @@ -47,10 +47,19 @@ inputs: description: Space delimetered list of additional Lorax templates to include required: false +outputs: + iso-path: + value: ${{ steps.run_docker.outputs.ISO_PATH }} + description: The location of the .iso object + checksum-path: + value: ${{ steps.run_docker.outputs.CHECKSUM_PATH }} + description: The location of the checksum + runs: using: composite steps: - name: Run docker image + id: run_docker shell: bash run: | # Check if running inside of the action repo @@ -68,4 +77,6 @@ runs: ENROLLMENT_PASSWORD=${{ inputs.enrollment_password }} \ SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \ "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" + echo "ISO_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT + echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT From 3463aaf013985cde662a6f0a8a27ceca3639bc21 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 14:14:42 -0600 Subject: [PATCH 33/57] fix: updated README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 82217f90..b1c7ad13 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ The following variables can be used to customize the created ISO. | EXTRA_BOOT_PARAMS | Extra params used by grub to boot the anaconda installer | \[empty\] | | VARIANT | Source container variant\* | Server | | WEB_UI | Enable Anaconda WebUI (experimental) | false | +| ISO_NAME | Name of the ISO you wish to output when completed | IMAGE_NAME-IMAGE_TAG | Available options for VARIANT 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 kinoite @@ -55,12 +56,12 @@ Examples: Building an ISO to install Fedora 38 ```bash -docker run --rm --privileged --volume .:/build-container-installer/build -e VERSION=38 -e IMAGE_NAME=base -e IMAGE_TAG=38 -e VARIANT=Server ghcr.io/jasonn3/build-container-installer:latest +docker run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=38 IMAGE_NAME=base IMAGE_TAG=38 VARIANT=Server ``` Building an ISO to install Fedora 39 ```bash -docker run --rm --privileged --volume .:/build-container-installer/build -e VERSION=39 -e IMAGE_NAME=base -e IMAGE_TAG=39 -e VARIANT=Server ghcr.io/jasonn3/build-container-installer:latest +docker run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=39 IMAGE_NAME=base IMAGE_TAG=39 VARIANT=Server ``` ### VSCode Dev Container From b9e35f3311e2cdf295c5160e2be7df447bf418e3 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Wed, 6 Mar 2024 15:05:43 -0600 Subject: [PATCH 34/57] fix: added output information to README --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index b1c7ad13..2dff8a75 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,26 @@ This action is designed to be called from a GitHub workflow using the following ```yaml - name: Build ISO uses: jasonn3/build-container-installer/v1.0.0 + id: build with: arch: ${{ env.ARCH}} image_name: ${{ env.IMAGE_NAME}} image_repo: ${{ env.IMAGE_REPO}} version: ${{ env.VERSION }} variant: ${{ env.VARIANT }} + +# This example is for uploading your ISO as a Github artifact. You can do something similar using any cloud storage, so long as you copy the output +- name: Upload ISO as artifact + id: upload + uses: actions/upload-artifact@v4 + with: + name: my_iso.iso + path: | + ${{ steps.build.outputs.iso_path }} + ${{ steps.build.outputs.checksum-path }} + if-no-files-found: error + retention-days: 0 + compression-level: 0 ``` See [Customizing](#customizing) for information about customizing the ISO that gets created using `with` @@ -21,6 +35,7 @@ See [Customizing](#customizing) for information about customizing the ISO that g ## Customizing The following variables can be used to customize the created ISO. +### Inputs | Variable | Description | Default Value | | ----------------- | -------------------------------------------------------- | ------------------------------ | | ARCH | Architecture for image to build | x86_64 | @@ -36,6 +51,14 @@ The following variables can be used to customize the created ISO. Available options for VARIANT 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 kinoite +### Outputs +| Variable | Description | Usage | +| ----------------- | -------------------------------------------------------- | ------------------------------------------------ | +| iso-path | Path to ISO file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_path }} | +| checksum-path | Path to the checksum file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_path }} | + +For outputs, see example above. + ## Development ### Makefile The Makefile contains all of the commands that are run in the action. 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. The resulting ISO will be stored in the `build` directory. From 72721268f4491b079aeb74e8a3b64cfdc8303af4 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 11:50:21 -0600 Subject: [PATCH 35/57] fix: changes requested --- Makefile | 3 --- action.yml | 9 +++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index b7566522..a21d1bed 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ SECURE_BOOT_KEY_URL = ADDITIONAL_TEMPLATES = EXTRA_BOOT_PARAMS = ROOTFS_SIZE = 4 -ISO_NAME = $(IMAGE_NAME)-$(IMAGE_TAG) # Generated vars ## Formatting = _UPPERCASE @@ -41,8 +40,6 @@ build/deploy.iso: boot.iso container/$(IMAGE_NAME)-$(IMAGE_TAG) xorriso/input.t mkdir $(_BASE_DIR)/build || true xorriso -dialog on < $(_BASE_DIR)/xorriso/input.txt implantisomd5 build/deploy.iso - mv build/deploy.iso build/$(ISO_NAME).iso - cd build && sha256sum $(ISO_NAME).iso > $(ISO_NAME)-CHECKSUM # Step 1: Generate Lorax Templates lorax_templates/post_%.tmpl: lorax_templates/scripts/post/% diff --git a/action.yml b/action.yml index f9d4a4c7..b67de58f 100644 --- a/action.yml +++ b/action.yml @@ -65,7 +65,7 @@ runs: # Check if running inside of the action repo if [[ -z "${{ github.action_ref }}" ]]; then if [[ "${{ github.ref_name }}" =~ (.*)/merge ]]; then tag=pr-${BASH_REMATCH[1]}; else tag=${{ github.ref_name }}; fi; fi if [[ -z "${tag}" ]]; then tag=${{ github.action_ref }}; fi - docker run --privileged --volume ${{ github.workspace }}:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:${tag} \ + docker run --privileged --volume /github/workspace:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:${tag} \ ARCH=${{ inputs.arch }} \ IMAGE_NAME=${{ inputs.image_name }} \ IMAGE_REPO=${{ inputs.image_repo }} \ @@ -77,6 +77,11 @@ runs: ENROLLMENT_PASSWORD=${{ inputs.enrollment_password }} \ SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \ "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" + - name: Rename ISO file + shell: bash + run: | + mv /github/workspace/deploy.iso /github/workspace/${{ inputs.iso_name }}.iso + cd /github/workspace + sha256sum ${{ inputs.iso_name }}.iso > ${{ inputs.iso_name }}-CHECKSUM echo "ISO_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT - From 040436185491fe73ffddd4060bf7ccf987a4e93c Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 11:54:28 -0600 Subject: [PATCH 36/57] fix: code style --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index d8602a84..2c516bbb 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,7 +2,8 @@ set -ex -for entry in $@; do +for entry in $@ +do export $entry done From 468c599735791fcb72d03c296e7460452f5c8f56 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 12:15:09 -0600 Subject: [PATCH 37/57] fix: action and entrypoint --- action.yml | 6 +++--- entrypoint.sh | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index b67de58f..392d809d 100644 --- a/action.yml +++ b/action.yml @@ -65,7 +65,7 @@ runs: # Check if running inside of the action repo if [[ -z "${{ github.action_ref }}" ]]; then if [[ "${{ github.ref_name }}" =~ (.*)/merge ]]; then tag=pr-${BASH_REMATCH[1]}; else tag=${{ github.ref_name }}; fi; fi if [[ -z "${tag}" ]]; then tag=${{ github.action_ref }}; fi - docker run --privileged --volume /github/workspace:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:${tag} \ + docker run --privileged --volume ${{ github.workspace }}:/github/workspace ghcr.io/jasonn3/build-container-installer:${tag} \ ARCH=${{ inputs.arch }} \ IMAGE_NAME=${{ inputs.image_name }} \ IMAGE_REPO=${{ inputs.image_repo }} \ @@ -80,8 +80,8 @@ runs: - name: Rename ISO file shell: bash run: | - mv /github/workspace/deploy.iso /github/workspace/${{ inputs.iso_name }}.iso - cd /github/workspace + mv ${{ github.workspace }}/deploy.iso ${{ github.workspace }}/${{ inputs.iso_name }}.iso + cd ${{ github.workspace }} sha256sum ${{ inputs.iso_name }}.iso > ${{ inputs.iso_name }}-CHECKSUM echo "ISO_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT diff --git a/entrypoint.sh b/entrypoint.sh index 2c516bbb..55618b8e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -15,3 +15,6 @@ make boot.iso $@ # Add container to ISO make build/deploy.iso $@ + +cp build/deploy.iso /github/workspace/build +chmod -R ugo=rwx /github/workspace/build \ No newline at end of file From e72ffb5b70f0adc154a5a1da635d4737524e2491 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 12:43:13 -0600 Subject: [PATCH 38/57] fix: using output-directory and updated documentation --- .github/workflows/build-and-test.yml | 5 +---- README.md | 14 ++++++-------- action.yml | 12 ++++++++---- entrypoint.sh | 6 +++++- 4 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index ce6761d1..bb8b3b7e 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -108,9 +108,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.ISO_NAME }}.iso - path: | - ${{ steps.build.outputs.iso-path }} - ${{ steps.build.outputs.checksum-path }} + path: ${{ steps.build.outputs.output-directory }} if-no-files-found: error retention-days: 0 compression-level: 0 @@ -226,4 +224,3 @@ jobs: ./${check} fi done - diff --git a/README.md b/README.md index 2dff8a75..ca9968ab 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,7 @@ This action is designed to be called from a GitHub workflow using the following uses: actions/upload-artifact@v4 with: name: my_iso.iso - path: | - ${{ steps.build.outputs.iso_path }} - ${{ steps.build.outputs.checksum-path }} + path: ${{ steps.build.outputs.output-directory }} if-no-files-found: error retention-days: 0 compression-level: 0 @@ -52,10 +50,11 @@ Available options for VARIANT can be found by running `dnf provides system-relea Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite ### Outputs -| Variable | Description | Usage | -| ----------------- | -------------------------------------------------------- | ------------------------------------------------ | -| iso-path | Path to ISO file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_path }} | -| checksum-path | Path to the checksum file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_path }} | +| Variable | Description | Usage | +| ----------------- | ------------------------------------------------------ | -------------------------------------------------------- | +| output-directory | Path to all files in the output directory | ${{ steps.YOUR_ID_FOR_ACTION.outputs.output-directory }} | +| iso-path | Path to just the ISO file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso-path }} | +| checksum-path | Path to just the checksum file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.checksum-path }} | For outputs, see example above. @@ -129,4 +128,3 @@ Build a new container image: "privileged": true } ``` - diff --git a/action.yml b/action.yml index 392d809d..679df882 100644 --- a/action.yml +++ b/action.yml @@ -48,6 +48,9 @@ inputs: required: false outputs: + output-directory: + value: ${{ steps.run_docker.outputs.OUTPUT_DIRECTORY }} + description: The location of all output objects iso-path: value: ${{ steps.run_docker.outputs.ISO_PATH }} description: The location of the .iso object @@ -80,8 +83,9 @@ runs: - name: Rename ISO file shell: bash run: | - mv ${{ github.workspace }}/deploy.iso ${{ github.workspace }}/${{ inputs.iso_name }}.iso - cd ${{ github.workspace }} + mv ${{ github.workspace }}/build/deploy.iso ${{ github.workspace }}/build/${{ inputs.iso_name }}.iso + cd ${{ github.workspace }}/build sha256sum ${{ inputs.iso_name }}.iso > ${{ inputs.iso_name }}-CHECKSUM - echo "ISO_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT - echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT + echo "OUTPUT_DIRECTORY=$(realpath ${{ github.workspace }}/build/)" >> $GITHUB_OUTPUT + echo "ISO_PATH=$(realpath ${{ github.workspace }}/build/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT + echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/build/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT diff --git a/entrypoint.sh b/entrypoint.sh index 55618b8e..256c600e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,5 +16,9 @@ make boot.iso $@ # Add container to ISO make build/deploy.iso $@ +# Make output dir in github workspace +mkdir /github/workspace/build || true + +# Copy resulting iso to githubworkspace and fix permissions cp build/deploy.iso /github/workspace/build -chmod -R ugo=rwx /github/workspace/build \ No newline at end of file +chmod -R ugo=rwx /github/workspace/build From 5e3ff77638b030060a11f2113aa3223d47432ca4 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 12:45:58 -0600 Subject: [PATCH 39/57] chore: added additional context about the output file --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca9968ab..3878840d 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ A container with `make install-deps` already run is provided at `ghcr.io/jasonn3 To use the container file, run `docker run --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest`. -This will create an ISO with the baked in defaults of the container image. +This will create an ISO with the baked in defaults of the container image. The resulting file will be called `deploy.iso` See [Customizing](#customizing) for information about customizing the ISO that gets created. The variable can either be defined as environment variables. Examples: From 291f17fbc8461114d6a525a165e58f05846e62a9 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 12:48:00 -0600 Subject: [PATCH 40/57] chore: fixed spelling --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 679df882..3701e5d2 100644 --- a/action.yml +++ b/action.yml @@ -44,7 +44,7 @@ inputs: deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version. required: false additional_templates: - description: Space delimetered list of additional Lorax templates to include + description: Space delimited list of additional Lorax templates to include required: false outputs: From ebed6937c1647436a60bc68142665e076cd61f01 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 13:08:57 -0600 Subject: [PATCH 41/57] fix: fixed id and removed trailing slash --- action.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 3701e5d2..eee0469f 100644 --- a/action.yml +++ b/action.yml @@ -49,20 +49,19 @@ inputs: outputs: output-directory: - value: ${{ steps.run_docker.outputs.OUTPUT_DIRECTORY }} + value: ${{ steps.rename_iso.outputs.OUTPUT_DIRECTORY }} description: The location of all output objects iso-path: - value: ${{ steps.run_docker.outputs.ISO_PATH }} + value: ${{ steps.rename_iso.outputs.ISO_PATH }} description: The location of the .iso object checksum-path: - value: ${{ steps.run_docker.outputs.CHECKSUM_PATH }} + value: ${{ steps.rename_iso.outputs.CHECKSUM_PATH }} description: The location of the checksum runs: using: composite steps: - name: Run docker image - id: run_docker shell: bash run: | # Check if running inside of the action repo @@ -81,11 +80,12 @@ runs: SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \ "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" - name: Rename ISO file + id: rename_iso shell: bash run: | mv ${{ github.workspace }}/build/deploy.iso ${{ github.workspace }}/build/${{ inputs.iso_name }}.iso cd ${{ github.workspace }}/build sha256sum ${{ inputs.iso_name }}.iso > ${{ inputs.iso_name }}-CHECKSUM - echo "OUTPUT_DIRECTORY=$(realpath ${{ github.workspace }}/build/)" >> $GITHUB_OUTPUT + echo "OUTPUT_DIRECTORY=$(realpath ${{ github.workspace }}/build)" >> $GITHUB_OUTPUT echo "ISO_PATH=$(realpath ${{ github.workspace }}/build/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/build/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT From 96df7ee5fd4eb54be1e93ab7f77997cc9193362c Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 13:31:49 -0600 Subject: [PATCH 42/57] fix: fixed test variables --- .github/workflows/build-and-test.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bb8b3b7e..0ae7dbe2 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -127,6 +127,10 @@ jobs: - 38 - 39 steps: + - name: Set Environment Variables + run: | + echo "ISO_NAME=${{ env.IMAGE_NAME }}-${{ matrix.VERSION }}" >> $GITHUB_ENV + - name: Checkout repo uses: actions/checkout@v4 @@ -142,14 +146,14 @@ jobs: - name: Download generated ISO uses: actions/download-artifact@v4 with: - name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso + name: ${{ env.ISO_NAME }}.iso - name: Verify ISO - run: checkisomd5 ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso + run: checkisomd5 ${{ env.ISO_NAME }}.iso - name: Run ISO checks run: | - mv ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso deploy.iso + mv ${{ env.ISO_NAME }}.iso deploy.iso make test-iso VERSION=${{ matrix.version }} - name: Add Kickstart and Grub options to ISO From e8f1fd3c0425cc6b9cc81c3c1c9a38dd8c20425e Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:22:34 -0500 Subject: [PATCH 43/57] fix changes --- .github/workflows/build-and-test.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0ae7dbe2..bcce10cb 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -67,11 +67,9 @@ jobs: version: - 38 - 39 + outputs: + iso_name: ${{ steps.build.outputs.iso_name }} steps: - - name: Set Environment Variables - run: | - echo "ISO_NAME=${{ env.IMAGE_NAME }}-${{ matrix.VERSION }}" >> $GITHUB_ENV - - name: Checkout repo uses: actions/checkout@v4 @@ -101,14 +99,16 @@ jobs: variant: ${{ env.VARIANT }} secure_boot_key_url: ${{ env.SECURE_BOOT_KEY_URL }} enrollment_password: ${{ env.ENROLLMENT_PASSWORD }} - iso_name: ${{ env.ISO_NAME }} + iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso - name: Upload ISO as artifact id: upload uses: actions/upload-artifact@v4 with: - name: ${{ env.ISO_NAME }}.iso - path: ${{ steps.build.outputs.output-directory }} + name: ${{ steps.build.outputs.iso_name }} + path: | + ${{ steps.build.outputs.iso_name }} + ${{ steps.build.outputs.iso_name }}-CHECKSUM if-no-files-found: error retention-days: 0 compression-level: 0 @@ -127,17 +127,13 @@ jobs: - 38 - 39 steps: - - name: Set Environment Variables - run: | - echo "ISO_NAME=${{ env.IMAGE_NAME }}-${{ matrix.VERSION }}" >> $GITHUB_ENV - - name: Checkout repo uses: actions/checkout@v4 - name: Ensure qemu is installed run: | sudo apt-get update - sudo apt-get install -y qemu qemu-utils xorriso unzip qemu-system-x86 netcat socat jq isomd5sum ansible make + sudo apt-get install -y qemu qemu-utils xorriso unzip qemu-system-x86 netcat socat jq isomd5sum ansible make coreutils - name: Create disk run: | @@ -146,14 +142,16 @@ jobs: - name: Download generated ISO uses: actions/download-artifact@v4 with: - name: ${{ env.ISO_NAME }}.iso + name: ${{ needs.build-and-push-iso.outputs.iso_name }} - name: Verify ISO - run: checkisomd5 ${{ env.ISO_NAME }}.iso + run: | + checkisomd5 ${{ needs.build-and-push-iso.outputs.iso_name }} + sha256sum -c ${{ needs.build-and-push-iso.outputs.iso_name }}-CHECKSUM - name: Run ISO checks run: | - mv ${{ env.ISO_NAME }}.iso deploy.iso + mv ${{ needs.build-and-push-iso.outputs.iso_name }} deploy.iso make test-iso VERSION=${{ matrix.version }} - name: Add Kickstart and Grub options to ISO From ac1abc0fb53d112765fe6f871686b2fb4be95344 Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:47:57 -0500 Subject: [PATCH 44/57] fix rename --- action.yml | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/action.yml b/action.yml index eee0469f..102b05ab 100644 --- a/action.yml +++ b/action.yml @@ -30,8 +30,9 @@ inputs: required: false default: "false" iso_name: - description: Used for specifying the name of the output iso + description: Name of the resulting ISO. Relative paths are relative to ${{ github.workspace }} required: false + default: build/deploy.iso enrollment_password: description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) required: false @@ -48,15 +49,9 @@ inputs: required: false outputs: - output-directory: - value: ${{ steps.rename_iso.outputs.OUTPUT_DIRECTORY }} - description: The location of all output objects - iso-path: - value: ${{ steps.rename_iso.outputs.ISO_PATH }} + iso_name: + value: ${{ steps.rename_iso.outputs.ISO }} description: The location of the .iso object - checksum-path: - value: ${{ steps.rename_iso.outputs.CHECKSUM_PATH }} - description: The location of the checksum runs: using: composite @@ -79,13 +74,25 @@ runs: ENROLLMENT_PASSWORD=${{ inputs.enrollment_password }} \ SECURE_BOOT_KEY_URL=${{ inputs.secure_boot_key_url }} \ "ADDITIONAL_TEMPLATES=${{ inputs.additional_templates }}" + - name: Rename ISO file id: rename_iso shell: bash run: | - mv ${{ github.workspace }}/build/deploy.iso ${{ github.workspace }}/build/${{ inputs.iso_name }}.iso - cd ${{ github.workspace }}/build - sha256sum ${{ inputs.iso_name }}.iso > ${{ inputs.iso_name }}-CHECKSUM - echo "OUTPUT_DIRECTORY=$(realpath ${{ github.workspace }}/build)" >> $GITHUB_OUTPUT - echo "ISO_PATH=$(realpath ${{ github.workspace }}/build/${{ inputs.iso_name }}.iso)" >> $GITHUB_OUTPUT - echo "CHECKSUM_PATH=$(realpath ${{ github.workspace }}/build/${{ inputs.iso_name }}-CHECKSUM)" >> $GITHUB_OUTPUT + if [[ ! ( "${{ inputs.iso_name }}" =~ \.iso$ ) ]] + then + iso_name="${{ inputs.iso_name }}.iso" + else + iso_name="${{ inputs.iso_name }}" + fi + if [[ "${{ inputs.iso_name }}" =~ ^/ ]] + then + full_path="${iso_name}" + else + fullpath="${{ github.workspace }}/${iso_name}" + fi + mv ${{ github.workspace }}/build/deploy.iso ${fullpath} || true + cd $(dirname ${fullpath}) + iso_fn=$(basename ${iso_name}) + sha256sum ${iso_fn} > ${iso_fn%.iso}-CHECKSUM + echo "ISO=${full_path}" >> $GITHUB_OUTPUT From 7645177f01bb01a8b5c5f4f3c4cbfa848a17b0f7 Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:50:55 -0500 Subject: [PATCH 45/57] force as string --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 102b05ab..01dd05b8 100644 --- a/action.yml +++ b/action.yml @@ -30,7 +30,7 @@ inputs: required: false default: "false" iso_name: - description: Name of the resulting ISO. Relative paths are relative to ${{ github.workspace }} + description: "Name of the resulting ISO. Relative paths are relative to ${{ github.workspace }}" required: false default: build/deploy.iso enrollment_password: From d78aeb1c15163948385b2e37b4e0143a3ed95999 Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Thu, 7 Mar 2024 15:53:56 -0500 Subject: [PATCH 46/57] stop github from processing strings --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 01dd05b8..20701b62 100644 --- a/action.yml +++ b/action.yml @@ -30,7 +30,7 @@ inputs: required: false default: "false" iso_name: - description: "Name of the resulting ISO. Relative paths are relative to ${{ github.workspace }}" + description: "Name of the resulting ISO. Relative paths are relative to github.workspace" required: false default: build/deploy.iso enrollment_password: From 90e5f6721b306a2b8ab516fb21ec16fe45f6c1d4 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 14:55:47 -0600 Subject: [PATCH 47/57] fix: spacing and comment --- entrypoint.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 256c600e..3f78761b 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ set -ex for entry in $@ do - export $entry + export $entry done # Pull container @@ -19,6 +19,6 @@ make build/deploy.iso $@ # Make output dir in github workspace mkdir /github/workspace/build || true -# Copy resulting iso to githubworkspace and fix permissions +# Copy resulting iso to github workspace and fix permissions cp build/deploy.iso /github/workspace/build chmod -R ugo=rwx /github/workspace/build From b7d07f098d2dd09c881a7a90b3c5f61a0cd0c481 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 15:20:15 -0600 Subject: [PATCH 48/57] fix: fixed up docs and alphabetized inputs --- README.md | 33 +++++++++++++++++---------------- action.yml | 45 ++++++++++++++++++++++++--------------------- 2 files changed, 41 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 3878840d..3d8549f1 100644 --- a/README.md +++ b/README.md @@ -34,27 +34,28 @@ See [Customizing](#customizing) for information about customizing the ISO that g The following variables can be used to customize the created ISO. ### Inputs -| Variable | Description | Default Value | -| ----------------- | -------------------------------------------------------- | ------------------------------ | -| ARCH | Architecture for image to build | x86_64 | -| VERSION | Fedora version of installer to build | 39 | -| IMAGE_REPO | Repository containing the source container image | quay.io/fedora-ostree-desktops | -| IMAGE_NAME | Name of the source container image | base | -| IMAGE_TAG | Tag of the source container image | *VERSION* | -| EXTRA_BOOT_PARAMS | Extra params used by grub to boot the anaconda installer | \[empty\] | -| VARIANT | Source container variant\* | Server | -| WEB_UI | Enable Anaconda WebUI (experimental) | false | -| ISO_NAME | Name of the ISO you wish to output when completed | IMAGE_NAME-IMAGE_TAG | - -Available options for VARIANT can be found by running `dnf provides system-release`. +| Variable | Description | Default Value | +| -------------------- | ---------------------------------------------------------------------------- | ------------------------------ | +| additional_templates | Space delimited list of additional Lorax templates to include | \[empty\] | +| arch | Architecture for image to build | x86_64 | +| enrollment_password | Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) | container-installer | +| extra_boot_params | Extra params used by grub to boot the anaconda installer | \[empty\] | +| image_name | Name of the source container image | base | +| image_repo | Repository containing the source container image | quay.io/fedora-ostree-desktops | +| image_tag | Tag of the source container image | *VERSION* | +| iso_name | Name of the ISO you wish to output when completed | build/deploy.iso | +| secure_boot_key_url | Secure boot key that is installed from URL location | \[empty\] | +| variant | Source container variant\* | Server | +| version | Fedora version of installer to build | 39 | +| web_ui | Enable Anaconda WebUI (experimental) | false | + +\*Available options for VARIANT 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 kinoite ### Outputs | Variable | Description | Usage | | ----------------- | ------------------------------------------------------ | -------------------------------------------------------- | -| output-directory | Path to all files in the output directory | ${{ steps.YOUR_ID_FOR_ACTION.outputs.output-directory }} | -| iso-path | Path to just the ISO file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso-path }} | -| checksum-path | Path to just the checksum file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.checksum-path }} | +| iso_name | Path to just the ISO file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} | For outputs, see example above. diff --git a/action.yml b/action.yml index 20701b62..5a9792be 100644 --- a/action.yml +++ b/action.yml @@ -2,10 +2,24 @@ name: Build Container Installer description: Generates an ISO for installing an OSTree stored in a container image inputs: + action_version: + description: Version of the action container to run + deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version. + required: false + additional_templates: + description: Space delimited list of additional Lorax templates to include + required: false arch: description: Architecture for image to build required: true default: x86_64 + enrollment_password: + description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) + required: false + default: "container-installer" + extra_boot_params: + description: Extra params used by grub to boot the anaconda installer + required: false image_name: description: Name of the source container image required: true @@ -14,6 +28,16 @@ inputs: description: Repository containing the source container image required: true default: quay.io/fedora-ostree-desktops + image_tag: + description: Tag of the source container image. Defaults to the installer version + required: false + iso_name: + description: "Name of the resulting ISO. Relative paths are relative to github.workspace" + required: false + default: build/deploy.iso + secure_boot_key_url: + description: Secure boot key that is installed from URL location + required: false 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 @@ -22,31 +46,10 @@ inputs: description: Fedora version of installer to build required: true default: "39" - image_tag: - description: Tag of the source container image. Defaults to the installer version - required: false web_ui: description: Enable Anaconda WebUI required: false default: "false" - iso_name: - description: "Name of the resulting ISO. Relative paths are relative to github.workspace" - required: false - default: build/deploy.iso - enrollment_password: - description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) - required: false - default: "container-installer" - secure_boot_key_url: - description: Secure boot key that is installed from URL location - required: false - action_version: - description: Version of the action container to run - deprecationMessage: No longer used. github.action_ref replaces the need for this. Will be removed in a future version. - required: false - additional_templates: - description: Space delimited list of additional Lorax templates to include - required: false outputs: iso_name: From b329b2af003a18ec75f661a971128a8bc90cec61 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 15:27:00 -0600 Subject: [PATCH 49/57] fix: missing underscores --- action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 5a9792be..64489e52 100644 --- a/action.yml +++ b/action.yml @@ -92,10 +92,10 @@ runs: then full_path="${iso_name}" else - fullpath="${{ github.workspace }}/${iso_name}" + full_path="${{ github.workspace }}/${iso_name}" fi - mv ${{ github.workspace }}/build/deploy.iso ${fullpath} || true - cd $(dirname ${fullpath}) + mv ${{ github.workspace }}/build/deploy.iso ${full_path} || true + cd $(dirname ${full_path}) iso_fn=$(basename ${iso_name}) sha256sum ${iso_fn} > ${iso_fn%.iso}-CHECKSUM echo "ISO=${full_path}" >> $GITHUB_OUTPUT From d109d4a880dd790c377b98a096fcb94eb6f49eb1 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 15:42:19 -0600 Subject: [PATCH 50/57] fix: name --- .github/workflows/build-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index bcce10cb..faac411d 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -105,7 +105,7 @@ jobs: id: upload uses: actions/upload-artifact@v4 with: - name: ${{ steps.build.outputs.iso_name }} + name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso path: | ${{ steps.build.outputs.iso_name }} ${{ steps.build.outputs.iso_name }}-CHECKSUM From c1bf1fda5a5d557a18468881685ad8a2b6bb4fd8 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 15:49:18 -0600 Subject: [PATCH 51/57] chore: fixup README --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d8549f1..3875bea3 100644 --- a/README.md +++ b/README.md @@ -13,16 +13,20 @@ This action is designed to be called from a GitHub workflow using the following arch: ${{ env.ARCH}} image_name: ${{ env.IMAGE_NAME}} image_repo: ${{ env.IMAGE_REPO}} + image_tag: ${{ env.IMAGE_TAG }} version: ${{ env.VERSION }} variant: ${{ env.VARIANT }} + iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ env.VERSION }}.iso # This example is for uploading your ISO as a Github artifact. You can do something similar using any cloud storage, so long as you copy the output - name: Upload ISO as artifact id: upload uses: actions/upload-artifact@v4 with: - name: my_iso.iso - path: ${{ steps.build.outputs.output-directory }} + name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ env.VERSION }}.iso + path: | + ${{ steps.build.outputs.iso_name }} + ${{ steps.build.outputs.iso_name }}-CHECKSUM if-no-files-found: error retention-days: 0 compression-level: 0 From 38579860d87022bd79d117a78c6f786da8ce0cc1 Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Thu, 7 Mar 2024 17:09:18 -0500 Subject: [PATCH 52/57] add iso_path --- .github/workflows/build-and-test.yml | 6 +++--- action.yml | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index faac411d..16edbfa5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -105,10 +105,10 @@ jobs: id: upload uses: actions/upload-artifact@v4 with: - name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso + name: ${{ steps.build.outputs.iso_name }} path: | - ${{ steps.build.outputs.iso_name }} - ${{ steps.build.outputs.iso_name }}-CHECKSUM + ${{ steps.build.outputs.iso_path }} + ${{ steps.build.outputs.iso_path }}-CHECKSUM if-no-files-found: error retention-days: 0 compression-level: 0 diff --git a/action.yml b/action.yml index 64489e52..f8b2615a 100644 --- a/action.yml +++ b/action.yml @@ -53,8 +53,11 @@ inputs: outputs: iso_name: - value: ${{ steps.rename_iso.outputs.ISO }} - description: The location of the .iso object + value: ${{ steps.rename_iso.outputs.iso_name }} + description: The name of the resulting .iso + iso_path: + value: ${{ steps.rename_iso.outputs.iso_path }} + description: The name and path of the resulting .iso runs: using: composite @@ -98,4 +101,5 @@ runs: cd $(dirname ${full_path}) iso_fn=$(basename ${iso_name}) sha256sum ${iso_fn} > ${iso_fn%.iso}-CHECKSUM - echo "ISO=${full_path}" >> $GITHUB_OUTPUT + echo "iso_path=${full_path}" >> $GITHUB_OUTPUT + echo "iso_name=${iso_fn}" >> $GITHUB_OUTPUT From 60ecaa5008194a3eed04ace63901d026b12c3bda Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 16:20:07 -0600 Subject: [PATCH 53/57] chore: update documentation --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3875bea3..2400a584 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,10 @@ This action is designed to be called from a GitHub workflow using the following id: upload uses: actions/upload-artifact@v4 with: - name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ env.VERSION }}.iso + name: ${{ steps.build.outputs.iso_name }} path: | - ${{ steps.build.outputs.iso_name }} - ${{ steps.build.outputs.iso_name }}-CHECKSUM + ${{ steps.build.outputs.iso_path }} + ${{ steps.build.outputs.iso_path }}-CHECKSUM if-no-files-found: error retention-days: 0 compression-level: 0 @@ -57,9 +57,10 @@ The following variables can be used to customize the created ISO. Variant will be the third item in the package name. Example: `fedora-release-kinoite-39-34.noarch` will be kinoite ### Outputs -| Variable | Description | Usage | -| ----------------- | ------------------------------------------------------ | -------------------------------------------------------- | -| iso_name | Path to just the ISO file that the action creates | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} | +| Variable | Description | Usage | +| -------- | ----------------------------------------| ------------------------------------------------ | +| iso_name | The name of the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} | +| iso_path | The name and path of the resulting .iso | ${{ steps.YOUR_ID_FOR_ACTION.outputs.iso_name }} | For outputs, see example above. From 87a7b373d7c7f004718a1ae2178164c9a71fcef5 Mon Sep 17 00:00:00 2001 From: Noel Miller Date: Thu, 7 Mar 2024 16:29:56 -0600 Subject: [PATCH 54/57] fix: name of checksum --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f8b2615a..da1a6a7b 100644 --- a/action.yml +++ b/action.yml @@ -100,6 +100,6 @@ runs: mv ${{ github.workspace }}/build/deploy.iso ${full_path} || true cd $(dirname ${full_path}) iso_fn=$(basename ${iso_name}) - sha256sum ${iso_fn} > ${iso_fn%.iso}-CHECKSUM + sha256sum ${iso_fn} > ${iso_fn}-CHECKSUM echo "iso_path=${full_path}" >> $GITHUB_OUTPUT echo "iso_name=${iso_fn}" >> $GITHUB_OUTPUT From c4456b0342cf19d08f08eb24a071c8de5aadcbbe Mon Sep 17 00:00:00 2001 From: "Jason N." <33561705+JasonN3@users.noreply.github.com> Date: Thu, 7 Mar 2024 18:06:03 -0500 Subject: [PATCH 55/57] eww --- .github/workflows/build-and-test.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 16edbfa5..ad1a8391 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -68,7 +68,8 @@ jobs: - 38 - 39 outputs: - iso_name: ${{ steps.build.outputs.iso_name }} + iso_name-38: ${{ steps.save_output.outputs.iso_name-38 }} + iso_name-39: ${{ steps.save_output.outputs.iso_name-39 }} steps: - name: Checkout repo uses: actions/checkout@v4 @@ -101,6 +102,12 @@ jobs: enrollment_password: ${{ env.ENROLLMENT_PASSWORD }} iso_name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_TAG }}-${{ matrix.version }}.iso + - name: Save output + id: save_output + shell: bash + run: | + echo "iso_name-${{ matrix.version }}=${{ steps.build.outputs.iso_name}}" >> $GITHUB_OUTPUT + - name: Upload ISO as artifact id: upload uses: actions/upload-artifact@v4 @@ -142,16 +149,16 @@ jobs: - name: Download generated ISO uses: actions/download-artifact@v4 with: - name: ${{ needs.build-and-push-iso.outputs.iso_name }} + name: ${{ needs['build-and-push-iso']['outputs'][format('iso_name-{0}', matrix.version)] }} - name: Verify ISO run: | - checkisomd5 ${{ needs.build-and-push-iso.outputs.iso_name }} - sha256sum -c ${{ needs.build-and-push-iso.outputs.iso_name }}-CHECKSUM + checkisomd5 ${{ needs['build-and-push-iso']['outputs'][format('iso_name-{0}', matrix.version)] }} + sha256sum -c ${{ needs['build-and-push-iso']['outputs'][format('iso_name-{0}', matrix.version)] }}-CHECKSUM - name: Run ISO checks run: | - mv ${{ needs.build-and-push-iso.outputs.iso_name }} deploy.iso + mv ${{ needs['build-and-push-iso']['outputs'][format('iso_name-{0}', matrix.version)] }} deploy.iso make test-iso VERSION=${{ matrix.version }} - name: Add Kickstart and Grub options to ISO From 56719cc0667bc2c194c58d76dbfb302d720f5475 Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Fri, 8 Mar 2024 09:19:53 -0500 Subject: [PATCH 56/57] Update README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2400a584..cdc41196 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ The following variables can be used to customize the created ISO. | image_repo | Repository containing the source container image | quay.io/fedora-ostree-desktops | | image_tag | Tag of the source container image | *VERSION* | | iso_name | Name of the ISO you wish to output when completed | build/deploy.iso | -| secure_boot_key_url | Secure boot key that is installed from URL location | \[empty\] | +| secure_boot_key_url | Secure boot key that is installed from URL location\*\* | \[empty\] | | variant | Source container variant\* | Server | | version | Fedora version of installer to build | 39 | | web_ui | Enable Anaconda WebUI (experimental) | false | @@ -56,6 +56,8 @@ The following variables can be used to customize the created ISO. \*Available options for VARIANT 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 kinoite +\*\* If you need to reference a local file, you can use `file://*path*` + ### Outputs | Variable | Description | Usage | | -------- | ----------------------------------------| ------------------------------------------------ | @@ -70,7 +72,7 @@ The Makefile contains all of the commands that are run in the action. There are `make install-deps` can be used to install the necessary packages -See [Customizing](#customizing) for information about customizing the ISO that gets created. +See [Customizing](#customizing) for information about customizing the ISO that gets created. All variable should be specified CAPITALIZED. ### Container A container with `make install-deps` already run is provided at `ghcr.io/jasonn3/build-container-installer:latest` @@ -79,17 +81,17 @@ To use the container file, run `docker run --privileged --volume .:/build-contai This will create an ISO with the baked in defaults of the container image. The resulting file will be called `deploy.iso` -See [Customizing](#customizing) for information about customizing the ISO that gets created. The variable can either be defined as environment variables. +See [Customizing](#customizing) for information about customizing the ISO that gets created. The variable can either be defined as environment variables. All variable should be specified CAPITALIZED. Examples: Building an ISO to install Fedora 38 ```bash -docker run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=38 IMAGE_NAME=base IMAGE_TAG=38 VARIANT=Server +docker run --rm --privileged --volume .:/github/workspace/build ghcr.io/jasonn3/build-container-installer:latest VERSION=38 IMAGE_NAME=base IMAGE_TAG=38 VARIANT=Server ``` Building an ISO to install Fedora 39 ```bash -docker run --rm --privileged --volume .:/build-container-installer/build ghcr.io/jasonn3/build-container-installer:latest VERSION=39 IMAGE_NAME=base IMAGE_TAG=39 VARIANT=Server +docker run --rm --privileged --volume .:/github/workspace/build ghcr.io/jasonn3/build-container-installer:latest VERSION=39 IMAGE_NAME=base IMAGE_TAG=39 VARIANT=Server ``` ### VSCode Dev Container From cafc4ef2d20b23ab87e35f5f57158c7abddafef7 Mon Sep 17 00:00:00 2001 From: Jason N <33561705+JasonN3@users.noreply.github.com> Date: Fri, 8 Mar 2024 09:28:45 -0500 Subject: [PATCH 57/57] match case --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index da1a6a7b..75c7fb5a 100644 --- a/action.yml +++ b/action.yml @@ -14,7 +14,7 @@ inputs: required: true default: x86_64 enrollment_password: - description: Used for supporting secure boot (requires SECURE_BOOT_KEY_URL to be defined) + description: Used for supporting secure boot (requires secure_boot_key_url to be defined) required: false default: "container-installer" extra_boot_params: