diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46e392b..1ad8c6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,9 @@ concurrency: jobs: build: + # CachyOS's plain ISO and its quicktest matrix: only in CachyOS's own repo, not in this fork + # (the Steamify ISO is steamify-iso.yml). + if: github.repository == 'CachyOS/CachyOS-Live-ISO' runs-on: ubuntu-latest container: image: archlinux:base-devel diff --git a/.github/workflows/steamify-iso.yml b/.github/workflows/steamify-iso.yml index e9211e8..d4fb38f 100644 --- a/.github/workflows/steamify-iso.yml +++ b/.github/workflows/steamify-iso.yml @@ -1,6 +1,8 @@ # The Steamify ISO, built and released on the Gitea mirror (git.upriser.nl) by its own runner: the same -# build as by hand (the wsl-build-host skill in steamify-cachyos-dev), then a Gitea release v with the ISO, -# its checksums and package list, notes from CHANGELOG.md's Steamify section. GitHub skips it (one file +# build as by hand (the wsl-build-host skill in steamify-cachyos-dev), then a Gitea release with the ISO, +# its checksums and package list, notes from CHANGELOG.md's Steamify section. The ISO's version is the +# Steamify version on it plus the build date and time (UTC): master releases v--, +# feat/steamify a pre-release v-dev.-. Never overwritten. GitHub skips it (one file # for both servers; GitHub releases take at most 2 GB per file, the ISO is bigger). # The runner needs privileged containers (archiso mounts loop devices) and ~20 GB of disk; Gitea's # [attachment] MAX_SIZE must allow the ISO (default 2 GB). @@ -8,7 +10,7 @@ name: Steamify ISO (Gitea release) on: push: - branches: [feat/steamify] + branches: [master, feat/steamify] workflow_dispatch: concurrency: @@ -47,48 +49,49 @@ jobs: - name: Release name and notes id: rel + env: + TOKEN: ${{ github.token }} run: | iso="$(ls out/desktop/*.iso | head -n 1)" [ -f "$iso" ] || { echo "::error::no ISO in out/desktop"; exit 1; } date="$(basename "$iso" | grep -oE '[0-9]{4}\.[0-9]{2}\.[0-9]{2}')" steamify="$(sed -n 's/^VERSION=//p' archiso/airootfs/usr/local/share/steamify/steamify.sh | head -n 1)" - echo "tag=v$date" >> "$GITHUB_OUTPUT" - echo "date=$date" >> "$GITHUB_OUTPUT" - # The Steamify section of CHANGELOG.md ("## CachyOS with Steamify Live ISO ..."), without its heading. - section="$(awk '/^## CachyOS with Steamify Live ISO/ {found = 1; print; next} found && /^#/ {exit} found' CHANGELOG.md)" - title="$(head -n 1 <<< "$section" | sed 's/^## //')" - echo "title=$title" >> "$GITHUB_OUTPUT" + [ -n "$steamify" ] || { echo "::error::no Steamify version on the ISO"; exit 1; } + api="${{ github.server_url }}/api/v1/repos/${{ github.repository }}" + exists() { curl -fsS -o /dev/null -H "Authorization: token $TOKEN" "$api/releases/tags/$1"; } + stamp="$date-$(date -u +%H%M)" # the ISO's date, the time of this run (UTC): every build its own name + if [ "${{ github.ref }}" = refs/heads/master ]; then + tag="v$steamify-$stamp" prerelease=false name="CachyOS with Steamify Live ISO $steamify ($stamp UTC)" + else + tag="v$steamify-dev.$stamp" prerelease=true name="CachyOS with Steamify Live ISO $steamify (test build $stamp UTC)" + fi + # Never overwritten (a rerun in the same minute would find its tag taken). + if exists "$tag"; then + echo "::warning::$tag is already released and won't be overwritten." + echo "publish=false" >> "$GITHUB_OUTPUT"; exit 0 + fi + { echo "publish=true"; echo "tag=$tag"; echo "prerelease=$prerelease"; echo "name=$name"; } >> "$GITHUB_OUTPUT" + # 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)" { - echo "Built $(date -u '+%F %H:%M UTC') from \`$(git rev-parse --short HEAD)\` (feat/steamify), with Steamify $steamify." + echo "Built $(date -u '+%F %H:%M UTC') from \`$(git rev-parse --short HEAD)\` (${{ github.ref_name }}), with Steamify $steamify." echo echo "SHA-256: \`$(cut -d' ' -f1 "$iso.sha256")\`" echo - tail -n +2 <<< "$section" + echo "$section" } > release-notes.md cat release-notes.md - # One release per day: a rebuild on the same day replaces that day's release (and its tag). - - name: Replace today's release - env: - TOKEN: ${{ github.token }} - TAG: ${{ steps.rel.outputs.tag }} - run: | - api="${{ github.server_url }}/api/v1/repos/${{ github.repository }}" - if curl -fsS -H "Authorization: token $TOKEN" "$api/releases/tags/$TAG" -o /tmp/rel.json; then - curl -fsS -X DELETE -H "Authorization: token $TOKEN" "$api/releases/$(jq -r .id /tmp/rel.json)" - curl -fsS -X DELETE -H "Authorization: token $TOKEN" "$api/tags/$TAG" || true - echo "Replaced the release $TAG" - fi - - name: Publish ${{ steps.rel.outputs.tag }} + if: steps.rel.outputs.publish == 'true' uses: akkuman/gitea-release-action@v1.3.7 with: token: ${{ github.token }} tag_name: ${{ steps.rel.outputs.tag }} target_commitish: ${{ github.sha }} - name: ${{ steps.rel.outputs.title }} (${{ steps.rel.outputs.date }}) + name: ${{ steps.rel.outputs.name }} body_path: release-notes.md - prerelease: true + prerelease: ${{ steps.rel.outputs.prerelease }} files: | out/desktop/*.iso out/desktop/*.iso.sha256 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d28ba8..25c32e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,8 +26,9 @@ * Correctly handle VM environments * Correctly quote pacman arguments -## CachyOS with Steamify Live ISO 1.0.0 (unreleased) +## CachyOS with Steamify Live ISO CachyOS 26.08 with Steamify built in: install CachyOS and turn the PC into a Steam Machine in one go. +Its version is the Steamify version on it plus the build date and time (a release on `master` is `v--`, e.g. `v2.9.1-2026.09.29-1432`). **Features:**