Skip to content

Commit

Permalink
Build into a compressed folder as part of script
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidCEllis committed Sep 27, 2024
1 parent 6fba7cc commit 762aac5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: splitguides-app
path: build/SplitGuides_v*/
path: build/SplitGuides_v*.zip
2 changes: 1 addition & 1 deletion .github/workflows/build-zipapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Build the zipapp
run: |
python zipapp/build_zipapps.py
- name: Store the built zipapp
- name: Store the built zipapps
uses: actions/upload-artifact@v4
with:
name: splitguides-zipapp
Expand Down
17 changes: 17 additions & 0 deletions application/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import itertools
import sys
import shutil
import subprocess
from pathlib import Path

from cx_Freeze import setup, Executable
Expand Down Expand Up @@ -63,6 +64,10 @@
print(f"Removing: {f}")
shutil.rmtree(f)

for f in build_path.glob("*.zip"):
print(f"Removing: {f}")
f.unlink()

setup(
name="splitguides",
version=splitguides.__version__,
Expand All @@ -74,3 +79,15 @@
app_path = list(build_path.glob("exe.*"))[0]
output_folder = app_path.with_name(f"SplitGuides_v{splitguides.__version__}")
app_path.rename(output_folder)

zip_path = f"{output_folder}.zip"

print(f"Building zip archive at {zip_path}")
subprocess.run([
sys.executable,
"-m",
"zipfile",
"-c",
str(zip_path),
str(output_folder),
])

0 comments on commit 762aac5

Please sign in to comment.