A set of semantic-release scripts that allow publishing of prerelease versions behind dist-tags.
Перейти к файлу
Tsvetomir Tsonev 4e42bab429
fix: do not require release script in package.json
2022-04-20 08:31:41 +03:00
.github/workflows chore: update publishing token name 2021-10-25 15:06:47 +03:00
bin chore: fix lint 2019-10-29 12:01:37 +02:00
.eslintrc initial commit 2017-05-18 14:55:52 +03:00
.gitignore initial commit 2017-05-18 14:55:52 +03:00
README.md doc: update README 2017-08-21 10:12:47 +03:00
analyzeCommits.js chore: change parameters 2019-10-28 11:23:24 +02:00
condition-github-actions.js fix: imports 2019-10-28 17:19:23 +02:00
generateNotes.js fix: fallback to last official tag for gitHead 2017-06-27 17:57:13 +03:00
getLastRelease.js fix(get-latest-release): allow using GIT_LOCAL_BRANCH on GH Actions 2021-03-05 08:53:59 +02:00
lastTag.js chore: ignore exit code instead of catching errors 2017-08-21 10:12:47 +03:00
package.json chore: add dev builds 2021-09-17 13:38:36 +03:00
utils.js chore: change parameters 2019-10-28 11:23:24 +02:00
validateConfig.js fix: do not require release script in package.json 2022-04-20 08:31:41 +03:00
verifyConditions.js fix (verify-conditions): allow using GIT_LOCAL_BRANCH on GH Actions 2021-03-05 10:12:30 +02:00
verifyRelease.js feat: start official releases in the 0.x range 2017-06-12 09:39:12 +03:00

README.md

semantic-prerelease

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.

Prerequisites

  • semantic-release 4.x+
  • git 2.13+ (used for tag parsing)

This project has been tested in Travis-CI and Jenkins builds.

Usage

  1. Install the node module through the following command:

    npm install --save-dev @telerik/semantic-prerelease
    
  2. Describe the branches that will publish prerelease versions. In this example, commits in the develop branch pushes prerelease versions to the dev dist-tag. Use fallbackTags to bootstrap the versions.

     // package.json
     "release": {
       "branchTags": {
         "develop": "dev"
       },
       "fallbackTags": {
         "dev": "latest"
       }
     }
    
  3. Configure semantic-release to use the included plug-ins:

     // package.json
     "release": {
       "analyzeCommits": "@telerik/semantic-prerelease/analyzeCommits",
       "generateNotes": "@telerik/semantic-prerelease/generateNotes",
       "getLastRelease": "@telerik/semantic-prerelease/getLastRelease",
       "verifyConditions": "@telerik/semantic-prerelease/verifyConditions",
       "verifyRelease": "@telerik/semantic-prerelease/verifyRelease"
     }
    
  4. Use semantic-prerelease publish instead of npm publish in the end of your build. This publishes the prerelease versions behind dist-tags.

  5. (Optionally) Publish scoped packages as public by using semantic-prerelease publish --public

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

Your first official release will be published with version 0.1.0 to enable automatic releases during initial development. You must mark a commit as a major release to bump the major version to 1. This is different than vanilla semantic-release where your first release is 1.0.0