File tree Expand file tree Collapse file tree 2 files changed +7
-21
lines changed Expand file tree Collapse file tree 2 files changed +7
-21
lines changed Original file line number Diff line number Diff line change 11name : WeChat MiniProgram Demo CI/CD
22
33on :
4- push :
5- branches :
6- - master
74 pull_request :
5+ types : [closed]
86 branches :
97 - master
108jobs :
119 upload :
10+ if : github.event.pull_request.merged == true && github.repository == 'wechat-miniprogram/miniprogram-demo'
1211 runs-on : ubuntu-latest
1312 steps :
1413 - uses : actions/checkout@v4
1716 submodules : ' recursive'
1817 token : ${{ secrets.GITHUB_TOKEN }}
1918
20- - name : Verify file existence
21- run : |
22- echo "当前工作目录:"
23- pwd
24- echo "目录内容:"
25- ls -la
26- echo "build目录内容:"
27- ls -la ./build/
28- echo "子模块状态:"
29- git submodule status
19+ - name : Clone submodule
20+ run : git submodule status
3021
3122 - name : Install dependencies
3223 run : npm install
Original file line number Diff line number Diff line change @@ -6,24 +6,19 @@ import packageJson from '../package.json' with { type: 'json' }
66const __filename = fileURLToPath ( import . meta. url )
77const __dirname = path . dirname ( __filename )
88const privateKeyPath = path . resolve ( __dirname , './key' )
9- try {
10- const content = fs . readFileSync ( privateKeyPath , 'utf8' ) ;
11- console . log ( '文件内容:' , content ) ;
12- } catch ( err ) {
13- console . error ( '读取文件出错:' , err ) ;
14- }
9+
1510// 检查私钥文件是否已存在
1611if ( ! fs . existsSync ( privateKeyPath ) ) {
1712 const privateKeyContent = process . env . WX_PRIVATE_KEY
1813 if ( ! privateKeyContent ) {
1914 throw new Error ( '未找到私钥内容,请确保已正确配置 GitHub Secrets' )
2015 }
21- console . log ( '>>>写入私钥文件:' , privateKeyPath ) ;
16+ console . log ( '>>>> 写入私钥文件:' , privateKeyPath ) ;
2217 fs . writeFileSync ( privateKeyPath , privateKeyContent )
2318}
2419
2520const project = new ci . Project ( {
26- appid : 'wx622bee4f78fa4f5a ' ,
21+ appid : 'wxe5f52902cf4de896 ' ,
2722 type : 'miniProgram' ,
2823 projectPath : path . resolve ( __dirname , '../' ) ,
2924 privateKeyPath : path . resolve ( __dirname , './key' ) ,
You can’t perform that action at this time.
0 commit comments