|
| 1 | +name: Windows Installer |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + tags: |
| 7 | + - "[0-9]+.[0-9]+.[0-9]+" |
| 8 | + |
| 9 | +jobs: |
| 10 | + build-windows-installer: |
| 11 | + runs-on: windows-latest |
| 12 | + env: |
| 13 | + APP_ID: io.github.BuddySirJava.SSH-Studio |
| 14 | + APP_NAME: SSH Studio |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Setup MSYS2 (UCRT64) |
| 20 | + uses: msys2/setup-msys2@v2 |
| 21 | + with: |
| 22 | + msystem: UCRT64 |
| 23 | + update: true |
| 24 | + install: >- |
| 25 | + base-devel |
| 26 | + git |
| 27 | + mingw-w64-ucrt-x86_64-toolchain |
| 28 | + mingw-w64-ucrt-x86_64-meson |
| 29 | + mingw-w64-ucrt-x86_64-ninja |
| 30 | + mingw-w64-ucrt-x86_64-pkg-config |
| 31 | + mingw-w64-ucrt-x86_64-python |
| 32 | + mingw-w64-ucrt-x86_64-python-pip |
| 33 | + mingw-w64-ucrt-x86_64-python-gobject |
| 34 | + mingw-w64-ucrt-x86_64-gtk4 |
| 35 | + mingw-w64-ucrt-x86_64-libadwaita |
| 36 | + mingw-w64-ucrt-x86_64-glib2 |
| 37 | + mingw-w64-ucrt-x86_64-gobject-introspection |
| 38 | + mingw-w64-ucrt-x86_64-gsettings-desktop-schemas |
| 39 | + mingw-w64-ucrt-x86_64-gtk-update-icon-cache |
| 40 | + p7zip |
| 41 | + nsis |
| 42 | +
|
| 43 | + - name: Show tool versions |
| 44 | + shell: msys2 {0} |
| 45 | + run: | |
| 46 | + python --version |
| 47 | + meson --version |
| 48 | + ninja --version |
| 49 | + pkg-config --version |
| 50 | +
|
| 51 | + - name: Build blueprint-compiler from git (v0.18.0) |
| 52 | + shell: msys2 {0} |
| 53 | + run: | |
| 54 | + set -e |
| 55 | + rm -rf /c/_deps && mkdir -p /c/_deps |
| 56 | + cd /c/_deps |
| 57 | + git clone --depth 1 --branch v0.18.0 https://gitlab.gnome.org/GNOME/blueprint-compiler.git |
| 58 | + cd blueprint-compiler |
| 59 | + meson setup build --prefix=/opt/blueprint-compiler --buildtype=release |
| 60 | + meson compile -C build |
| 61 | + meson install -C build |
| 62 | + echo "/opt/blueprint-compiler/bin" >> $GITHUB_PATH |
| 63 | + blueprint-compiler --version |
| 64 | +
|
| 65 | + - name: Configure & build SSH Studio (Meson) |
| 66 | + shell: msys2 {0} |
| 67 | + run: | |
| 68 | + set -e |
| 69 | + rm -rf builddir && mkdir -p builddir |
| 70 | + meson setup builddir --prefix=/opt/ssh-studio --buildtype=release |
| 71 | + meson compile -C builddir |
| 72 | + meson install -C builddir |
| 73 | +
|
| 74 | + - name: Stage install tree for packaging |
| 75 | + id: stage |
| 76 | + shell: msys2 {0} |
| 77 | + run: | |
| 78 | + set -e |
| 79 | + STAGE=/c/_stage/ssh-studio |
| 80 | + rm -rf "$STAGE" && mkdir -p "$STAGE" |
| 81 | + # Copy installed prefix |
| 82 | + cp -r /opt/ssh-studio/* "$STAGE"/ |
| 83 | + # Create a simple Windows launcher that runs via MSYS2 bash |
| 84 | + cat > "$STAGE/SSH-Studio (MSYS2).bat" << 'BAT' |
| 85 | + @echo off |
| 86 | + setlocal |
| 87 | + set "MSYSBASH=C:\\msys64\\ucrt64\\bin\\bash.exe" |
| 88 | + if exist "%MSYSBASH%" ( |
| 89 | + for %%I in ("%~dp0.") do set "APPDIR_WIN=%%~fI" |
| 90 | + "%MSYSBASH%" -lc "APPDIR=\$(cygpath -u '$APPDIR_WIN'); APPDIR=\${APPDIR%/}; \"$APPDIR/bin/ssh-studio\" $*" |
| 91 | + ) else ( |
| 92 | + echo MSYS2 UCRT64 not found at C:\\msys64. Please install MSYS2 and required GTK/PyGObject runtime. |
| 93 | + pause |
| 94 | + ) |
| 95 | + endlocal |
| 96 | + BAT |
| 97 | + # Produce a portable zip as well |
| 98 | + cd /c/_stage |
| 99 | + 7z a SSH-Studio-portable.zip ssh-studio > /dev/null |
| 100 | + echo STAGE_WIN_PATH=C:\\_stage\\ssh-studio >> $GITHUB_OUTPUT |
| 101 | +
|
| 102 | + - name: Build NSIS installer |
| 103 | + shell: msys2 {0} |
| 104 | + run: | |
| 105 | + set -e |
| 106 | + VERSION="${GITHUB_REF_NAME}" |
| 107 | + if [ -z "$VERSION" ]; then VERSION="dev"; fi |
| 108 | + mkdir -p installer/out |
| 109 | + makensis -DSourceDir=/c/_stage/ssh-studio -DVersion="$VERSION" -DAppName="${APP_NAME}" installer/ssh-studio.nsi |
| 110 | + cp installer/*.exe installer/out/ || true |
| 111 | +
|
| 112 | + - name: Upload artifacts |
| 113 | + uses: actions/upload-artifact@v4 |
| 114 | + with: |
| 115 | + name: windows-artifacts |
| 116 | + path: | |
| 117 | + C:/_stage/SSH-Studio-portable.zip |
| 118 | + installer/*.exe |
| 119 | +
|
| 120 | +
|
0 commit comments