File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 3232 run : |
3333 python -m pip install --upgrade pip
3434 pip install -r ./requirements.txt -t ./lib
35- zip -r ${{ github.event.repository.name }}.zip . -x '*.git*'
35+
36+ - name : Build Plugin
37+ run : |
38+ py build_plugin.py ${{ github.event.repository.name }}.zip
3639
3740 - name : Publish
3841 if : success()
Original file line number Diff line number Diff line change 1+ import sys
2+ import zipfile
3+ from pathlib import Path
4+
5+
6+ def main (archive_name : str ):
7+ files = [
8+ Path (fp )
9+ for fp in (
10+ "plugin.json" ,
11+ "main.py" ,
12+ "assets/app.png" ,
13+ "assets/error.png" ,
14+ )
15+ ]
16+
17+ plugin_dir = Path ("plugin" )
18+ files .extend (plugin_dir .rglob (f"**.py" ))
19+
20+ lib_dir = Path ("lib" )
21+ files .extend (lib_dir .rglob ("*" ))
22+
23+ with zipfile .ZipFile (archive_name , "w" ) as f :
24+ for file in files :
25+ f .write (file )
26+ print (f"Added { file } " )
27+ print (f"\n Done. Archive saved to { archive_name } " )
28+
29+
30+ if __name__ == "__main__" :
31+ main (sys .argv [- 1 ])
You can’t perform that action at this time.
0 commit comments