mirror of
https://github.com/eclipse/mosquitto.git
synced 2025-05-09 01:01:11 +08:00
32-bit Windows workflow
This commit is contained in:
parent
baca579737
commit
7a6a99b07a
53
.github/workflows/windows-x86.yml
vendored
Normal file
53
.github/workflows/windows-x86.yml
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
name: Windows x86 build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ "master", "fixes", "develop" ]
|
||||
tags: [ "v[0-9]+.*" ]
|
||||
pull_request:
|
||||
branches: [ "master", "fixes", "develop" ]
|
||||
|
||||
env:
|
||||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
mosquitto:
|
||||
runs-on: windows-2022
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
|
||||
- name: vcpkg build
|
||||
uses: johnwason/vcpkg-action@v6
|
||||
id: vcpkg
|
||||
with:
|
||||
manifest-dir: ${{ github.workspace }}
|
||||
triplet: x86-windows
|
||||
token: ${{ github.token }}
|
||||
github-binarycache: true
|
||||
|
||||
- name: Configure CMake
|
||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWITH_LIBWEBSOCKETS=ON -DWITH_TESTS=OFF -DCMAKE_GENERATOR_PLATFORM=WIN32 -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows -DVCPKG_MANIFEST_MODE=ON
|
||||
- name: Build
|
||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
|
||||
|
||||
- uses: suisei-cn/actions-download-file@v1.6.0
|
||||
id: vcredist
|
||||
name: Download VC redistributable
|
||||
with:
|
||||
url: https://aka.ms/vs/17/release/vc_redist.x86.exe
|
||||
target: ${{github.workspace}}/installer/
|
||||
|
||||
- name: Installer
|
||||
uses: joncloud/makensis-action@v4
|
||||
with:
|
||||
script-file: ${{github.workspace}}/installer/mosquitto.nsi
|
||||
|
||||
- name: Upload installer to artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: installer
|
||||
path: ${{ github.workspace }}/installer/mosquitto*.exe
|
@ -4,8 +4,7 @@
|
||||
# To configure the build options either use the CMake gui, or run the command
|
||||
# line utility including the "-i" option.
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_policy(SET CMP0042 NEW)
|
||||
cmake_minimum_required(VERSION 3.18)
|
||||
|
||||
project(mosquitto)
|
||||
set (VERSION 2.0.20)
|
||||
|
@ -47,8 +47,8 @@ Section "Files" SecInstall
|
||||
SetOutPath "$INSTDIR"
|
||||
File "..\logo\mosquitto.ico"
|
||||
File "..\build\src\Release\mosquitto.exe"
|
||||
File "..\build\apps\mosquitto_passwd\Release\mosquitto_passwd.exe"
|
||||
File "..\build\apps\mosquitto_ctrl\Release\mosquitto_ctrl.exe"
|
||||
File "..\build\apps\mosquitto_passwd\Release\mosquitto_passwd.exe"
|
||||
File "..\build\client\Release\mosquitto_pub.exe"
|
||||
File "..\build\client\Release\mosquitto_sub.exe"
|
||||
File "..\build\client\Release\mosquitto_rr.exe"
|
||||
@ -63,12 +63,17 @@ Section "Files" SecInstall
|
||||
File "..\README.md"
|
||||
File "..\README-windows.txt"
|
||||
File "..\README-letsencrypt.md"
|
||||
;File "C:\pthreads\Pre-built.2\dll\x86\pthreadVC2.dll"
|
||||
File "C:\OpenSSL-Win32\bin\libssl-1_1.dll"
|
||||
File "C:\OpenSSL-Win32\bin\libcrypto-1_1.dll"
|
||||
File "..\SECURITY.md"
|
||||
File "..\edl-v10"
|
||||
File "..\epl-v20"
|
||||
|
||||
File "..\build\vcpkg_installed\x86-windows\bin\cjson.dll"
|
||||
File "..\build\vcpkg_installed\x86-windows\bin\libcrypto-3.dll"
|
||||
File "..\build\vcpkg_installed\x86-windows\bin\libssl-3.dll"
|
||||
File "..\build\vcpkg_installed\x86-windows\bin\pthreadVC3.dll"
|
||||
File "..\build\vcpkg_installed\x86-windows\bin\uv.dll"
|
||||
File "..\build\vcpkg_installed\x86-windows\bin\websockets.dll"
|
||||
|
||||
SetOutPath "$INSTDIR\devel"
|
||||
File "..\build\lib\Release\mosquitto.lib"
|
||||
File "..\build\lib\cpp\Release\mosquittopp.lib"
|
||||
@ -93,6 +98,13 @@ Section "Files" SecInstall
|
||||
SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
|
||||
SectionEnd
|
||||
|
||||
Section "Visual Studio Runtime"
|
||||
SetOutPath "$INSTDIR"
|
||||
File "VC_redist.x86.exe"
|
||||
ExecWait '"$INSTDIR\VC_redist.x86.exe" /quiet /norestart'
|
||||
Delete "$INSTDIR\VC_redist.x86.exe"
|
||||
SectionEnd
|
||||
|
||||
Section "Service" SecService
|
||||
ExecWait '"$INSTDIR\mosquitto.exe" install'
|
||||
ExecWait 'sc start mosquitto'
|
||||
@ -104,36 +116,41 @@ Section "Uninstall"
|
||||
ExecWait '"$INSTDIR\mosquitto.exe" uninstall'
|
||||
Sleep 1000
|
||||
|
||||
Delete "$INSTDIR\mosquitto.dll"
|
||||
Delete "$INSTDIR\mosquitto.exe"
|
||||
Delete "$INSTDIR\mosquitto_ctrl.exe"
|
||||
Delete "$INSTDIR\mosquitto_passwd.exe"
|
||||
Delete "$INSTDIR\mosquitto_pub.exe"
|
||||
Delete "$INSTDIR\mosquitto_sub.exe"
|
||||
Delete "$INSTDIR\mosquitto_rr.exe"
|
||||
Delete "$INSTDIR\mosquitto.dll"
|
||||
Delete "$INSTDIR\mosquitto_sub.exe"
|
||||
Delete "$INSTDIR\mosquittopp.dll"
|
||||
Delete "$INSTDIR\mosquitto_dynamic_security.dll"
|
||||
Delete "$INSTDIR\aclfile.example"
|
||||
Delete "$INSTDIR\ChangeLog.txt"
|
||||
Delete "$INSTDIR\mosquitto.conf"
|
||||
Delete "$INSTDIR\pwfile.example"
|
||||
Delete "$INSTDIR\NOTICE.md"
|
||||
Delete "$INSTDIR\README.md"
|
||||
Delete "$INSTDIR\README-windows.txt"
|
||||
Delete "$INSTDIR\README-letsencrypt.md"
|
||||
;Delete "$INSTDIR\pthreadVC2.dll"
|
||||
Delete "$INSTDIR\libssl-1_1.dll"
|
||||
Delete "$INSTDIR\libcrypto-1_1.dll"
|
||||
Delete "$INSTDIR\SECURITY.md"
|
||||
Delete "$INSTDIR\edl-v10"
|
||||
Delete "$INSTDIR\epl-v20"
|
||||
Delete "$INSTDIR\mosquitto.ico"
|
||||
|
||||
Delete "$INSTDIR\cjson.dll"
|
||||
Delete "$INSTDIR\libcrypto-3.dll"
|
||||
Delete "$INSTDIR\libssl-3.dll"
|
||||
Delete "$INSTDIR\pthreadVC3.dll"
|
||||
Delete "$INSTDIR\uv.dll"
|
||||
Delete "$INSTDIR\websockets.dll"
|
||||
|
||||
Delete "$INSTDIR\devel\mosquitto.h"
|
||||
Delete "$INSTDIR\devel\mosquitto.lib"
|
||||
Delete "$INSTDIR\devel\mosquitto_broker.h"
|
||||
Delete "$INSTDIR\devel\mosquitto_plugin.h"
|
||||
Delete "$INSTDIR\devel\mosquittopp.h"
|
||||
Delete "$INSTDIR\devel\mosquittopp.lib"
|
||||
Delete "$INSTDIR\devel\mqtt_protocol.h"
|
||||
RMDir "$INSTDIR\devel\mosquitto"
|
||||
RMDir "$INSTDIR\devel"
|
||||
|
||||
Delete "$INSTDIR\Uninstall.exe"
|
||||
@ -151,4 +168,3 @@ LangString DESC_SecService ${LANG_ENGLISH} "Install mosquitto as a Windows servi
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecInstall} $(DESC_SecInstall)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SecService} $(DESC_SecService)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user