5
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2025-11-07 10:46:56 +00:00
GitHub Action for Semantic Release
Find a file
2019-10-18 16:39:29 +08:00
.github test(testRelease): add Test Release workflow 2019-10-18 14:17:47 +08:00
docs chore(release): 1.2.0 [skip ci] 2019-10-18 05:49:49 +00:00
src feat(dry_run): add a new input - "dry_run" 2019-10-18 13:49:05 +08:00
.editorconfig feat: come a new action 2019-10-17 19:27:21 +08:00
.gitattributes Initial commit 2019-10-17 09:28:19 +08:00
.gitignore feat: come a new action 2019-10-17 19:27:21 +08:00
.npmignore feat: come a new action 2019-10-17 19:27:21 +08:00
action.yml feat(dry_run): add a new input - "dry_run" 2019-10-18 13:49:05 +08:00
CODE_OF_CONDUCT.md feat: come a new action 2019-10-17 19:27:21 +08:00
index.js feat: come a new action 2019-10-17 19:27:21 +08:00
LICENSE Initial commit 2019-10-17 09:28:19 +08:00
package-lock.json feat: come a new action 2019-10-17 19:27:21 +08:00
package.json chore(release): 1.2.0 [skip ci] 2019-10-18 05:49:49 +00:00
README.md doc(README): Update version number and place badge 2019-10-18 16:39:29 +08:00
release.config.js test(testRelease): add Test Release workflow 2019-10-18 14:17:47 +08:00

Semantic Release Action

semantic-release npm license

GitHub Action for Semantic Release.

Usage

Step1: Set any Semantic Release Configuration in your repository.

Step2: Add Secrets in your repository for the Semantic Release Authentication Environment Variables.

Step3: Add a Workflow File to your repository to create custom automated processes.

  • inputs:
    • branch: [Optional] The branch for release. Default "master".
    • extra_plugins: [Optional] Extra plugins for pre-install. Default "".
    • dry_run: [Optional] Whether to run semantic release in "dry-run" mode. It will override the dryRun attribute in your configuration file. Default "".
  • outputs:
    • new-release-published: Whether a new release was published. true or false

A simple example

steps:
  - name: Semantic Release
    uses: cycjimmy/semantic-release-action@v1.2.0
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

An advanced example

steps:
  - name: Semantic Release
    uses: cycjimmy/semantic-release-action@v1.2.0
    id: semantic   # Need an `id` for output variables
    with:
      branch: master
      extra_plugins: |
        @semantic-release/git
        @semantic-release/changelog        
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
      
  - name: Do something when a new release published
    if: steps.semantic.outputs.new-release-published == 'true'
    run: ...