Skip to content

Commit 8bb9e72

Browse files
authored
ci: add auto release and publish (#109)
1 parent 5bd2aa1 commit 8bb9e72

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Setup node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: '14'
18+
registry-url: 'https://registry.npmjs.org'
19+
20+
- name: Install dependencies
21+
run: yarn
22+
- name: Lint
23+
run: yarn lint:codes
24+
- name: Test
25+
run: yarn test
26+
27+
- name: Create Release for Tag
28+
id: release_tag
29+
uses: yyx990803/release-tag@master
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
tag_name: ${{ github.ref }}
34+
body: |
35+
Please refer to [CHANGELOG.md](https://github.com/originjs/vue-codemod/blob/dev/CHANGELOG.md) for details.
36+
37+
- name: Publish to NPM Registry
38+
run: npm publish --access public
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

0 commit comments

Comments
 (0)