From 2494c1ad2ebf92866616bb01d8ab87aee02c9154 Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Wed, 30 Sep 2026 12:44:49 +0200 Subject: [PATCH] feat(ci): build the ISO with a Steamify branch (input steamify_ref): a release branch tests its own version before it is released --- .github/workflows/iso-1-github-tag.yml | 17 ++++++++++++++--- .github/workflows/iso-2-gitea-build.yml | 18 ++++++++++++++++-- AGENTS.md | 2 +- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/.github/workflows/iso-1-github-tag.yml b/.github/workflows/iso-1-github-tag.yml index 76e9937..ee56402 100644 --- a/.github/workflows/iso-1-github-tag.yml +++ b/.github/workflows/iso-1-github-tag.yml @@ -20,6 +20,10 @@ on: type: choice options: [auto, release, dev] default: auto + steamify_ref: + description: "Steamify branch or tag to build the ISO with (empty: the newest published release). A release branch tests its own version." + type: string + default: "" permissions: contents: write @@ -42,6 +46,12 @@ jobs: run: | steamify="$(gh release view -R theupriser/steamify-cachyos --json tagName -q .tagName)" steamify="${steamify#v}" + # A branch or tag of Steamify to build with (a release branch before its release), else the newest release. + sref="${{ inputs.steamify_ref }}" + if [ -n "$sref" ]; then + steamify="$(gh api "repos/theupriser/steamify-cachyos/contents/steamify.sh?ref=$sref" -q .content | base64 -d | sed -n 's/^VERSION=//p' | head -n 1)" + [ -n "$steamify" ] || { echo "::error::no VERSION in steamify.sh at $sref"; exit 1; } + fi stamp="$(date -u +%y%m%d)" day="$(date -u +%Y.%m.%d)" kind="${{ inputs.kind }}" if [ -z "$kind" ] || [ "$kind" = auto ]; then @@ -57,11 +67,11 @@ jobs: file="steamify-cachyos-${tag#v}-x86_64.iso" dl="$GITEA_URL/$GITEA_REPO/releases/download/$tag" # The Steamify section of CHANGELOG.md ("## CachyOS with Steamify Live ISO"), without its heading. section="$(awk '/^## CachyOS with Steamify Live ISO/ {found = 1; next} found && /^#/ {exit} found' CHANGELOG.md)" - notes="The ISO is built from \`$(git rev-parse --short HEAD)\` (${{ github.ref_name }}) with Steamify $steamify and published on the mirror (GitHub releases take at most 2 GB per file), about half an hour after this release (the mirror's sync, then the build): + notes="The ISO is built from \`$(git rev-parse --short HEAD)\` (${{ github.ref_name }}) with Steamify $steamify${sref:+ (branch $sref)} and published on the mirror (GitHub releases take at most 2 GB per file), about half an hour after this release (the mirror's sync, then the build): **Download: [$file]($dl/$file)** ([SHA-256]($dl/$file.sha256), [release page]($GITEA_URL/$GITEA_REPO/releases/tag/$tag)) - Sources: [Steamify](https://github.com/theupriser/steamify-cachyos/tree/v$steamify), this repository at this tag, and the packages' sources at [CachyOS](https://github.com/CachyOS) and [Arch Linux](https://archlinux.org/packages/). + Sources: [Steamify](https://github.com/theupriser/steamify-cachyos/tree/${sref:-v$steamify}), this repository at this tag, and the packages' sources at [CachyOS](https://github.com/CachyOS) and [Arch Linux](https://archlinux.org/packages/). $section" # One ISO per day and kind: the newest build of a day replaces the earlier one (space), here and on the mirror. @@ -78,6 +88,7 @@ jobs: gh release create "$tag" --verify-tag $pre --title "$name" --notes "$notes" echo "Released $tag" echo "ISO_TAG=$tag" >> "$GITHUB_ENV" + echo "STEAMIFY_REF=$sref" >> "$GITHUB_ENV" # Retention (space): at most 10 dev and 10 real releases; the oldest go, release and tag. The mirror drops the # tag with its release and ISO at its next sync (the step below). @@ -108,5 +119,5 @@ jobs: [ "$got" = "$want" ] || { echo "::error::the mirror does not have $ISO_TAG ($want) after 5 minutes"; exit 1; } # ref: the full name (refs/tags/...), as in Gitea's API documentation; --fail-with-body shows the server's reason. curl -sS --fail-with-body --retry 3 -X POST -H "Authorization: token $GIT_UPRISER_TOKEN" -H "Content-Type: application/json" \ - -d "{\"ref\":\"refs/tags/$ISO_TAG\"}" "$api/actions/workflows/iso-2-gitea-build.yml/dispatches" + -d "{\"ref\":\"refs/tags/$ISO_TAG\",\"inputs\":{\"steamify_ref\":\"$STEAMIFY_REF\"}}" "$api/actions/workflows/iso-2-gitea-build.yml/dispatches" echo "Started the mirror's build for $ISO_TAG" diff --git a/.github/workflows/iso-2-gitea-build.yml b/.github/workflows/iso-2-gitea-build.yml index dbe1c2c..14245e5 100644 --- a/.github/workflows/iso-2-gitea-build.yml +++ b/.github/workflows/iso-2-gitea-build.yml @@ -14,6 +14,11 @@ name: ISO 2/2 ยท Build and publish (Gitea) # run by itself, so nothing is triggered by tag pushes). on: workflow_dispatch: + inputs: + steamify_ref: + description: "Steamify branch or tag to build with (set by iso-1; empty: the release the tag names)" + type: string + default: "" # One run at a time for the whole workflow (not per tag): a new run stops the running one and takes over. concurrency: @@ -75,7 +80,15 @@ jobs: echo "steamify=${m[1]}" >> "$GITHUB_OUTPUT" - name: Steamify on the ISO (the version the tag names) - run: ./steamify-prepare.sh + run: | + ref="${{ inputs.steamify_ref }}" + if [ -n "$ref" ]; then + # A branch (a release branch before its release): its checkout goes on the ISO. + git clone -q --depth 1 --branch "$ref" https://github.com/theupriser/steamify-cachyos.git /tmp/steamify-src + ./steamify-prepare.sh /tmp/steamify-src + else + ./steamify-prepare.sh + fi - name: Build run: | @@ -159,12 +172,13 @@ jobs: fi { echo "publish=true"; echo "name=$name"; } >> "$GITHUB_OUTPUT" section="$(awk '/^## CachyOS with Steamify Live ISO/ {found = 1; next} found && /^#/ {exit} found' CHANGELOG.md)" + src="${{ inputs.steamify_ref }}"; src="${src:-v$STEAMIFY_VERSION}" { echo "Built from \`$(git rev-parse --short HEAD)\` ($tag) with Steamify $STEAMIFY_VERSION." echo echo "SHA-256: \`$(cut -d' ' -f1 "$iso.sha256")\`, label \`STEAMIFY_${STEAMIFY_VERSION//./_}_$b\`" echo - echo "Sources: [Steamify](https://github.com/theupriser/steamify-cachyos/tree/v$STEAMIFY_VERSION), this repository at this tag, and the packages' sources at [CachyOS](https://github.com/CachyOS) and [Arch Linux](https://archlinux.org/packages/)." + echo "Sources: [Steamify](https://github.com/theupriser/steamify-cachyos/tree/$src), this repository at this tag, and the packages' sources at [CachyOS](https://github.com/CachyOS) and [Arch Linux](https://archlinux.org/packages/)." echo echo "$section" } > release-notes.md diff --git a/AGENTS.md b/AGENTS.md index a79d379..8edbb97 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -119,7 +119,7 @@ Full write-up, with every trap: `steamify-iso-release` in steamify-cachyos-dev. date, no time): `vX.Y.Z-YYMMDD` (real) or `vX.Y.Z-dev-YYMMDD` (dev), file `steamify-cachyos-X.Y.Z-[dev-]YYMMDD-x86_64.iso`, an **annotated** tag and a release with notes and the direct download link. One ISO per day and kind: a second build the same day deletes the earlier release and tag (GitHub) and tags again; the mirror takes the new tag object, iso-2 replaces the old mirror release. Retention: at most 10 dev and 10 real - releases are kept (space); the oldest are deleted with `gh release delete --cleanup-tag`, and the mirror drops their tags, releases and ISOs at its next sync. The workflow always runs from `master`; its input `kind` (`release`, `dev`, or `auto`: release on master, dev on other branches) decides: `release` is a real release, `dev` a `dev-` pre-release. steamify-cachyos' bundle.yml passes it: a version published from main -> `release`, a version on a release branch -> `dev`. + releases are kept (space); the oldest are deleted with `gh release delete --cleanup-tag`, and the mirror drops their tags, releases and ISOs at its next sync. The workflow always runs from `master`; its input `steamify_ref` (a Steamify branch or tag, empty = the newest published release) builds the ISO with that checkout and names it after that branch's `VERSION` (a release branch tests its own version before it is released); its input `kind` (`release`, `dev`, or `auto`: release on master, dev on other branches) decides: `release` is a real release, `dev` a `dev-` pre-release. steamify-cachyos' bundle.yml passes it: a version published from main -> `release`, a version on a release branch -> `dev`. - `.github/workflows/iso-2-gitea-build.yml` (Gitea, `workflow_dispatch` with the tag as the ref, started by iso-1's last step through the mirror's dispatch API after the mirror has the new tag object; a tag push starts nothing, because a replaced tag of the same name starts no run; skipped on GitHub) runs two jobs for that tag: build the ISO, then attach it to the mirror's release. It is not tested there (the runner is small): the VM tests run on GitHub, in steamify-cachyos `vmtest.yml`, on the newest ISO release of the mirror. The tag decides everything: Steamify version (`steamify-prepare.sh`