From 686b93f757fff895492c3b5d74ebb56a75457a12 Mon Sep 17 00:00:00 2001 From: "dries.k" Date: Thu, 21 Jul 2022 15:23:00 +0200 Subject: [PATCH] build-macos action --- .github/workflows/develop.yml | 20 +++++++++++++++++ Makefile | 6 +++++ gotify-tray-macos.spec | 41 +++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 gotify-tray-macos.spec diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 337b2c3..bb59cfa 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -55,3 +55,23 @@ jobs: with: name: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb path: gotify-tray_amd64_ubuntu_${{ matrix.tag }}.deb + + build-macos: + runs-on: macos-12 + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9.5' + - name: Upgrade pip and enable wheel support + run: python -m pip install --upgrade pip setuptools wheel + - name: Build + run: | + make build + cp dist/Gotify-Tray.app Gotify-Tray.app + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: Gotify-Tray.app + path: Gotify-Tray.app diff --git a/Makefile b/Makefile index 05164d7..6630b98 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,12 @@ build: clean cp -r dist/gotify-tray build/debian/usr/lib/gotify-tray dpkg -b build/debian dist/gotify-tray_amd64.deb +build-macos: clean + pip install -r requirements.txt + pip install pyinstaller + pip install Pillow + pyinstaller gotify-tray-macos.spec + install: build sudo dpkg -i dist/gotify-tray_amd64.deb diff --git a/gotify-tray-macos.spec b/gotify-tray-macos.spec new file mode 100644 index 0000000..7821b50 --- /dev/null +++ b/gotify-tray-macos.spec @@ -0,0 +1,41 @@ +# -*- mode: python -*- + +block_cipher = None + +a = Analysis(['gotify_tray/__main__.py'], + pathex=[os.getcwd()], + binaries=[], + datas=[('gotify_tray/gui/images', 'gotify_tray/gui/images')], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='gotify-tray', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=False, + version='version.py', + icon='logo.ico') +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + name='gotify-tray') +app = BUNDLE(coll, + name='Gotify-Tray.app', + icon='logo.ico', + bundle_identifier=None)