Bump actions/setup-node from 3 to 4 (#3) #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Releases are fully automated using [semantic-release](https://github.com/semantic-release/semantic-release/). | |
# | |
# The following commit message conventions determine which version is released: | |
# | |
# 1. `fix: ...` or `fix(scope name): ...` prefix in subject: bumps fix version, e.g. `1.2.3` → `1.2.4` | |
# 2. `feat: ...` or `feat(scope name): ...` prefix in subject: bumps feature version, e.g. `1.2.3` → `1.3.0` | |
# 3. `BREAKING CHANGE:` in body: bumps breaking version, e.g. `1.2.3` → `2.0.0` | |
# | |
# Only one version number is bumped at a time, the highest version change trumps the others. | |
# Besides, publishing a new version to npm, semantic-release also creates a git tag and release | |
# on GitHub, generates changelogs from the commit messages and puts them into the release notes. | |
# | |
# If the pull request looks good but does not follow the commit conventions, update the pull request title and use the <kbd>Squash & merge</kbd> button, at which point you can set a custom commit message. | |
# | |
# With each new release, a breaking version tag (e.g. `v1`, `v2`, etc) is created or updated. | |
# | |
# ## Rollback Latest Release | |
# | |
# Let's say `v1.2.3` include a bug and we want to roll back to `v1.2.2`. To accomplish that, the `v1` tag needs to be updated. That can be done using the following code | |
# | |
# ``` | |
# # update `v1` tag to point to `v1.2.2` | |
# git tag --force v1 v1.2.2 | |
# git push --force --tags | |
# ``` | |
# | |
# Any questions? Ping @gr2m | |
name: 🚀 Release | |
"on": | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
- beta | |
- "*.x" | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" | |
- name: install semantic-release plugins | |
run: npm install --no-save semantic-release-plugin-github-breaking-version-tag | |
- name: write configuration | |
run: | | |
cat >.releaserc <<EOL | |
{ | |
"branches": [ | |
"+([0-9]).x", | |
"main", | |
{ | |
"name": "beta", | |
"prerelease": true | |
} | |
], | |
"plugins": [ | |
"@semantic-release/commit-analyzer", | |
"@semantic-release/release-notes-generator", | |
"semantic-release-plugin-github-breaking-version-tag", | |
"@semantic-release/github" | |
] | |
} | |
EOL | |
- name: Release the new version | |
run: npx semantic-release --debug | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |