Skip to content

Commit 2ff25a7

Browse files
authored
Merge pull request #5 from IvanSavenko/master
Add workflow for automatic build of msvc package via vcpkg
2 parents 96af062 + 17af3b5 commit 2ff25a7

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: VCMI - vcpkg dependencies
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
schedule:
9+
- cron: '0 2 * * 0' #every sunday 02:00
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- platform: msvc-x64
19+
triplet: x64-windows
20+
- platform: msvc-x86
21+
triplet: x86-windows
22+
23+
runs-on: windows-latest
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
steps:
29+
- name: Checkout vcpkg repository
30+
uses: actions/checkout@v4
31+
with:
32+
repository: 'microsoft/vcpkg'
33+
34+
# NOTE: disabling debug for both 32 and 64 bit triplets, so 64 host / 32 guest won't build debug version of 64-bit tools
35+
- name: Disable debug builds
36+
run: |
37+
echo 'set(VCPKG_BUILD_TYPE release)' >>triplets/x64-windows.cmake
38+
echo 'set(VCPKG_BUILD_TYPE release)' >>triplets/x86-windows.cmake
39+
40+
- name: Enable Windows 7 targeting
41+
run: |
42+
echo 'set(VCPKG_CXX_FLAGS "-D_WIN32_WINNT=0x0601 -DWINVER=0x0601")' >>triplets/x64-windows.cmake
43+
echo 'set(VCPKG_CXX_FLAGS "-D_WIN32_WINNT=0x0601 -DWINVER=0x0601")' >>triplets/x86-windows.cmake
44+
echo 'set(VCPKG_C_FLAGS "-D_WIN32_WINNT=0x0601 -DWINVER=0x0601")' >>triplets/x64-windows.cmake
45+
echo 'set(VCPKG_C_FLAGS "-D_WIN32_WINNT=0x0601 -DWINVER=0x0601")' >>triplets/x86-windows.cmake
46+
47+
- name: Initialize vcpkg
48+
run: |
49+
./bootstrap-vcpkg.bat
50+
51+
# NOTE: listing all boost components required by VCMI. Full boost is not suitable due to python being broken on 32-bit Win7
52+
- name: Build packages
53+
run: |
54+
./vcpkg.exe install tbb fuzzylite sdl2 sdl2-image sdl2-ttf sdl2-mixer[core,mpg123] qt5-base ffmpeg[core,avcodec,avformat,swresample,swscale] qt5-tools boost-filesystem boost-system boost-thread boost-program-options boost-locale boost-iostreams boost-headers boost-foreach boost-format boost-crc boost-logic boost-multi-array boost-ptr-container boost-heap boost-bimap boost-asio boost-stacktrace boost-assign boost-geometry boost-uuid boost-uuid boost-process --triplet '${{matrix.triplet}}'
55+
56+
- name: Export packages
57+
run: |
58+
./vcpkg.exe export tbb fuzzylite sdl2 sdl2-image sdl2-ttf sdl2-mixer qt5-base ffmpeg qt5-tools boost-filesystem boost-system boost-thread boost-program-options boost-locale boost-iostreams boost-headers boost-foreach boost-format boost-crc boost-logic boost-multi-array boost-ptr-container boost-heap boost-bimap boost-asio boost-stacktrace boost-assign boost-geometry boost-uuid boost-process --raw --triplet '${{matrix.triplet}}' --output=result/vcpkg
59+
60+
# We don't really need pdb's for tools and they eat A LOT of space
61+
# even pdb's for dependencies are extremely situational so we can consider removing pdb's entirely to reduce prebuilds size / install time
62+
- name: Trim pdb files from packages
63+
run: |
64+
find result/vcpkg/installed/*/tools -type f -name "*.pdb" -delete
65+
66+
- name: Created prebuilts package
67+
run: |
68+
tar --create --xz --file dependencies-${{matrix.platform}}.txz -C result vcpkg
69+
70+
- name: Log resulting packages
71+
run: ./vcpkg.exe list
72+
73+
- name: Upload prebuilts package
74+
uses: actions/upload-artifact@v4
75+
with:
76+
name: dependencies-${{matrix.platform}}
77+
path: ${{github.workspace}}/dependencies-${{matrix.platform}}.txz
78+
compression-level: 0

0 commit comments

Comments
 (0)