stencil-with-semantic-release v1.4.0
How to set up semantic-relese with Stencil
Set up NPM_TOKEN
Go to your repository's Settings
-> Secrets
-> New repository secret
.
In the Name
field put NPM_TOKEN
. Then in the Value
past your npm token.
Set up GitHub Actions
Go to your repository's Actions
tab and press set up a workflow yourself
:
Then copy and paste the below workflow set up
name: Release
'on':
push:
branches:
- master
- next
- beta
- '*.x'
jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: npm
node-version: 16
- run: npm ci
- run: npm run test
- run: npm run build
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Press Start commit
button to commit.
And you're done! Next time you want to release a new version of your Stencil component, prefix your commit with feat(desc):
or just feat:
and a new minor version will be semanticly-released.
If you want to release a fix, prefix your commit with fix(desc):
or fix:
and a fix to your Stencil component will be semanticly-released.
GITHUB_TOKEN
is a default environment variable and is going to be grabbed automatically so no need to set it up (apart from generating it in the first place). If you don't have your NPM_TOKEN
and GITHUB_TOKEN
yet, look below for a quick tutorial on how to generate them.
Generate NPM_TOKEN
You can find out how to generate NPM_TOKEN
here. Tip: for GitHub Actions you need to generate Automation
token.
Generate GITHUB_TOKEN
Go to your GitHub profile Settings
-> Developer settings
-> Personal access tokens
and click Generate new token
button.
Give it some name in the Note
field (I chose semantic-release-token
) and tick everything in the repo
field (that's the only field you'll need).
then press Generate token
button. You'll be presented with your token. Save it in a safe place.