ci: test pull requests and release main with semantic-release
Merged
M4
16d ago+7061+7061+0123456789012345678901234567890123456789-2-2-0123456789
Summary
- Fix the build.
maindoesn't compile with Swift 6.2 (Xcode 26.3).WidgetPopup.swiftmixesDoubleandCGFloatinmin(...), and the compiler reportsambiguous use of operator '-'plus 7 follow-on errors. The popup inset and width are now converted toCGFloatexplicitly. - CI (
.github/workflows/ci.yml):- Test runs on
macos-26for every PR and every push tomain:swift build --build-tests, thenswift test. - Commit messages runs on PRs only. commitlint checks every commit and the PR title against Conventional Commits.
- Release runs on
mainafter the tests pass. semantic-release sets the version inResources/Info.plist, updatesCHANGELOG.md, commits both aschore(release): x.y.z [skip ci], tagsvx.y.zand publishes the notes as a GitHub release. It only uses the workflow'sGITHUB_TOKEN, so no secrets are needed.
- Test runs on
scripts/set-version.shsetsCFBundleShortVersionStringandCFBundleVersionwithout reformatting the plist, and fails without writing anything if a key is missing. It has Swift tests inReleaseTests.swift.- README gets a "Releases" section that explains which commit types trigger which release.
Versioning
With no tags, semantic-release would make its first release 1.0.0. I pushed a v0.1.0 tag on a405ed4 (the current main) to match Info.plist, so versions continue from there.
Merge this PR with a merge commit or rebase so the fix: commit survives. That makes the first automated release 0.1.1, which runs the whole pipeline once. A squash merge would use the ci: title and release nothing until the next feat/fix.
DMG (not included)
The DMG is being built separately. Two config changes will hook it into releases:
- In
.releaserc.json, changeprepareCmdto./scripts/set-version.sh ${nextRelease.version} && ./scripts/package.sh. - Change
"@semantic-release/github"to["@semantic-release/github", { "assets": [{ "path": "dist/StableBar.dmg" }] }].
The release job already runs on macOS, so no workflow change is needed.
Testing
- Clean build passes. With
HOMEpointed at an empty directory, all 20 tests pass. With my normal shell profile,scriptRecoversAfterACommandFailurefails (see Notes). - Full release rehearsal: a real (not dry-run) semantic-release run in a throwaway clone pushing to a local bare remote, with only the GitHub plugin disabled. Result: version 0.1.1, one
chore(release)commit containingCHANGELOG.mdand a two-lineInfo.plistchange, and av0.1.1tag. The rehearsal caught thatconventional-changelog-conventionalcommits@10can't render with the latest release-notes generator (writer 8), so the preset is pinned to^9.3.1. - actionlint, commitlint on these commits, and
npm audit signaturesall pass.
Notes
scriptRecoversAfterACommandFailurepolls for at most ~2 s, but it needs two/bin/zsh -lcruns. When~/.zprofileis slow (~1.3 s per login shell on my Mac), the second run doesn't finish in time. This predates this PR and is unchanged here. Raising the test's wait would fix it.npm auditreports advisories in semantic-release's dependency tree. Most are in the npm CLI bundled with its npm plugin, which this config doesn't load. The rest are DoS-type issues inbracesandmicromatch, which have no patched release yet. These are CI-only dev dependencies that only process this repo's own commits and config.