Skip to content

Commit a4d0d80

Browse files
authored
feat: add github actions automated create release and publish npm (#179)
* feat: add github actions automated release and publish * feat: add github actions automated create release and publish
1 parent 0818a40 commit a4d0d80

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

.github/publish.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
build:
10+
# Run scripts on Linux
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Use github actions default to checkout corresponding branch
14+
- uses: actions/checkout@v2
15+
16+
# Use github actions to install node at least 14 version
17+
- name: Setup node
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: '14'
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
# Use github actions to install pnpm at least 6 version
24+
- name: Install pnpm
25+
uses: pnpm/action-setup@v2
26+
with:
27+
version: 6
28+
29+
# Install dependencies
30+
- name: Install dependencies
31+
run: pnpm install
32+
33+
# Run build
34+
- name: Build
35+
run: pnpm build
36+
37+
# Use github actions to create release with tagName, commitMessage and committerName
38+
- name: Create Release for Tag
39+
id: release_tag
40+
uses: yyx990803/release-tag@master
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
with:
44+
tag_name: ${{ github.ref }}
45+
body: |
46+
${{github.event.head_commit.message}} by **@${{github.event.head_commit.committer.name}}**
47+
48+
# Publish to npm
49+
# !It must configure npm token and tokenName same with NPM_PUBLISH_TOKEN
50+
- name: Publish to npm registry
51+
run: |
52+
npm publish --access public
53+
env:
54+
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

example/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
},
2525
methods: {
2626
complete () {
27-
debugger
2827
console.log('complete', arguments)
2928
},
3029
fileComplete () {

0 commit comments

Comments
 (0)