-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (49 loc) · 2.06 KB
/
windows_executable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build Windows executable
on:
create:
tags:
- 'v*'
env:
BUILD_TYPE: Release
VCPKG_CMAKE_TOOLCHAIN: C:\vcpkg\scripts\buildsystems\vcpkg.cmake
VCPKG_INCLUDE_DIR: C:\vcpkg\installed\x64-windows-static\include
MSBUILD_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.com
jobs:
build:
name: Build Windows executable
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Qt
uses: jurplel/[email protected]
- name: Install dependencies (Choco)
run: choco install -y ninja cmake
- name: Install dependencies (VCPKG)
run: vcpkg install boost-system:x64-windows-static boost-format:x64-windows-static cpprestsdk:x64-windows-static nlohmann-json:x64-windows-static
- name: System wide VCPKG integrations
run: vcpkg integrate install
- name: Add VCPKG and Qt installation path to PATH variable
run: $Env:PATH += ';C:\vcpkg;${{env.VCPKG_INCLUDE_DIR}};${{env.Qt5_Dir}}'
- name: Create GetIt solution
run: cmake . -G 'Visual Studio 17 2022' -Dpackaging=true -Duse_installed_dependencies=true -DCMAKE_CXX_FLAGS='/w' -DCMAKE_PREFIX_PATH=${{env.Qt5_Dir}} -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_CMAKE_TOOLCHAIN}} -DVCPKG_TARGET_TRIPLET='x64-windows-static' -DBoost_INCLUDE_DIR=${{env.VCPKG_INCLUDE_DIR}}
- name: Build GetIt
shell: cmd
run: "%MSBUILD_PATH% GetIt.sln /Build"
- name: Add Qt dependencies to built executable
run: |
$windeployqt = '${{env.Qt5_Dir}}\bin\windeployqt.exe'
& $windeployqt ./bin/GetIt.exe
- name: Zip GetIt executable
run: 7z a -tzip getit.zip ./bin/GetIt.exe
- name: Upload Windows executable as build artifact
uses: actions/[email protected]
with:
name: GetIt-Windows-x64.zip
path: ./getit.zip
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./getit.zip
asset_name: GetIt-Windows-x64.zip
tag: ${{ github.ref }}