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
semantic-release-bot 49e15bd489 chore(release): 2.0.3 [skip ci]
## [2.0.3](https://github.com/cycjimmy/semantic-release-action/compare/v2.0.2...v2.0.3) (2019-10-28)

### Bug Fixes

* **inputs:** adjust the default for the "branch" configuration ([e5c555a](e5c555a613))
2019-10-28 07:12:05 +00:00
.github test: modify test workflow file 2019-10-28 14:46:23 +08:00
docs chore(release): 2.0.3 [skip ci] 2019-10-28 07:12:05 +00:00
src fix(inputs): adjust the default for the "branch" configuration 2019-10-28 15:10:20 +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 fix(inputs): adjust the default for the "branch" configuration 2019-10-28 15:10:20 +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 chore(release): 2.0.3 [skip ci] 2019-10-28 07:12:05 +00:00
package.json chore(release): 2.0.3 [skip ci] 2019-10-28 07:12:05 +00:00
README.md fix(inputs): adjust the default for the "branch" configuration 2019-10-28 15:10:20 +08:00
release.config.js build(dependencies): use commitizen 2019-10-21 11:07:06 +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 on which releases should happen. It will override the branch attribute in your configuration file. If the attribute is not configured on both sides, the default is master.
    • extra_plugins: [Optional] Extra plugins for pre-install.
    • dry_run: [Optional] Whether to run semantic release in "dry-run" mode. It will override the dryRun attribute in your configuration file.
  • outputs:
    • new_release_published: Whether a new release was published. true or false
    • new_release_version: Version of the new release
    • new_release_major_version: Major version of the new release
    • new_release_minor_version: Minor version of the new release
    • new_release_patch_version: Patch version of the new release

A simple example

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

An advanced example

steps:
  - name: Semantic Release
    uses: cycjimmy/semantic-release-action@v2
    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: ...

CHANGELOG