-
Notifications
You must be signed in to change notification settings - Fork 2.2k
45 lines (38 loc) · 994 Bytes
/
ci.yml
File metadata and controls
45 lines (38 loc) · 994 Bytes
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
name: WeChat MiniProgram Demo CI/CD
on:
push:
branches:
- master
pull_request:
branches:
- master
permissions:
contents: read
actions: read
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: 'recursive'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Clone submodule
run: git submodule status
- name: Install dependencies
run: npm install
- name: Run package script
run: npm run init
- name: Upload MiniProgram
env:
WX_PRIVATE_KEY: ${{ secrets.WX_PRIVATE_KEY }}
run: |
# 验证密钥是否为空
if [ -z "$WX_PRIVATE_KEY" ]; then
echo "❌ 错误: WX_PRIVATE_KEY 为空,请检查 GitHub Secrets 设置"
exit 1
fi
mkdir -p ./build
echo "$WX_PRIVATE_KEY" > ./build/key
echo "$WX_PRIVATE_KEY" | xxd