File tree Expand file tree Collapse file tree 2 files changed +81
-0
lines changed Expand file tree Collapse file tree 2 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Build Bytes of Love
2+ on :
3+ - push
4+ - pull_request
5+
6+ jobs :
7+ renpy-build :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Checkout repository
11+ uses : actions/checkout@v4
12+
13+ - name : Setup Python
14+ uses : actions/setup-python@v5
15+ with :
16+ python-version : ' 3.12'
17+
18+ - name : Extract short commit hash
19+ shell : bash
20+ run : echo "git_hash=$(git rev-parse --short "$GITHUB_SHA")" >> $GITHUB_OUTPUT
21+ id : ref
22+
23+ - name : Setup Ren'Py and Build
24+ run : |
25+ wget https://www.renpy.org/dl/8.3.2/renpy-8.3.2-sdk.tar.bz2
26+ tar -xf renpy-8.3.2-sdk.tar.bz2
27+ ( cd renpy-8.3.2-sdk && ./renpy.sh launcher distribute ../BytesOfLove --destination ../dist --package win --package mac --package linux )
28+
29+ - name : Process Files
30+ run : python .github/workflows/process.py ${{ steps.ref.outputs.git_hash }}
31+
32+ - name : Upload Linux Build
33+ uses : actions/upload-artifact@v4
34+ with :
35+ name : BytesOfLove-linux-${{ steps.ref.outputs.git_hash }}
36+ path : dist/BytesOfLove-linux-${{ steps.ref.outputs.git_hash }}.tar.bz2
37+ compression-level : 0
38+
39+ - name : Upload Mac Build
40+ uses : actions/upload-artifact@v4
41+ with :
42+ name : BytesOfLove-mac-${{ steps.ref.outputs.git_hash }}
43+ path : dist/BytesOfLove-mac-${{ steps.ref.outputs.git_hash }}.zip
44+ compression-level : 0
45+
46+ - name : Upload Windows Build
47+ uses : actions/upload-artifact@v4
48+ with :
49+ name : BytesOfLove-win-${{ steps.ref.outputs.git_hash }}
50+ path : dist/BytesOfLove-win-${{ steps.ref.outputs.git_hash }}
Original file line number Diff line number Diff line change 1+ import sys
2+ from pathlib import Path
3+ from zipfile import ZipFile
4+
5+ commit_hash = sys .argv [1 ]
6+
7+ files = Path ("dist" ).glob ('*' )
8+
9+ for a_file in files :
10+ if not a_file .is_file ():
11+ continue
12+
13+ if a_file .suffix == ".zip" :
14+ platform = a_file .stem .split ("-" )[- 1 ].removesuffix (".zip" )
15+
16+ if platform == "win" :
17+ print ("Extracting" , a_file )
18+ with ZipFile (a_file , 'r' ) as zip_ref :
19+ zip_ref .extractall (f"dist/BytesOfLove-{ platform } -{ commit_hash } " )
20+ print ("Extracted" , a_file )
21+ else :
22+ # due to https://github.com/actions/upload-artifact?tab=readme-ov-file#permission-loss,
23+ # we don't want to extract the file in the fears of losing certain permissions
24+ # windows doesn't care though
25+ print ("Renaming" , a_file )
26+ a_file .rename (f"dist/BytesOfLove-{ platform } -{ commit_hash } .zip" )
27+
28+ elif a_file .suffix == ".bz2" :
29+ # see above
30+ print ("Renaming" , a_file )
31+ a_file .rename ("dist/BytesOfLove-linux-" + commit_hash + ".tar.bz2" )
You can’t perform that action at this time.
0 commit comments