You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mosquitto/.github/workflows/windows.yml

126 lines
3.8 KiB
YAML

name: Windows 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:
cjson:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
with:
repository: DaveGamble/cJSON
ref: v1.7.15
- name: Configure CMake cJSON
run: cmake -B ${{github.workspace}}/build64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DENABLE_CJSON_TEST=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_SHARED_AND_STATIC_LIBS=OFF -DCJSON_BUILD_SHARED_LIBS=OFF -DCJSON_OVERRIDE_BUILD_SHARED_LIBS=OFF -DCMAKE_GENERATOR_PLATFORM=x64
- name: Build cJSON
run: cmake --build ${{github.workspace}}/build64 --config ${{env.BUILD_TYPE}}
- name: Install cJSON
run: cmake --install ${{github.workspace}}/build64 --config ${{env.BUILD_TYPE}}
- name: Upload cJSON
uses: actions/upload-artifact@v3
with:
name: cjson-bin
path: C:\Program Files\cJSON
sqlite3:
runs-on: windows-2022
steps:
- uses: suisei-cn/actions-download-file@v1.0.1
id: sqlitesrc
name: Download sqlite source
with:
url: https://www.sqlite.org/2022/sqlite-amalgamation-3390200.zip
target: download/
- uses: suisei-cn/actions-download-file@v1.0.1
id: sqlitebin
name: Download sqlite dll
with:
url: https://www.sqlite.org/2022/sqlite-dll-win64-x64-3390200.zip
target: download/
- name: extract src
run: 7z e -o"C:\Program Files\sqlite" download\sqlite-amalgamation-3390200.zip
- name: extract binary
run: 7z e -o"C:\Program Files\sqlite" download\sqlite-dll-win64-x64-3390200.zip
- name: Set up Visual Studio shell
uses: egor-tensin/vs-shell@v2
with:
arch: x64
- name: create .lib
run: lib.exe /def:"C:\Program Files\sqlite\sqlite3.def" /machine:x64 /out:"C:\Program Files\sqlite\sqlite3.lib"
- name: Upload sqlite
uses: actions/upload-artifact@v3
with:
name: sqlite-bin
path: C:\Program Files\sqlite
mosquitto:
runs-on: windows-2022
needs:
- cjson
- sqlite3
env:
CJSON_DIR: C:\Program Files\cJSON
steps:
- uses: actions/checkout@v3
- name: install openssl
run: choco install openssl
- name: Download cJSON
uses: actions/download-artifact@v3
with:
name: cjson-bin
path: C:\Program Files\cJSON
- name: Download sqlite
uses: actions/download-artifact@v3
with:
name: sqlite-bin
path: C:\Program Files\sqlite
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build64 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DWITH_TESTS=OFF -DCMAKE_GENERATOR_PLATFORM=x64 -DCJSON_INCLUDE_DIR="C:/Program Files/cJSON/include" -DCJSON_LIBRARY="C:/Program Files/cJSON/lib/cjson.lib" -DSQLite3_INCLUDE_DIR="C:/Program Files/sqlite" -DSQLite3_LIBRARY="C:/Program Files/sqlite/sqlite3.lib"
- name: Build
run: cmake --build ${{github.workspace}}/build64 --config ${{env.BUILD_TYPE}}
- uses: suisei-cn/actions-download-file@v1.0.1
id: vcredist
name: Download VC redistributable
with:
url: https://aka.ms/vs/17/release/vc_redist.x64.exe
target: ${{github.workspace}}/installer/
- name: Installer
uses: joncloud/makensis-action@v3.7
with:
script-file: ${{github.workspace}}/installer/mosquitto64.nsi
- name: Upload installer to artifacts
uses: actions/upload-artifact/@v2
with:
name: installer
path: ${{ github.workspace }}/installer/mosquitto*.exe