File tree Expand file tree Collapse file tree 3 files changed +58
-0
lines changed
Expand file tree Collapse file tree 3 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish template to Github Release
2+ on :
3+ push :
4+ branches :
5+ - master
6+
7+ jobs :
8+ deploy :
9+ name : Deploy docs
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout main
13+ uses : actions/checkout@v2
14+
15+ - name : Setup Python
16+ uses : actions/setup-python@v2
17+ with :
18+ python-version : " 3.10"
19+
20+ - name : Package
21+ run : python3 ./workflow-action/deploy.py
22+
23+ - name : Release
24+ uses : ncipollo/release-action@v1
25+ with :
26+ artifacts : " release/*"
27+ bodyFile : " ./workflow-action/body.md"
Original file line number Diff line number Diff line change 1+ 测试自动化打包流程
Original file line number Diff line number Diff line change 1+ import zipfile
2+ import pathlib
3+ import os
4+
5+ print ("Starting" )
6+
7+ # 创建工作目录
8+ os .makedirs ("release" , exist_ok = True )
9+
10+ # 排除掉文件和特殊文件夹
11+ florders = pathlib .Path ("." ).glob ("*/" )
12+ for directory in florders :
13+ if (
14+ not directory .name .startswith ("." )
15+ and not directory .name .startswith ("sp" )
16+ and os .path .isdir ("./" + directory .name )
17+ and directory .name != "release"
18+ ):
19+ print ("Current florder: " + directory .name )
20+ # test\<directory>.zip
21+ with zipfile .ZipFile (
22+ pathlib .Path ("release" ) / directory .with_suffix (".zip" ).name ,
23+ "w" ,
24+ compression = zipfile .ZIP_DEFLATED ,
25+ compresslevel = 9 ,
26+ ) as zfile :
27+ for item in directory .rglob ("*" ):
28+ zfile .write (item , arcname = item .relative_to (directory ))
29+
30+ print ("All Done" )
You can’t perform that action at this time.
0 commit comments