Skip to content

ci: test pull requests and release main with semantic-release - #1

Merged
M4n0x merged 4 commits into
mainfrom
ci/test-and-release
Oct 15, 2026
Merged

M4n0x merged 4 commits into
mainfrom
ci/test-and-release

Conversation

@M4n0x

@M4n0x M4n0x commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix the build. main doesn't compile with Swift 6.2 (Xcode 26.3). WidgetPopup.swift mixes Double and CGFloat in min(...), and the compiler reports ambiguous use of operator '-' plus 7 follow-on errors. The popup inset and width are now converted to CGFloat explicitly.
  • CI (.github/workflows/ci.yml):
    • Test runs on macos-26 for every PR and every push to main: swift build --build-tests, then swift test.
    • Commit messages runs on PRs only. commitlint checks every commit and the PR title against Conventional Commits.
    • Release runs on main after the tests pass. semantic-release sets the version in Resources/Info.plist, updates CHANGELOG.md, commits both as chore(release): x.y.z [skip ci], tags vx.y.z and publishes the notes as a GitHub release. It only uses the workflow's GITHUB_TOKEN, so no secrets are needed.
  • scripts/set-version.sh sets CFBundleShortVersionString and CFBundleVersion without reformatting the plist, and fails without writing anything if a key is missing. It has Swift tests in ReleaseTests.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, change prepareCmd to ./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 HOME pointed at an empty directory, all 20 tests pass. With my normal shell profile, scriptRecoversAfterACommandFailure fails (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 containing CHANGELOG.md and a two-line Info.plist change, and a v0.1.1 tag. The rehearsal caught that conventional-changelog-conventionalcommits@10 can'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 signatures all pass.

Notes

  • scriptRecoversAfterACommandFailure polls for at most ~2 s, but it needs two /bin/zsh -lc runs. When ~/.zprofile is 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 audit reports 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 in braces and micromatch, which have no patched release yet. These are CI-only dev dependencies that only process this repo's own commits and config.

Steve Reis added 4 commits October 15, 2026 15:24
Swift 6.2 (Xcode 26.3) rejects the mixed Double/CGFloat arithmetic in
WidgetPopup.toggle as ambiguous, so the package and its tests no longer
compiled. Convert the popup's shadow inset and width to CGFloat
explicitly.
scripts/set-version.sh writes a version to CFBundleShortVersionString
and CFBundleVersion in Resources/Info.plist, or in the plist given as
its second argument. It edits the values in place to keep the file's
layout, and leaves the file untouched when either key is missing.
Pull requests and pushes to main build and test the package on macOS.
Pull requests also lint their commit messages and title with
commitlint.

After the tests pass on main, semantic-release derives the next version
from the conventional commits, sets it in Info.plist, updates
CHANGELOG.md, tags the release and publishes its notes on GitHub, using
only the workflow's GITHUB_TOKEN.
@M4n0x
M4n0x force-pushed the ci/test-and-release branch from 66fb157 to 84af68d Compare October 15, 2026 13:26
@M4n0x
M4n0x merged commit 21e80e7 into main Oct 15, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.1.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant