Repository navigation
✨ Add semantic_release.yml for per-directory version lines - #129
Merged
Merged
Conversation
kammce
force-pushed
the
semantic-release-lines
branch
2 times, most recently
from
October 16, 2026 23:22
82ef647 to
6bc9612
Compare
A reusable workflow that releases each version line of a repository (one
major version per directory, e.g. v4/ and v5/) independently. Callers
pass the lines as JSON: [{"major": 4, "dir": "v4"}, ...].
The version logic lives in .github/scripts/semantic_release.py, with
unit tests that build throwaway git repositories:
- A line only sees its own tags and only counts commits that change its
directory since its last release.
- (minor) and (patch) in a commit subject request a release. The highest
keyword since the last release wins. Commit bodies are ignored.
- (major) fails the run. Major versions are started by hand.
- A line with only <major>.0.0-alpha.K tags cuts the next alpha.
Self Check runs the tests and a dry run against this repository.
kammce
force-pushed
the
semantic-release-lines
branch
from
October 16, 2026 23:25
6bc9612 to
a27bf2d
Compare
This was referenced Oct 16, 2026
kammce
added a commit
that referenced
this pull request
Oct 17, 2026
Adds a semantic-release workflow for this repository, so ci releases are cut from commit subjects like every other libhal repository instead of by hand. It calls this repository's semantic_release.yml at the pushed commit, with one line for 5.x from the repository root. Merging this releases 5.25.0, the first release with semantic_release.yml (#129) and the reduced check runs (#130).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a reusable workflow that releases each version line of a repository independently. A version line is one major version living in its own directory, e.g.
v4/andv5/in libhal, orv5/andv6/in libhal-util.Usage
A single-directory repository uses one line with
"dir": ".".Rules
The version logic is in
.github/scripts/semantic_release.py:<major>.*) and only counts commits that change its directory since its last release. A commit that changes several directories counts for each of their lines.(minor)or(patch)in a commit subject asks for a release. The highest keyword since the last release wins, so several(patch)commits make one patch release. Commit bodies are ignored, so a squash merge's list of commits, or a message describing these rules (like this PR's own commit), doesn't count. Every intentional keyword in libhal, libhal-util, libhal-arm-mcu and ci history is in a subject line.(major): it fails the run. Major versions are started by hand: publish the line's first tag yourself and add the line tolines.<major>.0.0-alpha.Kcuts<major>.0.0-alpha.K+1on either keyword. Publishing<major>.0.0by hand switches it to normal releases.Because releases are computed from the last tag rather than from the commits in one push, a skipped or failed run is picked up by the next push.
Testing
test_semantic_release.py: 20 unit tests that build throwaway git repositories. Run them locally withpython3 -m unittest discover -s .github/scripts -p "test_*.py".Follow-ups
5.x.yincludes it.6.0.0-alpha.1, published by hand.