Skip to content

Commit 5dfeadb

Browse files
committed
ci: publish package on release creation
1 parent 5f86793 commit 5dfeadb

File tree

3 files changed

+264
-1
lines changed

3 files changed

+264
-1
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish Package
2+
on:
3+
release:
4+
types: [created]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout the repository
10+
uses: actions/checkout@v2
11+
- name: Install pnpm
12+
uses: pnpm/action-setup@v2.0.1
13+
with:
14+
version: 6
15+
- name: Install Node.js
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: 14
19+
cache: 'pnpm'
20+
registry-url: 'https://registry.npmjs.org'
21+
- name: Install dependencies
22+
run: pnpm install
23+
- name: Publish
24+
run: pnpm publish --no-git-checks
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
"test": "pnpm test:lint && pnpm test:unit && pnpm test:build",
4343
"format": "prettier --write src",
4444
"commit": "cz",
45-
"release": "standard-version",
45+
"bumpVersion": "standard-version",
46+
"createGithubRelease": "simple-github-release",
47+
"release": "pnpm bumpVersion && git push origin master --tags && pnpm createGithubRelease",
4648
"updateGitHooks": "simple-git-hooks"
4749
},
4850
"peerDependencies": {
@@ -102,6 +104,7 @@
102104
"rollup": "^2.58.0",
103105
"rollup-plugin-swc": "^0.2.0",
104106
"simple-git-hooks": "^2.6.1",
107+
"simple-github-release": "^1.0.0",
105108
"size-limit": "^7.0.4",
106109
"standard-version": "^9.3.1",
107110
"tsd": "^0.19.0",

0 commit comments

Comments
 (0)