-
Notifications
You must be signed in to change notification settings - Fork 95
fix(ci): pin semantic-release tooling and restore v0.95.0 and v0.95.1 notes #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
andrew-coleman
merged 4 commits into
substrait-io:main
from
nielspardon:semantic-release-fix
Jul 17, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a44e1d2
fix(ci): pin semantic-release tooling and restore v0.95.0 notes
nielspardon e5c53da
fix(ci): pin changelog plugin to stable 6.0.3 and document release co…
nielspardon 63ffdbd
Merge remote-tracking branch 'upstream/main' into semantic-release-fix
nielspardon 376db89
fix(ci): strip Mentored-by trailer from release notes
nielspardon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| // semantic-release configuration. | ||
| // | ||
| // This is an ESM (.mjs) config rather than .releaserc.json because the | ||
| // release-notes-generator needs a `writerOpts.transform` function to strip git | ||
| // trailers (e.g. `Signed-off-by:`) that the conventional-commits parser folds | ||
| // into `BREAKING CHANGE` notes. JSON cannot carry functions. | ||
| // | ||
| // This config defaults to a dry run as a fail-safe: the publishing plugins | ||
| // (@semantic-release/github, @semantic-release/git) and the exec verify/publish | ||
| // commands are only included when RELEASE_DRY_RUN=false. ci/release/run.sh opts | ||
| // in to a real release that way; every other invocation -- including a typo'd or | ||
| // forgotten env var -- stays harmless. | ||
| // | ||
| // The env var is needed on top of --dry-run because --dry-run alone is not | ||
| // enough: semantic-release still runs every plugin's verifyConditions step in | ||
| // dry-run mode (it skips only prepare, publish, addChannel, success and fail). | ||
| // @semantic-release/github's verifyConditions fails without a GITHUB_TOKEN, so | ||
| // the side-effecting plugins must be omitted entirely, not merely guarded by | ||
| // --dry-run, to allow a credential-free dry run. | ||
|
|
||
| import { createRequire } from "node:module"; | ||
| import { pathToFileURL } from "node:url"; | ||
|
|
||
| // Load the conventionalcommits preset. The release scripts run semantic-release | ||
| // via `npx -p ...`, which installs the preset alongside semantic-release in a | ||
| // temporary node_modules. A bare `import` here would resolve relative to this | ||
| // config file's directory (the repo, which has no node_modules) and fail, so | ||
| // fall back to resolving the preset relative to the running semantic-release | ||
| // binary (process.argv[1]). The plain import still covers local dev where the | ||
| // preset is installed alongside the project. | ||
| const loadPreset = async () => { | ||
| try { | ||
| return (await import("conventional-changelog-conventionalcommits")).default; | ||
| } catch { | ||
| const require = createRequire(pathToFileURL(process.argv[1])); | ||
| const resolved = pathToFileURL( | ||
| require.resolve("conventional-changelog-conventionalcommits") | ||
| ).href; | ||
| return (await import(resolved)).default; | ||
| } | ||
| }; | ||
| const conventionalcommits = await loadPreset(); | ||
|
|
||
| // Git trailers that should never appear in the changelog or release notes. | ||
| const TRAILER_KEYS = [ | ||
| "Signed-off-by", | ||
| "Co-authored-by", | ||
| "Co-developed-by", | ||
| "Reviewed-by", | ||
| "Acked-by", | ||
| "Tested-by", | ||
| "Reported-by", | ||
| "Suggested-by", | ||
| "Helped-by", | ||
| "Mentored-by", | ||
| "Cc", | ||
| ]; | ||
|
nielspardon marked this conversation as resolved.
|
||
| const TRAILER = new RegExp(`^(?:${TRAILER_KEYS.join("|")}):\\s`, "i"); | ||
|
|
||
| // The conventional-commits parser ends a BREAKING CHANGE note only at a | ||
| // recognized reference (closes #..., fixes #...) or another note keyword, not | ||
| // at a git trailer -- so a trailing `Signed-off-by:` gets absorbed into the | ||
| // note text. Strip such trailing trailer lines. | ||
| const stripTrailers = (text) => { | ||
| if (!text) { | ||
| return text; | ||
| } | ||
|
|
||
| const lines = text.split("\n"); | ||
| while (lines.length) { | ||
| const last = lines[lines.length - 1].trim(); | ||
| if (last === "" || TRAILER.test(last)) { | ||
| lines.pop(); | ||
| } else { | ||
| break; | ||
| } | ||
| } | ||
| return lines.join("\n"); | ||
| }; | ||
|
|
||
| const preset = await conventionalcommits(); | ||
| const presetTransform = preset.writer.transform; | ||
| const dryRun = process.env.RELEASE_DRY_RUN !== "false"; | ||
|
|
||
| export default { | ||
| branches: [ | ||
| { name: "+([0-9])?(.{+([0-9]),x}).x" }, | ||
| { name: "main" }, | ||
| { name: "next" }, | ||
| { name: "next-major" }, | ||
| { name: "beta", prerelease: true }, | ||
| { name: "alpha", prerelease: true }, | ||
| ], | ||
| preset: "conventionalcommits", | ||
| dryRun, | ||
| plugins: [ | ||
| [ | ||
| "@semantic-release/release-notes-generator", | ||
| { | ||
| // Only `transform` is overridden; the generator merges this over the | ||
| // preset's writer options, so templates/grouping/sorting are kept. | ||
| writerOpts: { | ||
| transform(commit, context) { | ||
| const out = presetTransform(commit, context); | ||
| if (out && Array.isArray(out.notes)) { | ||
| out.notes = out.notes.map((note) => ({ | ||
| ...note, | ||
| text: stripTrailers(note.text), | ||
| })); | ||
| } | ||
| return out; | ||
| }, | ||
| }, | ||
| }, | ||
| ], | ||
| [ | ||
| "@semantic-release/commit-analyzer", | ||
| { | ||
| releaseRules: [{ breaking: true, release: "minor" }], | ||
| }, | ||
| ], | ||
| [ | ||
| "@semantic-release/exec", | ||
| dryRun | ||
| ? {} | ||
| : { | ||
| verifyConditionsCmd: "ci/release/verify.sh", | ||
| prepareCmd: "ci/release/prepare.sh ${nextRelease.version}", | ||
| publishCmd: "ci/release/publish.sh", | ||
| }, | ||
| ], | ||
| [ | ||
| "@semantic-release/changelog", | ||
| { | ||
| changelogTitle: "Release Notes\n---", | ||
| changelogFile: "CHANGELOG.md", | ||
| }, | ||
| ], | ||
| ...(dryRun | ||
| ? [] | ||
| : [ | ||
| [ | ||
| "@semantic-release/github", | ||
| { | ||
| assets: [ | ||
| { | ||
| path: "native/libs/isthmus-macOS-latest", | ||
| name: "isthmus-macOS-${nextRelease.version}", | ||
| label: "Isthmus Native Image - macOS", | ||
| }, | ||
| { | ||
| path: "native/libs/isthmus-ubuntu-latest", | ||
| name: "isthmus-ubuntu-${nextRelease.version}", | ||
| label: "Isthmus Native Image - Linux", | ||
| }, | ||
| ], | ||
| successComment: false, | ||
| }, | ||
| ], | ||
| [ | ||
| "@semantic-release/git", | ||
| { | ||
| assets: ["gradle.properties", "CHANGELOG.md"], | ||
| message: "chore(release): ${nextRelease.version}", | ||
| }, | ||
| ], | ||
| ]), | ||
| ], | ||
| }; | ||
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.