11---
2- name : Build ISO
2+ name : Build bootable artifacts
33
44inputs :
55 platform :
@@ -9,20 +9,27 @@ inputs:
99 description : Full podman image reference, including hash (e.g., "registry.example.com/image@sha256")
1010 required : true
1111 image-name :
12- description : Name of the image, will be used to name the ISO file (e.g., "my-image")
12+ description : Name of the image, will be used to name the artifact files (e.g., "my-image")
1313 required : true
14+ image-types :
15+ description : The types of bootable artifacts to build (e.g., "iso,raw")
16+ required : false
17+ default : " iso"
1418 update_is_signed :
1519 description : Whether the image is signed or not
1620 required : false
1721 update_origin_ref :
1822 description : Image reference to update from (e.g., "{image}:latest")
1923 required : true
2024 config-file :
21- description : Path to the ISO configuration file
25+ description : Path to the bootable artifacts configuration file
2226 required : true
23- use_librepo :
27+ use-librepo :
2428 description : " Use librepo to download the image"
2529 required : false
30+ additional-args :
31+ description : " Additional arguments to pass to the bootc-image-builder"
32+ required : false
2633 REGISTRY :
2734 description : The container registry URL (e.g., "registry.example.com")
2835 required : true
@@ -35,17 +42,11 @@ inputs:
3542
3643outputs :
3744 output_directory :
38- description : The directory where the built ISO and checksum are stored
45+ description : The directory where the built artifacts and checksums are stored
3946 value : ${{ steps.rename.outputs.output_directory }}
40- artifact_name :
41- description : The name of the artifact (ISO file) without the extension
42- value : ${{ steps.rename.outputs.ARTIFACT_NAME }}
43- iso_name :
44- description : The name of the built ISO file
45- value : ${{ steps.rename.outputs.ISO_NAME }}
46- checksum_name :
47- description : The name of the checksum file for the ISO
48- value : ${{ steps.rename.outputs.CHECKSUM_NAME }}
47+ artifact_basename :
48+ description : The base name of the artifacts
49+ value : ${{ steps.rename.outputs.artifact_basename }}
4950
5051runs :
5152 using : " composite"
6465 ARCH=${{ inputs.platform }}
6566 echo "CLEAN_ARCH=${ARCH//\//_}" >> "$GITHUB_ENV"
6667
67- - name : Prepare ISO configuration
68+ - name : Prepare bootable artifacts configuration
6869 shell : bash
6970 run : |
7071 [ "${{ inputs.update_is_signed }}" = "true" ] && SIG="--enforce-container-sigpolicy"
@@ -73,36 +74,42 @@ runs:
7374 sed -i "s#<IMAGE_SIGNED>#${SIG}#g" ${{ inputs.config-file }}
7475 cat ${{ inputs.config-file }}
7576
76- - name : Build ISO
77+ [ "${{ inputs.use-librepo }}" = "true" ] && USE_LIBREPO="True" || USE_LIBREPO="False"
78+ ADDITIONAL_ARGS="--target-arch=${{ env.CLEAN_ARCH }} --use-librepo=${USE_LIBREPO} ${{ inputs.additional-args }}"
79+
80+ echo "ADDITIONAL_ARGS=${ADDITIONAL_ARGS}" >> "$GITHUB_ENV"
81+
82+ - name : Build bootable artifacts
7783 id : build
78- # uses: ublue-os/bootc-image-builder-action@b98784c42327746e107a6a753b64f44823bdbf2f
79- uses : alexiri/bootc-image-builder-action@platform
84+ uses : osbuild/bootc-image-builder-action@4503a3445240ffc85cccf8f57d7cab5634e351e2
8085 with :
81- image : ${{ inputs.image }}
82- type : iso
83- use-librepo : ${{ inputs.use_librepo }}
8486 config-file : ${{ inputs.config-file }}
85- platform : linux/${{ inputs.platform }}
87+ image : ${{ inputs.image }}
88+ additional-args : ${{ env.ADDITIONAL_ARGS }}
89+ types : ${{ inputs.image-types }}
8690
87- - name : Rename ISO
91+ - name : Rename bootable artifacts
8892 id : rename
8993 env :
90- IMAGE_NAME : ${{ inputs.image-name }}-${{ env.CLEAN_ARCH }}-live.iso
9194 OUTPUT_PATH : output-${{ env.CLEAN_ARCH }}
9295 shell : bash
9396 run : |
9497 set -x
9598 mkdir -p ${{ env.OUTPUT_PATH }}
9699 OUTPUT_DIRECTORY="$(realpath ${{ env.OUTPUT_PATH }})"
100+ ARTIFACT_BASENAME="${{ inputs.image-name }}-${{ env.CLEAN_ARCH }}"
101+
102+ echo '${{ steps.build.outputs.output-paths }}' | jq -c '.[]' | while read -r artifact; do
103+ ARTIFACT_PATH=$(echo "$artifact" | jq -r '.path')
104+ ARTIFACT_CHECKSUM=$(echo "$artifact" | jq -r '.checksum')
105+ ARTIFACT_EXTENSION=$(echo "$ARTIFACT_PATH" | awk -F. '{print $NF}')
97106
98- ARTIFACT_NAME="${{ inputs.image-name }}-${{ env.CLEAN_ARCH }}"
99- ISO_NAME="${ARTIFACT_NAME}.iso"
100- CHECKSUM_NAME="${ISO_NAME}-CHECKSUM"
107+ ARTIFACT_NAME="${ARTIFACT_BASENAME}.${ARTIFACT_EXTENSION}"
108+ CHECKSUM_NAME="${ARTIFACT_NAME}-CHECKSUM"
101109
102- mv ${{ steps.build.outputs.output-path }} "${OUTPUT_DIRECTORY}/${ISO_NAME}"
103- mv ${{ steps.build.outputs.checksum-path }} "${OUTPUT_DIRECTORY}/${CHECKSUM_NAME}"
110+ cp "$ARTIFACT_PATH" "${OUTPUT_DIRECTORY}/${ARTIFACT_NAME}"
111+ echo "$ARTIFACT_CHECKSUM" > "${OUTPUT_DIRECTORY}/${CHECKSUM_NAME}"
112+ done
104113
105- echo "output_directory=$OUTPUT_DIRECTORY" >> "${GITHUB_OUTPUT}"
106- echo "ISO_NAME=${ISO_NAME}" >> "${GITHUB_OUTPUT}"
107- echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> "${GITHUB_OUTPUT}"
108- echo "CHECKSUM_NAME=${CHECKSUM_NAME}" >> "${GITHUB_OUTPUT}"
114+ echo "output_directory=${OUTPUT_DIRECTORY}" >> "${GITHUB_OUTPUT}"
115+ echo "artifact_basename=${ARTIFACT_BASENAME}" >> "${GITHUB_OUTPUT}"
0 commit comments