Skip to content

Commit

Permalink
Merge pull request #916 from FashionFreedom/win32
Browse files Browse the repository at this point in the history
ci: add win32 build
  • Loading branch information
slspencer authored Apr 9, 2023
2 parents 5319ae6 + 4c57763 commit 1ea3b83
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 16 deletions.
8 changes: 4 additions & 4 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ Seamly2D is open source software released under the GPLv3+ license. Seamly2D is
Learn more about Seamly2D by joining our friendly, active user [forum](https://forum.seamly.net) and reading our [Code of Conduct](CODE_OF_CONDUCT.md). On our forum you may post questions about patternmaking and Seamly2D in any language you choose, as sewing terms are rich with idioms that are not always translatable word-for-word.

## Supported platforms:
* Windows 10 & 11 (64-bit)
* Windows 10 & 11 (32-bit and 64-bit)
* Most current Linux distros via [Flathub](https://flathub.org/apps/details/net.seamly.seamly2d)
* Mac OS X 10.8 (64-bit) or later

## Download Seamly2D:

| Windows | MacOS | Linux AppImage | Linux Flatpak |
| :---: | :---: | :---: | :---: |
| [![Seamly2d-windows.zip](img/Microsoft_logo-60x60px.png)](https://github.com/FashionFreedom/Seamly2D/releases/latest/download/Seamly2D-windows.zip) | [<picture><source media="(prefers-color-scheme: dark)" srcset="img/white-apple-logo-transparent-49x60px.png"><source media="(prefers-color-scheme: light)" srcset="img/Apple_logo_black.png" ><img src="img/Apple_logo_black.png" height="60"></picture>](https://github.com/FashionFreedom/Seamly2D/releases/latest/download/Seamly2D-macos.zip) | [![Seamly2D-x86_64.AppImage](img/Tux_Mono_60x60.png)](https://github.com/FashionFreedom/Seamly2D/releases/latest/download/Seamly2D-x86_64.AppImage) | [<img src="https://flathub.org/assets/badges/flathub-badge-en.svg" alt="Download On Flathub" height="60">](https://flathub.org/apps/details/net.seamly.seamly2d) |
| Windows 64-bit | Windows 32-bit | MacOS | Linux AppImage | Linux Flatpak |
| :---: | :---: | :---: | :---: | :---: |
| [![Seamly2d-windows.zip](img/Microsoft_logo-60x60px.png)](https://github.com/FashionFreedom/Seamly2D/releases/latest/download/Seamly2D-windows.zip) | [![Seamly2d-win32.zip](img/Microsoft_logo-60x60px.png)](https://github.com/FashionFreedom/Seamly2D/releases/latest/download/Seamly2D-win32.zip) | [<picture><source media="(prefers-color-scheme: dark)" srcset="img/white-apple-logo-transparent-49x60px.png"><source media="(prefers-color-scheme: light)" srcset="img/Apple_logo_black.png" ><img src="img/Apple_logo_black.png" height="60"></picture>](https://github.com/FashionFreedom/Seamly2D/releases/latest/download/Seamly2D-macos.zip) | [![Seamly2D-x86_64.AppImage](img/Tux_Mono_60x60.png)](https://github.com/FashionFreedom/Seamly2D/releases/latest/download/Seamly2D-x86_64.AppImage) | [<img src="https://flathub.org/assets/badges/flathub-badge-en.svg" alt="Download On Flathub" height="60">](https://flathub.org/apps/details/net.seamly.seamly2d) |

___________________________________________________
## Seamly2D Community Resources:
Expand Down
64 changes: 62 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
if-no-files-found: error

windows:
name: 'Windows: Build'
name: 'Windows 64-Bit: Build'
runs-on: windows-latest
needs: version
env:
Expand Down Expand Up @@ -224,10 +224,66 @@ jobs:
path: Seamly2D-windows.zip
if-no-files-found: error

win32:
name: 'Windows 32-Bit: Build'
runs-on: windows-latest
needs: version
env:
VERSION_NUMBER: ${{ needs.version.outputs.version_number }}

steps:
- uses: actions/checkout@v3

- name: install msvc
uses: ilammy/msvc-dev-cmd@v1
with:
# use Visual C++ 2022 latest, 14.34.xxxx
toolset: '14.34'
arch: amd64_x86

- uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
arch: win32_msvc2019
cache: true

- name: update version
shell: bash
run: |
./scripts/version.sh ${VERSION_NUMBER}
- name: make seamly2d.exe and seamlyme.exe
run: |
qmake.exe Seamly2D.pro -config release CONFIG+=noTests
nmake
- name: create seamly2d-installer.exe
# copy seamly2d and seamlyme directory trees prepared by windeployqt and create installer
# uses parameters in seamly2d-installer.nsi to create the installer exe
run: |
mkdir ..\windows-build
Copy-Item -Path 'src\app\seamly2d\bin\*' -Destination ..\windows-build -Recurse
Copy-Item -Path 'src\app\seamlyme\bin\*' -Destination ..\windows-build -Recurse -Force
Copy-Item -Path dist\seamly2d-installer.nsi -Destination ..\windows-build
cd ..\windows-build\
& 'C:\Program Files (x86)\NSIS\makensis.exe' seamly2d-installer.nsi
- name: pack installer file into .zip
run: |
cd ..\windows-build\
C:\"Program Files"\7-Zip\7z.exe a Seamly2D-win32.zip Seamly2D-installer.exe
copy Seamly2D-win32.zip ..\Seamly2D\
- uses: actions/upload-artifact@v3
with:
name: Seamly2D-win32.zip
path: Seamly2D-win32.zip
if-no-files-found: error

publish:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'push'
runs-on: ubuntu-latest
needs: [version, windows, linux, macos]
needs: [version, windows, win32, linux, macos]
env:
VERSION_NUMBER: ${{ needs.version.outputs.version_number }}

Expand All @@ -241,6 +297,9 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: Seamly2D-windows.zip
- uses: actions/download-artifact@v3
with:
name: Seamly2D-win32.zip
- uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION_NUMBER }}
Expand All @@ -254,3 +313,4 @@ jobs:
Seamly2D-x86_64.AppImage
Seamly2D-macos.zip
Seamly2D-windows.zip
Seamly2D-win32.zip
8 changes: 6 additions & 2 deletions common.pri
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ win32{
# customer's computer and tried interfacing with it. The version it found was too old though (from Qt 5.2 onwards v1.0.0
# or later is required).
#
# Our solution was to distribute the OpenSSL DLLs along with our application (~1.65 MB). The alternative is to compile
# Our solution was to distribute the OpenSSL DLLs along with our application (~7 MB). The alternative is to compile
# Qt from scratch without OpenSSL support.
#
# Source of the openssl binaries: http://wiki.overbyte.eu/wiki/index.php/ICS_Download
win32 {
INSTALL_OPENSSL += \
../../../dist/win/libcrypto-1_1-x64.dll \
../../../dist/win/libssl-1_1-x64.dll
../../../dist/win/libcrypto-1_1.dll \
../../../dist/win/libssl-1_1-x64.dll \
../../../dist/win/libssl-1_1.dll
}

CONFIG(debug, debug|release){
Expand Down
13 changes: 10 additions & 3 deletions dist/seamly2d-installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,16 @@ Section "Seamly2D"

SetOutPath $INSTDIR

File "vc_redist.x64.exe"

ExecWait '"$INSTDIR\vc_redist.x64.exe" /norestart'
File /nonfatal "vc_redist.x64.exe"
File /nonfatal "vc_redist.x86.exe"

IfFileExists $INSTDIR\vc_redist.x64.exe 0 vc_redist_x86
ExecWait '"$INSTDIR\vc_redist.x64.exe" /quiet /norestart'
goto after_vc_redist ;
vc_redist_x86:
IfFileExists $INSTDIR\vc_redist.x86.exe 0 after_vc_redist
ExecWait '"$INSTDIR\vc_redist.x86.exe" /quiet /norestart'
after_vc_redist:

; relative to the location of this .nsi file, copy all the files/directories recursively
File /r *
Expand Down
Binary file added dist/win/libcrypto-1_1.dll
Binary file not shown.
Binary file added dist/win/libssl-1_1.dll
Binary file not shown.
14 changes: 9 additions & 5 deletions src/libs/fervor/fvupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,15 @@ void FvUpdater::getPLatformSpecificInstaller(QJsonArray assets) {
#ifdef Q_OS_LINUX // Defined on Linux.
auto searchPattern = "AppImage";
#else
#ifdef Q_OS_MAC // Defined on MAC OS (synonym for Darwin).
auto searchPattern = "macos";
#else
auto searchPattern = "windows";
#endif
#ifdef Q_OS_MACOS // Defined on macOS
auto searchPattern = "macos";
#else
#ifdef Q_OS_WIN64 // Defined on Windows 64-bit only.
auto searchPattern = "windows";
#else // Only windows 32-bit left
auto searchPattern = "win32";
#endif
#endif
#endif

for (const QJsonValueRef asset : assets) {
Expand Down

0 comments on commit 1ea3b83

Please sign in to comment.