A little GitHub Action for automated releases, changelogs, and package publishing with semantic-release
.
semantic-release
already has a great explained recipe to configure a GitHub Action using its library. The idea of this GitHub Action is to ecapsulate a basic configuration with basic plugins to have a handful and easy way to generate/update the project CHANGELOG
, dispatch a GitHub release and publish the related package.
(Note: For the moment, it is only possible to publish to npm
registries)
See action.yml
- uses: d3p1/semantic-releasify@v1
with:
##
# @note The branch on which release should happen
# @link https://semantic-release.gitbook.io/semantic-release/usage/configuration#branches
##
branch: ''
##
# @note The Git tag format used by semantic-release to identify releases
# @link https://semantic-release.gitbook.io/semantic-release/usage/configuration#tagformat
##
tag-format: ''
Basic:
jobs:
test-action:
name : Test
runs-on: ubuntu-latest
permissions:
contents : write
issues : write
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: d3p1/semantic-releasify@v1
env :
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
The branch
and tag-format
inputs are optional. If not supplied, the targeted branch and v${version}
format will be used, respectively.
It is necessary to set the described permissions
, so the bot can execute the following actions:
contents: write
: Publish a releaseissues: write
: Comment on released issuespull-requests: write
: Comment on released pull requests
Also, if you want to publish the module/package to npm
, it is necessary to set private: true
within your package.json
and to configure the NPM_TOKEN
as secret. Visit the used @semantic-release/npm
plugin for more information.
(Note: Remember to set the GITHUB_TOKEN
environment variable using the autogenerated GitHub secret token because it is required by the plugin @semantic-release/github
used by this implementation)
Detailed changes for each release are documented in CHANGELOG.md
.
This work is published under MIT License.
Always happy to receive a greeting on: