A set of semantic-release scripts that allow publishing of prerelease versions behind dist-tags.
Перейти к файлу
Tsvetomir Tsonev dcb4a027ca chore: read secrets from Akeyeless 2023-05-18 18:26:29 +03:00
.github/workflows chore: read secrets from Akeyeless 2023-05-18 18:26:29 +03:00
bin fix: change package scope to @progress 2022-06-02 16:36:52 +03:00
.eslintrc.js refactor: update eslint 2022-06-02 16:36:52 +03:00
.gitignore initial commit 2017-05-18 14:55:52 +03:00
.npmignore chore: add .npmignore 2022-06-02 16:36:52 +03:00
LICENSE.md fix: add license 2022-06-06 15:42:31 +03:00
README.md fix: change package scope to @progress 2022-06-02 16:36:52 +03:00
analyzeCommits.js chore: change parameters 2019-10-28 11:23:24 +02:00
condition-github-actions.js refactor: update eslint 2022-06-02 16:36:52 +03: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 feat: drop support for Travis CI and Jenkins 2022-06-02 16:36:52 +03:00
utils.js chore: change parameters 2019-10-28 11:23:24 +02:00
validateConfig.js fix: change package scope to @progress 2022-06-02 16:36:52 +03:00
verifyConditions.js feat: drop support for Travis CI and Jenkins 2022-06-02 16:36:52 +03:00
verifyRelease.js refactor: update eslint 2022-06-02 16:36:52 +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 6.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 @progress/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": "@progress/semantic-prerelease/analyzeCommits",
       "generateNotes": "@progress/semantic-prerelease/generateNotes",
       "getLastRelease": "@progress/semantic-prerelease/getLastRelease",
       "verifyConditions": "@progress/semantic-prerelease/verifyConditions",
       "verifyRelease": "@progress/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