From 35d22cefad76f33f5eb1c4aabbcebadaa640ae54 Mon Sep 17 00:00:00 2001 From: Gokul Prathin A Date: Wed, 22 Nov 2023 10:41:38 -0500 Subject: [PATCH 1/3] added windows deployment support files --- windows-deployment/binder.py | 8 ++++++ windows-deployment/binder.spec | 43 ++++++++++++++++++++++++++++ windows-deployment/geoweaver.ico | Bin 0 -> 4154 bytes windows-deployment/installer.cfg | 20 +++++++++++++ windows-deployment/installer.nsi | 35 ++++++++++++++++++++++ windows-deployment/installer.wxs | 28 ++++++++++++++++++ windows-deployment/launch.bat | 7 +++++ windows-deployment/pyinstaller.spec | 36 +++++++++++++++++++++++ 8 files changed, 177 insertions(+) create mode 100644 windows-deployment/binder.py create mode 100644 windows-deployment/binder.spec create mode 100644 windows-deployment/geoweaver.ico create mode 100644 windows-deployment/installer.cfg create mode 100644 windows-deployment/installer.nsi create mode 100644 windows-deployment/installer.wxs create mode 100644 windows-deployment/launch.bat create mode 100644 windows-deployment/pyinstaller.spec diff --git a/windows-deployment/binder.py b/windows-deployment/binder.py new file mode 100644 index 000000000..74b9612e6 --- /dev/null +++ b/windows-deployment/binder.py @@ -0,0 +1,8 @@ +from subprocess import Popen +import os + +script_dir = os.path.dirname(os.path.realpath(__file__)) +bat_path = os.path.join(script_dir, "launch.bat") + +p = Popen(bat_path, cwd=script_dir) +stdout, stderr = p.communicate() \ No newline at end of file diff --git a/windows-deployment/binder.spec b/windows-deployment/binder.spec new file mode 100644 index 000000000..47898e047 --- /dev/null +++ b/windows-deployment/binder.spec @@ -0,0 +1,43 @@ +# -*- mode: python ; coding: utf-8 -*- + + +a = Analysis( + ['binder.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + noarchive=False, +) +pyz = PYZ(a.pure) + +exe = EXE( + pyz, + a.scripts, + [], + exclude_binaries=True, + name='binder', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, +) +coll = COLLECT( + exe, + a.binaries, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='binder', +) diff --git a/windows-deployment/geoweaver.ico b/windows-deployment/geoweaver.ico new file mode 100644 index 0000000000000000000000000000000000000000..454f56f8fce78ef51c4d70848fd1b6a9d9e36d05 GIT binary patch literal 4154 zcmchZTa2Ak6vy|O+fj|qOfN2>&O}ELku)U4OWh?B4KG4Gco2P+;H?Qx6G7XA7g0o9 zN=l2;6w?>Uv`Tf_dQhq&+EZFVi*X+@hTreZw@yCCcVT zt0e!X{+^UhOeviWeXs=d`>S@RG;j7ebq9Y2mR}IGQEo3le?2DpOlBhm9?z?>rx^=~Mv^#q&%_VvE@!4;sUv7f^dxCe$opB#ldU>1a~ zbGR7}Ld5+>`4KoDc4mIpP6QLm4!X6oK; z`A#?r5$Bt6H&o!A%qkT7A1`S=;FMi?2`i&TX{5dJgxt|#K*LBEwL&I{#7VIqC+f%=Z) z|JHvo(~kK+OMNEh?>EqS$(k%@(fWT(+bUR@;r}`9GoEZ$&4p0N>0*1suTlAau4AY-%9Zb-oRDfOor@A$-dr&ZYaa z2z-B=>Br|A-lWpHYAlq%yF9-D*W7PI8oYO`Jyk|is*E(~s*Eg_IZ*d^52w^#OVv`f vR7 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/windows-deployment/launch.bat b/windows-deployment/launch.bat new file mode 100644 index 000000000..bf56bc84b --- /dev/null +++ b/windows-deployment/launch.bat @@ -0,0 +1,7 @@ +@echo off +start /min cmd /c java -jar geoweaver.jar +:LOOP +timeout /t 5 +netstat -ano | find "8070" >nul +if errorlevel 1 goto LOOP +start http://localhost:8070/Geoweaver \ No newline at end of file diff --git a/windows-deployment/pyinstaller.spec b/windows-deployment/pyinstaller.spec new file mode 100644 index 000000000..db02cc2dc --- /dev/null +++ b/windows-deployment/pyinstaller.spec @@ -0,0 +1,36 @@ +block_cipher = None + +a = Analysis(['binder.py'], + pathex=['path_to_your_script'], + binaries=[], + datas=[('launch.bat', '.'), ('geoweaver.jar', '.'), ('geoweaver.ico', '.')], + 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='geoweaver', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True, + icon='geoweaver.ico') +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='geoweaver', + dest_folder='.') From 98ea60e124f61ccc21ae5fe2cac7c09a212bcf7b Mon Sep 17 00:00:00 2001 From: Gokul Prathin A Date: Wed, 22 Nov 2023 10:46:37 -0500 Subject: [PATCH 2/3] added deployment file --- .github/workflows/main.yml | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fedbcb6f4..86b3d3144 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,6 +59,43 @@ jobs: target/*.jar pom.xml linux-deployment/*.deb + + + build-windows: + needs: build-jar + runs-on: windows-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Download Geoweaver Artifacts + uses: actions/download-artifact@v2 + with: + name: geoweaver-artifacts + path: artifact + + - name: Prepare Deployment Directory + run: | + cp artifact/target/geoweaver.jar windows-deployment/geoweaver.jar + + - name: Install NSIS + run: choco install nsis + + - name: Install PyInstaller + run: pip install pyinstaller + + - name: Build Executable with PyInstaller + run: pyinstaller windows-deployment/pyinstaller.spec + + - name: Build NSIS Installer + run: '& "C:\Program Files (x86)\NSIS\makensis.exe" windows-deployment/installer.nsi' + + - name: Upload Windows Installer to Release + uses: actions/upload-artifact@v2 + with: + name: geoweaver-windows-installer + path: D:\a\Geoweaver\Geoweaver\windows-deployment\GeoweaverInstaller.exe build-macos: needs: build-jar @@ -119,6 +156,12 @@ jobs: with: name: geoweaver-dmg + - name: Download Windows Installer Artifact + uses: actions/download-artifact@v2 + with: + name: geoweaver-windows-installer + + - name: Get ID and upload URL of the latest release run: | RESPONSE=$(curl -s -H "Authorization: token ${{ secrets.PAT }}" "https://api.github.com/repos/${{ github.repository }}/releases/latest") @@ -164,3 +207,13 @@ jobs: asset_content_type: application/x-diskcopy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Windows Installer to Release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ env.UPLOAD_URL }} + asset_path: GeoweaverInstaller.exe + asset_name: GeoweaverInstaller.exe + asset_content_type: application/vnd.microsoft.portable-executable + env: + GITHUB_TOKEN: ${{ secrets.PAT }} From 5026fdecd9eb9aad1f14274baff26f43cdfdd731 Mon Sep 17 00:00:00 2001 From: Gokul Prathin <45752727+gokulprathin8@users.noreply.github.com> Date: Wed, 22 Nov 2023 10:58:04 -0500 Subject: [PATCH 3/3] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 86b3d3144..47740ce66 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -136,7 +136,7 @@ jobs: path: /Users/runner/work/Geoweaver/Geoweaver/Geoweaver.dmg release: - needs: [build-jar, build-macos] + needs: [build-jar, build-macos, build-windows] runs-on: ubuntu-latest steps: