feat: 测试-three-wzy #46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: WeChat MiniProgram Demo CI/CD | |
on: | |
push: | |
branches: | |
- feat-wzy-cs | |
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: | | |
mkdir -p ./build | |
# 打印私钥长度和内容(仅调试用) | |
echo "WX_PRIVATE_KEY 长度:${#WX_PRIVATE_KEY}" | |
# 可选:打印部分内容(避免敏感信息泄露) | |
echo "$WX_PRIVATE_KEY" | head -c 50 && echo "... (只显示前50字符)" | |
# 写入私钥文件 | |
echo "$WX_PRIVATE_KEY" > ./build/key | |
# 继续执行上传脚本 | |
chmod +x ./build/ci.js | |
node ./build/ci.js --skip-key-write |