Windows Installer #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Windows Installer | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: UCRT64 | |
| update: true | |
| - name: Install build dependencies (GTK4 + Python + build tools) | |
| shell: msys2 {0} | |
| run: | | |
| pacman -Sy --noconfirm | |
| pacman --noconfirm -S --needed \ | |
| git \ | |
| mingw-w64-ucrt-x86_64-toolchain \ | |
| mingw-w64-ucrt-x86_64-meson \ | |
| mingw-w64-ucrt-x86_64-ninja \ | |
| mingw-w64-ucrt-x86_64-pkg-config \ | |
| mingw-w64-ucrt-x86_64-python \ | |
| mingw-w64-ucrt-x86_64-python-pip \ | |
| mingw-w64-ucrt-x86_64-python-gobject \ | |
| mingw-w64-ucrt-x86_64-gtk4 \ | |
| mingw-w64-ucrt-x86_64-libadwaita \ | |
| mingw-w64-ucrt-x86_64-glib2 \ | |
| mingw-w64-ucrt-x86_64-gobject-introspection \ | |
| mingw-w64-ucrt-x86_64-gsettings-desktop-schemas \ | |
| mingw-w64-ucrt-x86_64-gtksourceview5 \ | |
| p7zip | |
| - name: Build blueprint-compiler (v0.18.0) | |
| shell: msys2 {0} | |
| run: | | |
| set -e | |
| rm -rf /c/_deps && mkdir -p /c/_deps | |
| cd /c/_deps | |
| git clone --depth 1 --branch v0.18.0 https://gitlab.gnome.org/GNOME/blueprint-compiler.git | |
| cd blueprint-compiler | |
| meson setup build --prefix=/opt/blueprint-compiler --buildtype=release | |
| meson compile -C build | |
| meson install -C build | |
| echo "/opt/blueprint-compiler/bin" >> $GITHUB_PATH | |
| export PATH="/opt/blueprint-compiler/bin:$PATH" | |
| blueprint-compiler --version | |
| - name: Configure & build SSH Studio (Meson) | |
| shell: msys2 {0} | |
| run: | | |
| set -e | |
| export PATH="/opt/blueprint-compiler/bin:$PATH" | |
| rm -rf builddir && mkdir -p builddir | |
| meson setup builddir --prefix=/opt/ssh-studio --buildtype=release | |
| meson compile -C builddir | |
| meson install -C builddir | |
| - name: Stage install tree | |
| shell: msys2 {0} | |
| run: | | |
| STAGE=/c/_stage/ssh-studio | |
| rm -rf "$STAGE" && mkdir -p "$STAGE" | |
| cp -r /opt/ssh-studio/* "$STAGE"/ | |
| # Copy MSYS2 runtime (Python + GTK) | |
| cp /ucrt64/bin/python.exe "$STAGE"/ | |
| cp /ucrt64/bin/pythonw.exe "$STAGE"/ | |
| cp -r /ucrt64/lib/python3* "$STAGE"/python-lib | |
| cp -r /ucrt64/bin "$STAGE"/gtk-bin | |
| cp -r /ucrt64/lib "$STAGE"/gtk-lib | |
| cp -r /ucrt64/share "$STAGE"/gtk-share | |
| # Add batch launcher | |
| cat > "$STAGE/SSH-Studio.bat" << 'EOF' | |
| @echo off | |
| setlocal | |
| set APPDIR=%~dp0 | |
| set PATH=%APPDIR%gtk-bin;%PATH% | |
| set GI_TYPELIB_PATH=%APPDIR%gtk-lib\girepository-1.0 | |
| set XDG_DATA_DIRS=%APPDIR%share;%APPDIR%gtk-share | |
| "%APPDIR%pythonw.exe" -m ssh_studio.main %* | |
| endlocal | |
| EOF | |
| # Make portable zip | |
| cd /c/_stage | |
| 7z a SSH-Studio-portable.zip ssh-studio > /dev/null | |
| cp SSH-Studio-portable.zip /d/a/SSH-Studio/SSH-Studio/ | |
| - name: Download Inno Setup | |
| run: | | |
| $url = "https://files.jrsoftware.org/is/6/innosetup-6.2.2.exe" | |
| $output = "C:\innosetup.exe" | |
| Invoke-WebRequest -Uri $url -OutFile $output | |
| Start-Process -FilePath $output -ArgumentList "/SILENT" -Wait | |
| - name: Build Inno Setup installer | |
| run: | | |
| $version = if ($env:GITHUB_REF_NAME) { $env:GITHUB_REF_NAME } else { "dev" } | |
| & "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /DAppName="SSH-Studio" /DVersion="$version" /DSourceDir="C:\_stage\ssh-studio" "installer\ssh-studio.iss" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-artifacts | |
| path: | | |
| SSH-Studio-portable.zip | |
| installer/out/*.exe |