|
| 1 | +--- |
| 2 | +name: Build ISO image |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + create-release: |
| 8 | + description: "Create GitHub Release" |
| 9 | + required: false |
| 10 | + default: false |
| 11 | + type: boolean |
| 12 | + release-tag: |
| 13 | + description: "Release tag (e.g., v1.0.0) - required if creating release" |
| 14 | + required: false |
| 15 | + type: string |
| 16 | + |
| 17 | +env: |
| 18 | + IMAGE_NAME: ${{ github.event.repository.name }} |
| 19 | + IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}" |
| 20 | + |
| 21 | +concurrency: |
| 22 | + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} |
| 23 | + cancel-in-progress: true |
| 24 | + |
| 25 | +jobs: |
| 26 | + build: |
| 27 | + name: Build ISO |
| 28 | + runs-on: ubuntu-latest-m |
| 29 | + permissions: |
| 30 | + contents: write |
| 31 | + packages: read |
| 32 | + id-token: write |
| 33 | + |
| 34 | + steps: |
| 35 | + - name: Prepare environment |
| 36 | + run: | |
| 37 | + echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> ${GITHUB_ENV} |
| 38 | + echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV} |
| 39 | +
|
| 40 | + - name: Maximize build space |
| 41 | + uses: ublue-os/remove-unwanted-software@v9 |
| 42 | + |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v6 |
| 45 | + |
| 46 | + - name: Build ISO |
| 47 | + id: build |
| 48 | + uses: binarypie-dev/titanoboa@main |
| 49 | + with: |
| 50 | + image-ref: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:latest |
| 51 | + iso-dest: ${{ github.workspace }}/output.iso |
| 52 | + builder-distro: fedora |
| 53 | + livesys: true |
| 54 | + livesys-repo: binarypie/hypercube |
| 55 | + flatpaks-list: NONE |
| 56 | + hook-post-rootfs: ${{ github.workspace }}/iso_files/hook-post-rootfs.sh |
| 57 | + |
| 58 | + - name: Rename ISO and generate checksum |
| 59 | + id: rename |
| 60 | + run: | |
| 61 | + set -x |
| 62 | + mkdir -p output |
| 63 | + NEW_NAME="${{ env.IMAGE_NAME }}.iso" |
| 64 | + mv "${{ steps.build.outputs.iso-dest }}" "output/$NEW_NAME" |
| 65 | + (cd output && sha256sum "$NEW_NAME" | tee "$NEW_NAME.sha256") |
| 66 | + echo "iso-path=output/$NEW_NAME" >> $GITHUB_OUTPUT |
| 67 | + echo "iso-name=$NEW_NAME" >> $GITHUB_OUTPUT |
| 68 | +
|
| 69 | + - name: Upload ISO as artifact |
| 70 | + uses: actions/upload-artifact@v6 |
| 71 | + with: |
| 72 | + name: ${{ env.IMAGE_NAME }}-iso |
| 73 | + path: output/ |
| 74 | + if-no-files-found: error |
| 75 | + retention-days: 7 |
| 76 | + compression-level: 0 |
| 77 | + |
| 78 | + - name: Upload ISO to release |
| 79 | + if: inputs.create-release == true && inputs.release-tag != '' |
| 80 | + uses: softprops/action-gh-release@v2 |
| 81 | + with: |
| 82 | + tag_name: ${{ inputs.release-tag }} |
| 83 | + files: | |
| 84 | + output/${{ steps.rename.outputs.iso-name }} |
| 85 | + output/${{ steps.rename.outputs.iso-name }}.sha256 |
| 86 | + fail_on_unmatched_files: true |
| 87 | + generate_release_notes: true |
0 commit comments