-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-mp-weixin.yml
More file actions
47 lines (37 loc) · 1.18 KB
/
build-mp-weixin.yml
File metadata and controls
47 lines (37 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# 自动编译&发布微信小程序版本
# 参考1. https://segmentfault.com/a/1190000039125224
# 由 https://github.com/seho-code-life/project_workflows 提供支持
name: MP-WEIXIN CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-weixin-ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Node ENV
uses: actions/setup-node@master
with:
node-version: 12.13.0
- name: Install Dependencies
run: npm i
- name: Build
run: npm run build:mp-weixin
# see Project/Settings/Secrets
- name: Generate private key for upload
run: echo "$UPLOAD_PRIVATE_KEY" > private.key
env:
UPLOAD_PRIVATE_KEY: ${{ secrets.WEIXIN_UPLOAD_PRIVATE_KEY }}
# 以下设置,请根据自己项目需要进行调整
# 需要根目录有package.json
- name: Set PackageJson
run: cp ./package.json ./dist/build/mp-weixin/package.json
# 上传代码,需要设置private.key具体位置
- name: Upload to WeChat
run: npx mp-ci upload ./dist/build/mp-weixin --pkp=./private.key