-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.26 KB
/
build.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
name: build weapp ci
on:
# 监听PR
push:
branches:
- dev
- pre
- main
jobs:
build:
# 选择运行在ubuntu
runs-on: ubuntu-latest
# 配置下私有值
strategy:
matrix:
# 使用18.18.0版本
node-version: [18.18.0]
steps:
# 把代码checkout下来
- uses: actions/checkout@v2
# 安装node
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.5.1
with:
node-version: ${{ matrix.node-version }}
# 安装pnpm
- name: Install Pnpm
run: npm i -g pnpm
# 安装依赖
- name: Install Dependencies
run: pnpm i
# 安装upload Dependencies
- name: Install UploadDist Dependencies
run: pnpm uploadInstall
# 执行release脚本
- name: release 脚本执行
run: pnpm release
# 构建小程序
- name: Build weapp
run: npm run build:weapp
# 从 secrets.UPLOAD_PRIVATE_KEY 生成私钥文件
# see Project/Settings/Secrets
- name: Generate private key for upload
run: echo "$UPLOAD_PRIVATE_KEY" > private.key
env:
UPLOAD_PRIVATE_KEY: ${{ secrets.UPLOAD_PRIVATE_KEY }}
# 上传代码
- name: Upload to WeChat
run: pnpm uploadDist