A set of scripts for semantic-release that allow publishing of prerelease versions from branches.
This projects allows you to push prerelease package versions to NPM, hidden behind a dist-tag, and trigger deployments by fast-forwarding a release branch.
-
Install the node module through the following command:
npm install --save-dev @telerik/semantic-prerelease
-
Describe the branches that will publish prerelease versions. In this example, commits in the
develop
branch pushes prerelease versions to thedev
dist-tag. UsefallbackTags
to bootstrap the versions.// package.json "release": { "branchTags": { "develop": "dev" }, "fallbackTags": { "dev": "latest" } }
-
Configure semantic-release to use the included plug-ins:
// package.json "release": { "analyzeCommits": "@telerik/semantic-prerelease/analyzeCommits", "getLastRelease": "@telerik/semantic-prerelease/getLastRelease", "verifyConditions": "@telerik/semantic-prerelease/verifyConditions", "verifyRelease": "@telerik/semantic-prerelease/verifyRelease" }
-
Use
semantic-prerelease publish
instead ofnpm publish
in the end of your build. This publishes the prerelease versions behind dist-tags.
With the above setup, new official releases (bearing the latest
dist-tag) can be published from master
by fast-forwarding it to develop
:
git checkout master && git merge --ff-only develop && git push