Skip to content

Commit ad8684a

Browse files
committed
ci: add release action
1 parent 0859ffd commit ad8684a

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: node.js
1+
name: Build
22

33
on: [ push, pull_request ]
44

.github/workflows/release.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
6+
types: [published, created, edited]
7+
8+
jobs:
9+
Release:
10+
name: Publish
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Use Node.js ${{ env.NODE_VERSION }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ env.NODE_VERSION }}
20+
21+
- uses: actions/cache@v2
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.os }}-node-
27+
- name: npm install
28+
run: npm install
29+
- name: npm build
30+
run: GENERATE_SOURCEMAP=false npm run build
31+
32+
- uses: montudor/action-zip@v1
33+
with:
34+
args: zip -qq -r www.zip build
35+
36+
- name: Upload builds to release
37+
uses: svenstaro/upload-release-action@v1-release
38+
with:
39+
repo_token: ${{ secrets.GITHUB_TOKEN }}
40+
file: www.zip
41+
tag: ${{ github.ref }}
42+
asset_name: www.zip
43+
overwrite: true

0 commit comments

Comments
 (0)