From a2b805669e61b73878cc54129a27f13f365a0a3d Mon Sep 17 00:00:00 2001 From: EinoHR <60004820+EinoHR@users.noreply.github.com> Date: Fri, 4 Aug 2023 15:53:26 +0300 Subject: [PATCH] feat: ISO build action (#133) * feat: base iso release workflow * does not produce a functional ISO yet needs boot_menu * chore(dev): start iso workflow on iso push * fix: rename release-iso to release-please * refactor: use github-cli to create release * fix: remove job dependencies * chore: basic boot menu * fix: add permission to create release * fix: delegate tag for auto-iso releases,.. delete old version when rerunning * fix: multiline string for multine cmds * fix: specify gh repo in old release delete * fix: only create release if doesn't exist * fix: boot menu double user field * fix: clobber iso * chore: neutral defaults for boot menu * feat: run iso when iso-related changes pushed * docs: README section for ISO --- .github/workflows/release-iso.yml | 46 +++++++++++++++++++++++++++++++ README.md | 10 +++++++ boot_menu.yml | 5 ++++ 3 files changed, 61 insertions(+) create mode 100644 .github/workflows/release-iso.yml create mode 100644 boot_menu.yml diff --git a/.github/workflows/release-iso.yml b/.github/workflows/release-iso.yml new file mode 100644 index 0000000000..2b1f2ada88 --- /dev/null +++ b/.github/workflows/release-iso.yml @@ -0,0 +1,46 @@ +on: + push: + paths: + - 'boot_menu.yml' + - '.github/workflows/release-iso.yml' + workflow_dispatch: + +name: release-iso +jobs: + release-iso: + name: Generate and Release ISOs + runs-on: ubuntu-latest + permissions: + contents: write + container: + image: fedora:38 + options: --privileged + steps: + - uses: actions/checkout@v3 + - name: Generate ISO + uses: ublue-os/isogenerator@main + id: isogenerator + with: + image-name: ${{ github.event.repository.name }} + installer-repo: releases + installer-major-version: 38 + boot-menu-path: boot_menu.yml + - name: install github CLI + run: | + sudo dnf install 'dnf-command(config-manager)' -y + sudo dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo + sudo dnf install gh -y + - name: Upload ISO + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + if gh release list -R ${{ github.repository_owner }}/${{ github.event.repository.name }} | grep "auto-iso"; then + gh release upload auto-iso ${{ steps.isogenerator.outputs.iso-path }} -R ${{ github.repository_owner }}/${{ github.event.repository.name }} --clobber + else + gh release create auto-iso ${{ steps.isogenerator.outputs.iso-path }} -t ISO -n "This is an automatically generated ISO release." -R ${{ github.repository_owner }}/${{ github.event.repository.name }} + fi + - name: Upload SHA256SUM + env: + GITHUB_TOKEN: ${{ github.token }} + run: + gh release upload auto-iso ${{ steps.isogenerator.outputs.sha256sum-path }} -R ${{ github.repository_owner }}/${{ github.event.repository.name }} --clobber diff --git a/README.md b/README.md index 4c1245298f..22a1371477 100644 --- a/README.md +++ b/README.md @@ -116,6 +116,16 @@ This repository by default also supports signing The `latest` tag will automatically point to the latest build. That build will still always use the Fedora version specified in `recipe.yml`, so you won't get accidentally updated to the next major version. +## ISO + +This template includes a simple Github Action to build and release an ISO of your image. + +To run the action, simply edit the `boot_menu.yml` by changing all the references to `ublue-os/startingpoint` to your repository. This should trigger the action automatically. + +The Action uses [isogenerator](https://github.com/ublue-os/isogenerator) and works in a similar manner to the official Universal Blue ISO. If you have any issues, you should first check [the documentation page on installation](https://universal-blue.org/installation/). The ISO is a netinstaller and should always pull the latest version of your image. + +Note that this release-iso action is not a replacement for a full-blown release automation like [release-please](https://github.com/googleapis/release-please). + ## Just The `just` task runner is included in `ublue-os/main`-derived images, and we have provided several template commands which help you perform further customization after first boot. diff --git a/boot_menu.yml b/boot_menu.yml new file mode 100644 index 0000000000..7a272cc55b --- /dev/null +++ b/boot_menu.yml @@ -0,0 +1,5 @@ +ublue_variants: + - label: ublue-os/startingpoint + ks: /kickstart/ublue-os.ks + flavors: + - label: startingpoint \ No newline at end of file