Skip to content

Commit 7599fb5

Browse files
authored
Merge pull request #150 from OneSignal/automate-release
build: automate release flow
2 parents d94d731 + 9ba135e commit 7599fb5

File tree

2 files changed

+171
-0
lines changed

2 files changed

+171
-0
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
release:
9+
name: Release
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
issues: write
14+
pull-requests: write
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
token: ${{ secrets.RELEASE_TOKEN }}
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 'lts/*'
25+
registry-url: 'https://registry.npmjs.org'
26+
- name: Release
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
30+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
run: |
32+
npx -p semantic-release \
33+
-p @semantic-release/changelog \
34+
-p @semantic-release/git \
35+
-p @semantic-release/github \
36+
-p @semantic-release/npm \
37+
-p conventional-changelog-conventionalcommits \
38+
semantic-release --dry-run

.releaserc.json

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
{
2+
"branches": [
3+
"main"
4+
],
5+
"tagFormat": "${version}",
6+
"plugins": [
7+
[
8+
"@semantic-release/commit-analyzer",
9+
{
10+
"releaseRules": [
11+
{
12+
"breaking": true,
13+
"release": "minor"
14+
},
15+
{
16+
"type": "feat",
17+
"release": "minor"
18+
},
19+
{
20+
"type": "fix",
21+
"release": "patch"
22+
},
23+
{
24+
"type": "docs",
25+
"release": "patch"
26+
},
27+
{
28+
"type": "perf",
29+
"release": "patch"
30+
},
31+
{
32+
"type": "refactor",
33+
"release": "patch"
34+
},
35+
{
36+
"type": "style",
37+
"release": "patch"
38+
},
39+
{
40+
"type": "test",
41+
"release": "patch"
42+
},
43+
{
44+
"type": "build",
45+
"release": "patch"
46+
},
47+
{
48+
"type": "ci",
49+
"release": "patch"
50+
},
51+
{
52+
"type": "chore",
53+
"scope": "deps",
54+
"release": "patch"
55+
}
56+
]
57+
}
58+
],
59+
[
60+
"@semantic-release/release-notes-generator",
61+
{
62+
"preset": "conventionalcommits",
63+
"writerOpts": {
64+
"types": [
65+
{
66+
"type": "feat",
67+
"section": "Features"
68+
},
69+
{
70+
"type": "fix",
71+
"section": "Bug Fixes"
72+
},
73+
{
74+
"type": "docs",
75+
"section": "Documentation",
76+
"hidden": false
77+
},
78+
{
79+
"type": "deps",
80+
"section": "Dependency Updates",
81+
"hidden": false
82+
},
83+
{
84+
"type": "chore",
85+
"hidden": true
86+
},
87+
{
88+
"type": "style",
89+
"hidden": true
90+
},
91+
{
92+
"type": "refactor",
93+
"hidden": true
94+
},
95+
{
96+
"type": "perf",
97+
"hidden": true
98+
},
99+
{
100+
"type": "test",
101+
"hidden": true
102+
}
103+
]
104+
}
105+
}
106+
],
107+
[
108+
"@semantic-release/changelog",
109+
{
110+
"changelogFile": "CHANGELOG.md",
111+
"changelogTitle": "# Changelog"
112+
}
113+
],
114+
[
115+
"@semantic-release/npm",
116+
{
117+
"pkgRoot": "."
118+
}
119+
],
120+
[
121+
"@semantic-release/git",
122+
{
123+
"assets": [
124+
"dist/**",
125+
"package.json",
126+
"CHANGELOG.md"
127+
],
128+
"message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes} [skip ci]"
129+
}
130+
],
131+
"@semantic-release/github"
132+
]
133+
}

0 commit comments

Comments
 (0)