From 04891ee2cddcaa40d2e1ddea4d9e07349b49260b Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Thu, 24 Sep 2026 10:07:56 +0200 Subject: [PATCH 1/3] ci: A release per version (tag v0.7.0, ...) instead of overwriting "latest" - Publish release v$VERSION with its CHANGELOG.md section; never overwrite an existing version. - Pull requests warn when VERSION is already released. - Install URL: releases/latest/download/setup-gamescope-boot.sh (newest release). --- .github/workflows/bundle.yml | 51 ++++++++++++++++++++++-------------- AGENTS.md | 5 ++-- CHANGELOG.md | 8 +++++- README.md | 5 ++-- 4 files changed, 44 insertions(+), 25 deletions(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 90b3c03..f014143 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -1,7 +1,9 @@ -# Builds the single-file wizard (.github/tools/bundle.sh) and publishes it as the -# asset of the rolling "latest" release, for: -# curl -fsSL https://github.com/theupriser/cachyos-gamescope-boot/releases/download/latest/setup-gamescope-boot.sh | bash -# Pull requests only build and check it. +# Builds the single-file wizard (.github/tools/bundle.sh) and publishes it as a +# release per version: tag v$VERSION (VERSION in setup-gamescope-boot.sh), +# with that version's CHANGELOG.md section as notes. A released version is +# never overwritten; the newest one is marked latest, so this always gets it: +# curl -fsSL https://github.com/theupriser/cachyos-gamescope-boot/releases/latest/download/setup-gamescope-boot.sh | bash +# Pull requests only build and check it, and warn when VERSION is already released. name: Single-file build on: @@ -35,29 +37,38 @@ jobs: name: setup-gamescope-boot path: dist/setup-gamescope-boot.sh - - name: Publish to the "latest" release - if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' + - name: Version + id: version env: GH_TOKEN: ${{ github.token }} run: | version="$(grep -oP '^VERSION=\K.*' setup-gamescope-boot.sh)" + echo "version=$version" >> "$GITHUB_OUTPUT" + if gh release view "v$version" >/dev/null 2>&1; then + echo "released=true" >> "$GITHUB_OUTPUT" + echo "::warning::v$version is already released and won't be overwritten. Bump VERSION in setup-gamescope-boot.sh and add a CHANGELOG.md section to release this." + else + echo "released=false" >> "$GITHUB_OUTPUT" + fi + + - name: Publish the v${{ steps.version.outputs.version }} release + if: >- + github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && + steps.version.outputs.released == 'false' + env: + GH_TOKEN: ${{ github.token }} + VERSION: ${{ steps.version.outputs.version }} + run: | # This version's section of CHANGELOG.md, without its heading. - changes="$(awk -v v="$version" ' + changes="$(awk -v v="$VERSION" ' $0 ~ "^## " { if (found) exit; if (index($0, "## " v " ") == 1) { found = 1; next } } found' CHANGELOG.md)" - notes="Single-file build of v$version ($(git describe --always), $(git log -1 --format=%cs)). - Run it with: + notes="Single-file build of v$VERSION ($(git describe --always), $(git log -1 --format=%cs)). + Run the newest version with: - curl -fsSL https://github.com/${{ github.repository }}/releases/download/latest/setup-gamescope-boot.sh | bash + curl -fsSL https://github.com/${{ github.repository }}/releases/latest/download/setup-gamescope-boot.sh | bash - ## Changes in v$version + ## Changes in v$VERSION $changes" - title="Latest single-file build (v$version)" - if gh release view latest >/dev/null 2>&1; then - gh release edit latest --title "$title" --notes "$notes" - else - gh release create latest --title "$title" --notes "$notes" --latest - fi - # Move the tag to this commit and replace the asset. - git tag -f latest && git push -f origin latest - gh release upload latest dist/setup-gamescope-boot.sh --clobber + gh release create "v$VERSION" dist/setup-gamescope-boot.sh \ + --target "$GITHUB_SHA" --title "v$VERSION" --notes "$notes" --latest diff --git a/AGENTS.md b/AGENTS.md index 3c16209..72ef0bd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,8 +35,9 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine the entry point's `for lib in ...; do` source loop and wraps everything after that loop in `main()`. Keep that loop on one line, keep all logic in functions, and don't rely on `SCRIPT_DIR` for anything but sourcing. - CI (`.github/workflows/bundle.yml`) publishes the bundle to the `latest` - release on pushes to `main`. + CI (`.github/workflows/bundle.yml`) publishes the bundle as release + `v$VERSION` on pushes to `main`; an existing version is never overwritten, + so bump `VERSION` for every release. ## Conventions diff --git a/CHANGELOG.md b/CHANGELOG.md index b15d4d2..a05ee36 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,13 @@ Machine LED driver works on every installed kernel and survives kernel updates. - Fix a shellcheck warning in the bundle (a variable name shared with `lib/state.sh`), which would have failed the CI check. - `d7231eb` **chore: Move the bundle tool to .github/tools/bundle.sh** -- **docs: Commit hashes in the changelog** +- `5c00504` **docs: Commit hashes in the changelog** +- **ci: A release per version (tag v0.7.0, ...) instead of overwriting "latest"** + - Each push to `main` publishes release `v$VERSION` with that version's + changelog; an already released version is never overwritten (pull requests + get a warning when `VERSION` wasn't bumped). + - Install with `.../releases/latest/download/setup-gamescope-boot.sh`, which + always points to the newest release. ## 0.6.2 - 2026-09-23 diff --git a/README.md b/README.md index b8e3f8c..9955aa8 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Everything you turn off is put back the way it was. Open **Konsole** on your Plasma desktop and run: ```bash -curl -fsSL https://github.com/theupriser/cachyos-gamescope-boot/releases/download/latest/setup-gamescope-boot.sh | bash +curl -fsSL https://github.com/theupriser/cachyos-gamescope-boot/releases/latest/download/setup-gamescope-boot.sh | bash ``` That downloads and runs the latest single-file version, and works in any @@ -334,7 +334,8 @@ gamescope-session, ...) stay installed. The single-file version is generated: on every push to `main`, GitHub Actions runs `.github/tools/bundle.sh`, checks the result with `bash -n` and -shellcheck, and uploads it to the rolling `latest` release. It inlines +shellcheck, and publishes it as a release per version (tag `v`, +never overwritten; the newest is marked latest). It inlines `lib/*.sh` and wraps the entry point in `main()`, so bash has read the whole file before anything runs; when stdin is a pipe (`curl | bash`) it reattaches the terminal for the menu (set `WIZARD_KEEP_STDIN=1` to keep piped input). From b2858d3d60171704013495e47e132f7b0fe58763 Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Thu, 24 Sep 2026 10:08:22 +0200 Subject: [PATCH 2/3] docs: Versioning and release rules in AGENTS.md --- AGENTS.md | 17 ++++++++++++++--- CHANGELOG.md | 3 ++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 72ef0bd..5719eb1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -59,9 +59,20 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine - Comments explain *why* (the CachyOS/Plasma quirk being worked around), not what the next line does. -- **Versioning.** SemVer in `VERSION` (`setup-gamescope-boot.sh`, shown in - the menu header and the bundle). Every commit gets an entry in - `CHANGELOG.md` under its version; a new PR/branch bumps the version. +- **Versioning and releases.** SemVer in `VERSION` (`setup-gamescope-boot.sh`, + shown in the menu header and the bundle header). + - Every commit gets an entry in `CHANGELOG.md` under its version (short hash + + subject; a commit can't contain its own hash, so fill it in with the + next commit). The section heading must be `## - `: CI + cuts the release notes out of the changelog by that heading. + - Every PR that should be released bumps `VERSION` and adds its section. + A push to `main` publishes release `v$VERSION` (tag + bundle + that + changelog section) and marks it latest. An existing version is never + overwritten: without a bump nothing is released, and pull requests show + a warning. + - Users install through `releases/latest/download/setup-gamescope-boot.sh`, + which always resolves to the newest release. The old rolling `latest` tag + and release are from before 0.7.0 and are no longer updated. ## Non-obvious behaviour to preserve diff --git a/CHANGELOG.md b/CHANGELOG.md index a05ee36..4805eee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,12 +45,13 @@ Machine LED driver works on every installed kernel and survives kernel updates. `lib/state.sh`), which would have failed the CI check. - `d7231eb` **chore: Move the bundle tool to .github/tools/bundle.sh** - `5c00504` **docs: Commit hashes in the changelog** -- **ci: A release per version (tag v0.7.0, ...) instead of overwriting "latest"** +- `8aab946` **ci: A release per version (tag v0.7.0, ...) instead of overwriting "latest"** - Each push to `main` publishes release `v$VERSION` with that version's changelog; an already released version is never overwritten (pull requests get a warning when `VERSION` wasn't bumped). - Install with `.../releases/latest/download/setup-gamescope-boot.sh`, which always points to the newest release. +- **docs: Versioning and release rules in AGENTS.md** ## 0.6.2 - 2026-09-23 From b306a72255006ed644da1b7d23424d265d25672c Mon Sep 17 00:00:00 2001 From: Rick Peters Date: Thu, 24 Sep 2026 10:09:26 +0200 Subject: [PATCH 3/3] ci: The latest tag follows the newest version tag When v$VERSION is released, move the latest tag and release to it and replace its bundle, so the older install URL keeps giving the newest version. --- .github/workflows/bundle.yml | 16 +++++++++++++++- AGENTS.md | 7 ++++--- CHANGELOG.md | 6 +++++- README.md | 3 ++- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index f014143..1fc7a7b 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -1,8 +1,10 @@ # Builds the single-file wizard (.github/tools/bundle.sh) and publishes it as a # release per version: tag v$VERSION (VERSION in setup-gamescope-boot.sh), # with that version's CHANGELOG.md section as notes. A released version is -# never overwritten; the newest one is marked latest, so this always gets it: +# never overwritten; the newest one is marked latest, and the "latest" tag and +# release are moved to it, so both of these always get the newest version: # curl -fsSL https://github.com/theupriser/cachyos-gamescope-boot/releases/latest/download/setup-gamescope-boot.sh | bash +# curl -fsSL https://github.com/theupriser/cachyos-gamescope-boot/releases/download/latest/setup-gamescope-boot.sh | bash # Pull requests only build and check it, and warn when VERSION is already released. name: Single-file build @@ -72,3 +74,15 @@ jobs: $changes" gh release create "v$VERSION" dist/setup-gamescope-boot.sh \ --target "$GITHUB_SHA" --title "v$VERSION" --notes "$notes" --latest + + # "latest" follows the newest version tag, for the older install URL + # (.../releases/download/latest/...). Only moved when a new version + # is released, never for a push without a VERSION bump. + git tag -f latest "$GITHUB_SHA" && git push -f origin latest + latest_notes="Always the newest version, currently v$VERSION (see its release for the changes)." + if gh release view latest >/dev/null 2>&1; then + gh release edit latest --title "Latest (v$VERSION)" --notes "$latest_notes" --latest=false + else + gh release create latest --title "Latest (v$VERSION)" --notes "$latest_notes" --latest=false + fi + gh release upload latest dist/setup-gamescope-boot.sh --clobber diff --git a/AGENTS.md b/AGENTS.md index 5719eb1..80da0f5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -70,9 +70,10 @@ gamescope and the Plasma desktop. Primary target: the Valve Steam Machine changelog section) and marks it latest. An existing version is never overwritten: without a bump nothing is released, and pull requests show a warning. - - Users install through `releases/latest/download/setup-gamescope-boot.sh`, - which always resolves to the newest release. The old rolling `latest` tag - and release are from before 0.7.0 and are no longer updated. + - Users install through `releases/latest/download/setup-gamescope-boot.sh` + (GitHub's newest release). The `latest` tag and release follow the newest + version tag too (moved, asset replaced, when a new version is released), + so the older URL `releases/download/latest/...` keeps working. ## Non-obvious behaviour to preserve diff --git a/CHANGELOG.md b/CHANGELOG.md index 4805eee..39bb60e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,7 +51,11 @@ Machine LED driver works on every installed kernel and survives kernel updates. get a warning when `VERSION` wasn't bumped). - Install with `.../releases/latest/download/setup-gamescope-boot.sh`, which always points to the newest release. -- **docs: Versioning and release rules in AGENTS.md** +- `1604ed1` **docs: Versioning and release rules in AGENTS.md** +- **ci: The latest tag follows the newest version tag** + - When a new version is released, the `latest` tag and release move to it + (bundle replaced), so the older `.../releases/download/latest/...` URL + also always gives the newest version. ## 0.6.2 - 2026-09-23 diff --git a/README.md b/README.md index 9955aa8..215d969 100644 --- a/README.md +++ b/README.md @@ -335,7 +335,8 @@ gamescope-session, ...) stay installed. The single-file version is generated: on every push to `main`, GitHub Actions runs `.github/tools/bundle.sh`, checks the result with `bash -n` and shellcheck, and publishes it as a release per version (tag `v`, -never overwritten; the newest is marked latest). It inlines +never overwritten; the newest is marked latest, and the `latest` tag follows +it). It inlines `lib/*.sh` and wraps the entry point in `main()`, so bash has read the whole file before anything runs; when stdin is a pipe (`curl | bash`) it reattaches the terminal for the menu (set `WIZARD_KEEP_STDIN=1` to keep piped input).