Skip to content

Commit 095b2da

Browse files
committed
chore(ci): add semantic-release
1 parent a336259 commit 095b2da

File tree

5 files changed

+12455
-3179
lines changed

5 files changed

+12455
-3179
lines changed

.github/workflows/node.js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ main ]
8+
branches: [ main, next, 1.x ]
99
pull_request:
10-
branches: [ main ]
10+
branches: [ main, next, 1.x ]
1111

1212
jobs:
1313
build:

.github/workflows/npm-publish.yml

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,23 @@
1-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3-
4-
name: Node.js Package
1+
# See https://github.com/semantic-release/semantic-release/blob/master/docs/recipes/ci-configurations/github-actions.md#trigger-semantic-release-on-demand
52

3+
name: Publish using semantic-release
64
on:
7-
release:
8-
types: [created]
5+
push:
6+
branches: [ main, next, 1.x ]
97

108
jobs:
11-
build:
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
16-
with:
17-
node-version: 16
18-
- run: npm ci
19-
- run: npm release
20-
219
publish-npm:
22-
needs: build
2310
runs-on: ubuntu-latest
2411
steps:
2512
- uses: actions/checkout@v3
2613
- uses: actions/setup-node@v3
2714
with:
28-
node-version: 16
15+
node-version: lts/*
16+
cache: 'npm'
2917
registry-url: https://registry.npmjs.org/
3018
- run: npm ci
31-
- run: npm publish
19+
- name: Release
3220
env:
33-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
21+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: npx semantic-release

.releaserc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"branches": ["+([0-9])?(.{+([0-9]),x}).x", "main", "next"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
"@semantic-release/npm",
8+
["@semantic-release/git",
9+
{
10+
"assets": ["package.json", "package-lock.json", "dist/*", "CHANGELOG.md"],
11+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
12+
}],
13+
"@semantic-release/github"
14+
]
15+
}

0 commit comments

Comments
 (0)