-
Notifications
You must be signed in to change notification settings - Fork 19
72 lines (70 loc) · 2.51 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# 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 }}