File tree Expand file tree Collapse file tree 3 files changed +60
-9
lines changed Expand file tree Collapse file tree 3 files changed +60
-9
lines changed Original file line number Diff line number Diff line change @@ -66,16 +66,22 @@ jobs:
6666 - name : Install Build Dependencies
6767 run : |
6868 python -m pip install pyinstaller --user
69- - name : Build Windows
70- id : windows_build
71- if : ${{ matrix.os == 'windows-latest' }}
69+ - name : Build
7270 run : |
73- python scripts/createmsi.py
74- echo "##[set-output name=msi;]$(ls *.msi)"
75- - name : Upload MSI
76- if : ${{ matrix.os == 'windows-latest' }}
71+ if [ "$RUNNER_OS" == "Windows" ]; then
72+ python scripts/createmsi.py
73+ echo "##[set-output name=build;]$(ls *.msi)"
74+ elif [ "$RUNNER_OS" == "macOS" ]; then
75+ python scripts/create_macos_package.py
76+ echo "##[set-output name=build;]$(ls dist/*.pkg)"
77+ else
78+ echo "$RUNNER_OS not supported"
79+ exit 1
80+ fi
81+ shell : bash
82+ - name : Upload
7783 uses : softprops/action-gh-release@v2
7884 with :
79- files : ${{ steps.windows_build.outputs.msi }}
85+ files : ${{ steps.windows_build.outputs.build }}
8086
8187
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ if platform.system() == "Darwin":
8080 target ,
8181 name = "Activity Browser.app" ,
8282 icon = "activity_browser/static/icons/activity-browser.icns" ,
83- bundle_identifier = None ,
83+ bundle_identifier = "com.github.lca_activity_browser.activity_browser" ,
8484 version = os .environ .get ("VERSION" , "0.0.0" ),
8585 info_plist = {
8686 "NSPrincipalClass" : "NSApplication" ,
Original file line number Diff line number Diff line change 1+ import platform
2+ import shutil
3+ import subprocess
4+ import sys
5+
6+
7+ def build_app ():
8+ pyinstaller = shutil .which ("pyinstaller" )
9+ if not pyinstaller :
10+ print ("ERROR: This script requires pyinstaller." )
11+ sys .exit (1 )
12+
13+ pyinst_cmd = [
14+ pyinstaller ,
15+ "activity-browser.spec" ,
16+ "--clean" ,
17+ "-y"
18+ ]
19+ subprocess .check_call (pyinst_cmd )
20+
21+
22+ def build_macos_package (application_path = 'dist/Activity Browser.app' , package_path = './Activity Browser-{}.pkg' ,
23+ sign_identity : str = None ):
24+ macos_architecture = 'intel' if platform .processor () == 'i386' else 'arm'
25+ build_cmd = [
26+ 'pkgbuild' ,
27+ '--component' ,
28+ application_path ,
29+ "--install-location" ,
30+ '/Applications' ,
31+ package_path .format (macos_architecture )
32+ ]
33+ if sign_identity :
34+ build_cmd = build_cmd [0 ] + ['--sign' , sign_identity ] + build_cmd [1 :]
35+ subprocess .check_call (build_cmd )
36+
37+
38+ if __name__ == "__main__" :
39+ import argparse
40+
41+ parser = argparse .ArgumentParser ()
42+ parser .add_argument ("--sign-identity" , help = "signing identity" )
43+ options = parser .parse_args ()
44+ # build_app()
45+ build_macos_package (sign_identity = options .sign_identity )
You can’t perform that action at this time.
0 commit comments