feat(ci): release notes are generated: the base version, Steamify's changelog section and the commits since the previous release; the mirror's release uses the same text

This commit is contained in:
theupriser committed 2026-09-30 13:20:22 +02:00
1 parent d077348ca2
commit acde716b86
3 files changed
+37 -11

No files matched your search

+24 -5
View File
@@ -38,6 +38,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Tag and release - name: Tag and release
env: env:
@@ -65,17 +67,34 @@ jobs:
# The ISO's file on the mirror is named after the tag (iso-2-gitea-build.yml, profiledef.sh), so its # The ISO's file on the mirror is named after the tag (iso-2-gitea-build.yml, profiledef.sh), so its
# download link is known now. # download link is known now.
file="steamify-cachyos-${tag#v}-x86_64.iso" dl="$GITEA_URL/$GITEA_REPO/releases/download/$tag" 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. # The notes are generated, nothing is written by hand:
section="$(awk '/^## CachyOS with Steamify Live ISO/ {found = 1; next} found && /^#/ {exit} found' CHANGELOG.md)" # - the CachyOS base version (first line of CHANGELOG.md, the fork's upstream changelog),
# - the Steamify version's own changelog section (steamify-cachyos CHANGELOG.md at the ref or tag it is built from),
# - this repository's commits since the previous release of the same kind.
base="$(head -n 1 CHANGELOG.md | sed 's/^# *//')"
steamify_notes="$(gh api "repos/theupriser/steamify-cachyos/contents/CHANGELOG.md?ref=${sref:-v$steamify}" -q .content 2> /dev/null | base64 -d 2> /dev/null |
awk -v v="$steamify" 'index($0, "## " v " ") == 1 {f = 1; next} f && /^## / {exit} f')"
[ "$kind" = release ] && want_pre=false || want_pre=true
prev="$(gh release list -L 50 --json tagName,isPrerelease,createdAt -q "[.[] | select(.isPrerelease == $want_pre and .tagName != \"$tag\")] | sort_by(.createdAt) | reverse | .[0].tagName // empty")"
if [ -n "$prev" ] && git rev-parse -q --verify "refs/tags/$prev" > /dev/null; then
changes="$(git log --no-merges --format='- %s' "$prev..HEAD" | head -n 40)"; since="since $prev"
else
changes="$(git log --no-merges --format='- %s' -n 15)"; since="(the latest commits: no earlier $kind release)"
fi
[ -n "$changes" ] || changes="- no changes since $prev"
notes="![ISO build](https://img.shields.io/badge/ISO_build-running-yellow) notes="![ISO build](https://img.shields.io/badge/ISO_build-running-yellow)
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): CachyOS $base with Steamify $steamify${sref:+ (branch $sref)} built in: install CachyOS and turn the PC into a Steam Machine in one go. Built from \`$(git rev-parse --short HEAD)\` (${{ github.ref_name }}) and published on the mirror (GitHub releases take at most 2 GB per file), about 20 minutes after this release:
**Download: [$file]($dl/$file)** ([SHA-256]($dl/$file.sha256), [release page]($GITEA_URL/$GITEA_REPO/releases/tag/$tag)) **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/${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/). ### Steamify $steamify
${steamify_notes:-No changelog section for this version.}
$section" ### Changes in this ISO $since
$changes
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/)."
# One ISO per day and kind: the newest build of a day replaces the earlier one (space), here and on the mirror. # One ISO per day and kind: the newest build of a day replaces the earlier one (space), here and on the mirror.
if git ls-remote --exit-code --tags origin "refs/tags/$tag" > /dev/null 2>&1 || gh release view "$tag" > /dev/null 2>&1; then if git ls-remote --exit-code --tags origin "refs/tags/$tag" > /dev/null 2>&1 || gh release view "$tag" > /dev/null 2>&1; then
echo "$tag exists: replacing it" echo "$tag exists: replacing it"
+8 -6
View File
@@ -173,15 +173,17 @@ jobs:
{ echo "publish=true"; echo "name=$name"; } >> "$GITHUB_OUTPUT" { echo "publish=true"; echo "name=$name"; } >> "$GITHUB_OUTPUT"
section="$(awk '/^## CachyOS with Steamify Live ISO/ {found = 1; next} found && /^#/ {exit} found' CHANGELOG.md)" section="$(awk '/^## CachyOS with Steamify Live ISO/ {found = 1; next} found && /^#/ {exit} found' CHANGELOG.md)"
src="${{ inputs.steamify_ref }}"; src="${src:-v$STEAMIFY_VERSION}" src="${{ inputs.steamify_ref }}"; src="${src:-v$STEAMIFY_VERSION}"
# The same notes as the GitHub release (one source: iso-1 generated them), without its badge line; the
# checksum line is added here. Fallback: a short text.
if curl -fsS "https://api.github.com/repos/theupriser/steamify-cachyos-live-iso/releases/tags/$tag" -o /tmp/ghrel.json; then
jq -r '.body // ""' /tmp/ghrel.json | sed '/ISO build\]/d' > release-notes.md
else
echo "Built from \`$(git rev-parse --short HEAD)\` ($tag) with Steamify $STEAMIFY_VERSION." > release-notes.md
fi
{ {
echo "Built from \`$(git rev-parse --short HEAD)\` ($tag) with Steamify $STEAMIFY_VERSION."
echo echo
echo "SHA-256: \`$(cut -d' ' -f1 "$iso.sha256")\`, label \`STEAMIFY_${STEAMIFY_VERSION//./_}_$b\`" echo "SHA-256: \`$(cut -d' ' -f1 "$iso.sha256")\`, label \`STEAMIFY_${STEAMIFY_VERSION//./_}_$b\`"
echo } >> release-notes.md
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
cat release-notes.md cat release-notes.md
- name: Publish ${{ github.ref_name }} - name: Publish ${{ github.ref_name }}
+5
View File
@@ -139,3 +139,8 @@ Full write-up, with every trap: `steamify-iso-release` in steamify-cachyos-dev.
iso-2's last job `report` (`if: always()`) replaces it with succeeded / failed / cancelled, linked to the Gitea run, iso-2's last job `report` (`if: always()`) replaces it with succeeded / failed / cancelled, linked to the Gitea run,
through the GitHub API with the Gitea secret `GH_RELEASE_TOKEN` (fine-grained, this repo, Contents read and write). through the GitHub API with the Gitea secret `GH_RELEASE_TOKEN` (fine-grained, this repo, Contents read and write).
Without the secret the badge stays "running". Gitea's own badge can't show these runs (they run on a tag ref). Without the secret the badge stays "running". Gitea's own badge can't show these runs (they run on a tag ref).
- **Release notes are generated, not written by hand** (iso-1): the CachyOS base version (first line of CHANGELOG.md), the
Steamify version's own changelog section (steamify-cachyos CHANGELOG.md at the ref or tag it is built from) and this
repository's commits since the previous release of the same kind (newest 40). iso-2 takes the same text from the GitHub
release for the mirror's release (one source), without the badge line, and adds the checksum line. The old hand-written
"## CachyOS with Steamify Live ISO" section in CHANGELOG.md is no longer used.