Run semantic-release as GitHub action
jobs:
release:
runs-on: ubuntu-latest
steps:
# ...
- name: Checkout
uses: actions/checkout@v2
- name: Release
uses: ph-fritsche/action-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
This is the intended use, but you can disable @semantic-release/github
by omitting the GITHUB_TOKEN
environment variable.
Set your NPM_TOKEN
secret on the repository and add it to the environment variables for the action:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
This will enable the @semantic-release/npm
plugin.
You can run the action with your shareable configuration.
This will be extended by the default config.
uses: ph-fritsche/action-release@v1
with:
config: '@mynamespace/my-shareable-semantic-release-configuration'
You can pass a configuration as JSON-formatted input.
This will override settings in the default config.
uses: ph-fritsche/action-release@v1
with:
config: '{"preset":"angular"}'
You can extend your shareable configuration and override settings:
uses: ph-fritsche/action-release@v1
with:
config: '{"extends":"@mynamespace/my-shareable-semantic-release-configuration","preset":"angular"}'
If you want to force a release in one of your workflows, you can do so:
uses: ph-fritsche/action-release@v1
with:
force: minor # forces at least a feature release
When run without a previous release this action releases an initial release,
even if the branch contains no commit that usually would trigger one with semantic-release
(e.g. a branch only containing wip:
commits).
with:
dry: true # activate dry run
debug: true # be more verbose and run semantic-release in debug mode
This action defaults to Conventional Commits preset.
Inspired by cycjimmy/semantic-release-action.