Skip to content

ci: auto-tag a greater Version on main - #2

Merged
piranout merged 4 commits into
mainfrom
cursor/auto-tag-on-version-e669
Aug 21, 2026
Merged

ci: auto-tag a greater Version on main#2
piranout merged 4 commits into
mainfrom
cursor/auto-tag-on-version-e669

Conversation

@piranout

@piranout piranout commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

PR #1 merged 0.8.1-beta1 to main and CI is green, but the latest GitHub release/tag is still v0.8.0-beta1. release.yml only runs on v* tags (and workflow_dispatch). The merge bumped Version and never pushed a tag, so Release never ran.

What

On push to main only (not PRs):

  1. Tag version (.github/workflows/tag-version.yml) reads <Version> from src/Aperture.App/Aperture.App.csproj (falls back to Directory.Build.props if the csproj has none).
  2. Compares it to existing v* tags using the same SemVer rules as the in-app updater (UpdateVersion — prerelease suffixes matter). Shared decision logic is ReleaseTag.cs; the tag job runs a thin scripts/DecideReleaseTag helper that compiles those same sources.
  3. If the landed version is greater and v{version} does not exist, it creates and pushes that tag (never force-pushes). Equal or lower versions are left untagged.
  4. A GITHUB_TOKEN tag push does not start other workflows, so the tag job then calls the existing release.yml (workflow_call, secrets: inherit). Signing/publish is unchanged and not duplicated.

docs/GITHUB-SETUP.md “Cutting a release” is now: bump Version + CHANGELOG on main; the tag is automatic. Manual git tag / workflow_dispatch stay as fallbacks.

Signing vs Markdown Midget (verified, no secret values)

Diffed Aperture .github/workflows/release.yml signing steps against published Markdown Midget release.yml. Identity still matches. Aperture did not drift. Signing YAML on this branch is identical to main (this PR only added workflow_call so the tag job can invoke it).

Aperture Markdown Midget
Secrets AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET same names
Account func-az-artifact-signing same
Profile funcular-labs-public-trust same
Endpoint https://cus.codesigning.azure.net/ same
Tool azuretrustedsigntool sign + Windows SDK signtool.exe same
Description Aperture Image Viewer Markdown Midget (the only intended product difference)
Fail-fast if secrets missing kept (Aperture-only; missing secrets used to hang ~20 min) Midget’s published YAML does not have this step

No new cert, key, or SP. The auto-tag job does not sign and does not bypass Release.

Org secret repository-allowlists cannot be read from this repo. The YAML is correct. The last published asset Aperture-v0.8.0-beta1-win-x64.exe was uploaded by github-actions[bot]; that Release run’s Check signing secrets are present, Sign the exe (Azure Trusted Signing), and Verify Authenticode signature steps all succeeded — so the allowlist was working then.

First ship of 0.8.1-beta1

Do not tag from this PR. After this merges, Tag version runs on that main push, sees 0.8.1-beta1 > v0.8.0-beta1, and should create v0.8.1-beta1 and invoke the same signed Release job.

How to test

  1. CI on this PR: dotnet test includes the new ReleaseTagTests; the extra “Release-tag helper” step must print should_tag=true / tag=v0.8.1-beta1 against a fake v0.8.0-beta1 list.
  2. After merge: Actions → Tag version should push v0.8.1-beta1 and start Release (signed exe + prerelease).
  3. A later main push that does not raise Version must not create or move a tag.

Permissions

  • Tag job: contents: write only (create/push the tag).
  • The reusable Release job keeps contents: write so it can still create the GitHub release (same as today’s tag-triggered run).
  • No secrets in the tree; repo visibility unchanged.
Open in Web Open in Cursor 

cursoragent and others added 4 commits August 21, 2026 19:58
Push to main reads Version from the app csproj (Directory.Build.props
fallback) and compares it to existing v* tags with the same SemVer rules
as the in-app updater. If the landed version is greater and v{version}
does not exist, push that tag and invoke the existing signed Release
workflow. Equal or lower versions are left untagged; tags are never
force-pushed.

Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
Signing steps in release.yml were unchanged and still match Markdown
Midget (same AZURE_* secrets, account, profile, endpoint). Keep the
Aperture fail-fast secret check. Tag version only creates the tag and
calls Release with secrets: inherit.

Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
dotnet run forwarded --nologo to the helper, which treats unknown
args as fatal. Drop the flag from CI and the tag job.

Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
dotnet run emits one line per WriteLine; assigning that to $out makes
an array, and -notmatch then filters lines (truthy leftover) instead of
searching the whole log. Out-String first.

Co-authored-by: Paul Smith <piranout@users.noreply.github.com>
@piranout
piranout marked this pull request as ready for review August 21, 2026 20:07
@piranout
piranout merged commit 6b21c3c into main Aug 21, 2026
1 check passed
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.

2 participants