Skip to content

Auto-bump README DMG link on app releases#5

Merged
bootuz merged 1 commit into
mainfrom
ci/auto-bump-readme-dmg-link
May 23, 2026
Merged

Auto-bump README DMG link on app releases#5
bootuz merged 1 commit into
mainfrom
ci/auto-bump-readme-dmg-link

Conversation

@bootuz
Copy link
Copy Markdown
Owner

@bootuz bootuz commented May 23, 2026

Summary

Each `app-v*` tag now bumps the README's DMG download link to the freshly-released version automatically. No more hand-editing the link on every release.

How it works

A marker block in the README:

```html

Download the latest DMG: Keywordista-X.Y.Z.dmg (signed + notarized). …

```

After the `Create GitHub Release` step lands the DMG + checksum, a new `Bump README DMG link to this release` step:

  1. Switches from the tag-detached HEAD to a fresh `main`.
  2. Splices the canonical block between the LATEST_DMG markers via `awk` (portable across BSD and GNU; sed's multi-line handling differs).
  3. Commits + pushes to `main` as `github-actions[bot]`. Idempotent — if the block already matches the released version (re-runs, manual triggers, etc.), no commit lands.

The PR also restores the DMG section to the README's Install block (pointing at the current 0.1.0 release) so the marker block has a body to operate on — and so the public README has a usable download link from day one.

Safety

  • Manual dry runs are noop on main. The step is gated on `github.event_name == 'push'`; `workflow_dispatch` exercises the build but not the README bump.
  • No CI feedback loop. The bot commit only touches `README.md`, which matches the `paths-ignore: '**/*.md'` rule landed in PR Skip CI on docs-only / gitignore-only changes #3. `[skip ci]` in the commit message is belt-and-suspenders.
  • Idempotent. Verified locally with both v0.2.0 (new version → splices correctly) and v0.1.0 (existing version → `diff` produces no output → exit 0 with no commit).
  • `contents: write` permission already on the job (used by `gh release create`).

Test plan

  • Reviewer: merge this, then cut `app-v0.2.0` (or higher) as a test. Expect the workflow to land a follow-up commit on `main` titled `README: bump DMG download link to v0.2.0 [skip ci]`, and the README link in the diff to swap from `app-v0.1.0` to `app-v0.2.0`.
  • Local awk smoke test: `VERSION=0.2.0` produces the expected splice; `VERSION=0.1.0` (current state) produces an identical file → no-op commit.

Each app-v* tag now triggers a step in release-app.yml that, after the
DMG is signed + notarized + uploaded to GitHub Releases, rewrites a
marker block in README.md so the public download link always points at
the freshly-released version. The marker:

  <!-- LATEST_DMG_BEGIN -->
  …auto-generated link block…
  <!-- LATEST_DMG_END -->

awk does the multi-line splice (sed -i differs between BSD and GNU);
idempotent — if the marker block already matches the new version, no
commit lands. Push to origin/main is gated on github.event_name=='push'
so manual workflow_dispatch dry-runs never mutate main.

The CI `paths-ignore: '**/*.md'` rule means the bot commit doesn't
re-trigger the pipeline; `[skip ci]` in the commit message is
belt-and-suspenders.

Also restores the DMG download line in the Install section (pointing
at the current 0.1.0 release) so the marker block has a body to
operate on. Future app releases bump just the version inside.
@bootuz bootuz merged commit f27d7e6 into main May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant