-
Notifications
You must be signed in to change notification settings - Fork 54
54 lines (50 loc) · 1.44 KB
/
assemble_weapp_release.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
# 工作流名称
name: Assemble Weapp Release
# 触发工作流程的事件
on:
push:
tags: [ v*, w* ]
pull_request:
branches: [ master ]
workflow_dispatch:
# 工作流环境变量
env:
# 小程序的appid
WEAPP_ID: ${{ secrets.WEAPP_ID }}
# 小程序的秘钥
WEAPP_KEY: ${{ secrets.WEAPP_KEY }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache node_modules Folder
uses: actions/cache@v2
with:
path: ${{ github.workspace }}/node_modules
key: ${{ runner.os }}-node_modules
restore-keys: ${{ runner.os }}-node_modules
- name: Get Yarn Cache Directory Path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache Yarn
uses: actions/cache@v2
env:
cache-name: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
run: |
yarn
- name: Import Weapp Key
run: echo "$WEAPP_KEY" | base64 --decode > key/private.appid.key
env:
WEAPP_KEY: ${{ env.WEAPP_KEY }}
- name: Build Taro Playground Weapp
run: |
yarn build:weapp -- --upload
env:
WEAPP_ID: ${{ env.WEAPP_ID }}