From e24c81dcc63f5c5fadf6c0579eb33322752b188a Mon Sep 17 00:00:00 2001 From: rickpeters Date: Tue, 29 Sep 2026 20:29:19 +0200 Subject: [PATCH] feat(ci): a Gitea mirror publishes its own release per version (never overwrites one, notes from the changelog) --- .github/workflows/bundle.yml | 58 ++++++++++++++++++++++++++++++++++++ CHANGELOG.md | 1 + 2 files changed, 59 insertions(+) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 90c2d9d..9d9e813 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -133,3 +133,61 @@ jobs: gh release create latest --title "Steamify CachyOS - latest (v$VERSION)" --notes "$latest_notes" --latest=false fi gh release upload latest dist/steamify.sh dist/steamify-app.sh dist/steamify-app.tar.gz assets/steam-gaming-settings.svg --clobber + + # The mirror (Gitea) publishes its own release per version too, the same way: never overwrites one, + # notes from the changelog. gh can't talk to Gitea: its API for the check, a Gitea release action to + # publish. The token is the run's own (repository write); a secret RELEASE_TOKEN overrides it. + - name: Version (mirror) + id: mirror_version + if: github.server_url != 'https://github.com' + env: + TOKEN: ${{ secrets.RELEASE_TOKEN || github.token }} + run: | + version="$(grep -oP '^VERSION=\K.*' steamify.sh)" + echo "version=$version" >> "$GITHUB_OUTPUT" + if curl -fsS -o /dev/null -H "Authorization: token $TOKEN" \ + "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/tags/v$version"; then + echo "released=true" >> "$GITHUB_OUTPUT" + echo "::warning::v$version is already released on this server and won't be overwritten." + else + echo "released=false" >> "$GITHUB_OUTPUT" + fi + + - name: Release notes (mirror) + if: >- + github.server_url != 'https://github.com' && + github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && + steps.mirror_version.outputs.released == 'false' + env: + VERSION: ${{ steps.mirror_version.outputs.version }} + run: | + changes="$(awk -v v="$VERSION" ' + $0 ~ "^## " { if (found) exit; if (index($0, "## " v " ") == 1) { found = 1; next } } + found' CHANGELOG.md)" + cat > dist/release-notes.md <- + github.server_url != 'https://github.com' && + github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && + steps.mirror_version.outputs.released == 'false' + uses: akkuman/gitea-release-action@v1.3.7 + with: + token: ${{ secrets.RELEASE_TOKEN || github.token }} + tag_name: v${{ steps.mirror_version.outputs.version }} + target_commitish: ${{ github.sha }} + name: Steamify CachyOS v${{ steps.mirror_version.outputs.version }} + body_path: dist/release-notes.md + files: | + dist/steamify.sh + dist/steamify-app.sh + dist/steamify-app.tar.gz + assets/steam-gaming-settings.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index 249bfee..816c92e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ one per merged pull request. ## 2.9.2 - 2026-09-29 +- **feat(ci): a Gitea mirror publishes its own release per version (akkuman/gitea-release-action; never overwrites one, notes from the changelog, links to the mirror)** - **fix(ci): the build also runs on a Gitea mirror (act_runner): shellcheck through ludeeus/action-shellcheck, which brings its own binary; the artifact goes up there with christopherhx/gitea-upload-artifact (GitHub refuses a workflow that mentions the deprecated upload-artifact@v3); releases are only published on GitHub** - `fe4f3f4` **chore: Version 2.9.2**