Skip to content

Commit 3072a4a

Browse files
committed
chore: setup release actions
1 parent 9bab349 commit 3072a4a

File tree

3 files changed

+903
-0
lines changed

3 files changed

+903
-0
lines changed

.github/workflows/release.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
on:
2+
push:
3+
tags: ['v*']
4+
5+
name: Release
6+
7+
jobs:
8+
release:
9+
name: Create Release
10+
strategy:
11+
matrix:
12+
os: [ubuntu-latest]
13+
runs-on: ${{ matrix.os }}
14+
# outputs:
15+
# release_url: ${{ steps.create_release.outputs.upload_url }}
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: 16.x
24+
- name: Cache pnpm modules
25+
uses: actions/cache@v3
26+
env:
27+
cache-name: cache-pnpm-modules
28+
with:
29+
path: ~/.pnpm-store
30+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
31+
restore-keys: |
32+
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
33+
- uses: pnpm/action-setup@v2.2.4
34+
with:
35+
version: latest
36+
run_install: true
37+
38+
- name: Test
39+
timeout-minutes: 10
40+
run: |
41+
npm run build:core
42+
43+
- name: Create Release
44+
id: create_release
45+
run: |
46+
npx changelogithub
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Publish to NPM
51+
run: |
52+
npm publish --access public
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

package.json

+11
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
},
3535
"license": "MIT",
3636
"devDependencies": {
37+
"@innei/bump-version": "^1.5.4",
3738
"@types/minimist": "^1.2.2",
3839
"@types/node": "^18.11.17",
3940
"@types/prompts": "^2.4.2",
@@ -58,5 +59,15 @@
5859
"*.{js,ts,css,json}": [
5960
"prettier --write"
6061
]
62+
},
63+
"bump": {
64+
"leading": [
65+
"git pull --rebase"
66+
],
67+
"publish": false,
68+
"changelog": true,
69+
"allowed_branches": [
70+
"main"
71+
]
6172
}
6273
}

0 commit comments

Comments
 (0)