Skip to content

Clearfog Ubuntu ISO Installer #239

Clearfog Ubuntu ISO Installer

Clearfog Ubuntu ISO Installer #239

name: Clearfog Ubuntu ISO Installer
on:
workflow_run:
workflows: ["Docker Image CI"]
types:
- completed
branches: [ main ]
workflow_dispatch:
permissions:
id-token: write
attestations: write
contents: write
jobs:
build_iso:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Fetch tags
run: git fetch --tags
- name: Get version from git
run: echo "RELEASE_VERSION_TAG=$(git tag --contains $(git rev-parse HEAD) | grep -v clearfog)" >> $GITHUB_ENV
- name: Set up Qemu emulation
run: ./installer/qemu-setup-linux.sh
- name: Download the image
working-directory: ./installer
run: ./clearfog-download*
- name: Build install image
working-directory: ./installer
run: ./clearfog-arm64-image-build.sh
- name: Compress image
run: xz ./installer/data/spr.img
- name: Create Release
if: ${{ github.ref_name == 'main' }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: Clearfog Release ${{ env.RELEASE_VERSION_TAG }}
tag_name: clearfog-${{ env.RELEASE_VERSION_TAG }}
draft: false
prerelease: true
- name: Attest ISO Provenance
uses: actions/attest-build-provenance@v1
with:
subject-path: "./installer/data/spr.img.xz"
subject-name: "clearfog-spr.img.xz"
- name: Upload Release Asset
if: ${{ github.ref_name == 'main' }}
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./installer/data/spr.img.xz
asset_name: clearfog-spr.img.xz
asset_content_type: application/x-xz