Repository navigation
ci(release): release on every merge to main with semantic-release - #2
Merged
Merged
Conversation
Pushes to main run semantic-release (.releaserc.json, same rules as LinkForty Core). When the conventional commits since the last tag warrant a release, it writes the version into linkforty.php and readme.txt (scripts/set-version.sh), prepends CHANGELOG.md, builds the zip, commits `chore(release): x.y.z [skip ci]`, tags vx.y.z and publishes a GitHub release with the zip attached. Below 1.0 a breaking change bumps the minor version. This also sets 0.2.0 for the purchase-revenue fix already on main, which landed without a release; v0.2.0 is tagged on this merge so semantic-release starts from it. CONTRIBUTING.md and the pull request template now say the PR title is the release commit and that nobody edits the changelog or the version by hand.
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.
Description
Every merge to
mainnow releases when its commits call for one, the same way LinkForty Core does..github/workflows/release.ymlruns on push tomaininstead of on a tag. It lints, runs phpcs, thennpx semantic-release..releaserc.jsonuses Core's rules:feat→ minor;fix/docs/refactor/perf/revert→ patch;chore/test/ci/build→ none. One difference: a breaking change bumps the minor version while the plugin is below 1.0 (semver allows this for 0.x). At 1.0, change that rule tomajor.scripts/set-version.shwrites the version into the plugin header, theLINKFORTY_VERSIONconstant andreadme.txt'sStable tag. It exits non-zero if any of the three doesn't match.@semantic-release/changelogprepends the release notes toCHANGELOG.md.composer buildmakeslinkforty-x.y.z.zip.@semantic-release/gitcommitschore(release): x.y.z [skip ci].@semantic-release/githubtagsvx.y.zand publishes the release with the zip attached.package.jsonis private and holds the release tooling only. It,package-lock.json,.releaserc.jsonandscripts/are added to.distignore, so the zip is unchanged (checked withcomposer build).CONTRIBUTING.mdand the PR template now say:!and aBREAKING CHANGE:note.CHANGELOG.mdor the version by hand.Catching up 0.2.0
PR #1 (purchase revenue,
begin_checkout→cart_total) was merged without a release, and its commit isn't conventional, so semantic-release wouldn't release it. This PR sets 0.2.0 by hand: the header, the constant,Stable tag, and## [0.2.0]in the changelog. After merging, tag the merge commitv0.2.0and publish that release once by hand. semantic-release then counts from v0.2.0.Use a squash merge so the title above is the commit on
main. It's aci:commit, so the release job runs and correctly releases nothing.Type of change
Testing
scripts/set-version.sh 9.8.7writes all three places;scripts/set-version.sh nopeexits 1npx semantic-release --dry-runon this branch findsv0.1.0, analyzes the 4 commits since it, and reports no release (none arefeat/fix), as expectedcomposer buildzip contains only the plugin filescomposer lintandcomposer phpcspass; the CI header check passes at 0.2.0Checklist
readme.txtunchanged (no setting, event or hook changed)