-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (91 loc) · 3.74 KB
/
build_with_visualstudio.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Visual Studio build
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: windows-latest
steps:
- name: Get current code from Git repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Add MSBuild to PATH
uses: microsoft/[email protected]
- name: Cache 3rdparty libs
id: cache-3rdparty
uses: actions/cache@v3
with:
path: |
derived/3rdparty
derived/*/3rdparty
key: ${{ github.ref }}-${{ hashFiles('build/3rdparty/3rdparty.props') }}
- name: Install prerequisites (wget)
if: steps.cache-3rdparty.outputs.cache-hit != 'true'
run: choco install wget
- name: Get 3rdparty source code
if: steps.cache-3rdparty.outputs.cache-hit != 'true'
run: |
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.1/wxWidgets-3.2.1.7z
wget https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.9.14/libxml2-v2.9.14.zip
- name: Extract 3rdparty source code
if: steps.cache-3rdparty.outputs.cache-hit != 'true'
shell: cmd
run: |
mkdir derived\3rdparty\src
cd derived\3rdparty\src
7z x ${{ github.workspace }}\libxml2-v2.9.14.zip
7z x ${{ github.workspace }}\wxWidgets-3.2.1.7z -o"wxWidgets-3.2.1"
- name: Build 3rdparty stuff
if: steps.cache-3rdparty.outputs.cache-hit != 'true'
run: msbuild -p:Configuration="Unicode Release" -p:Platform=x64 build\3rdparty\3rdparty.sln
- name: Set up developer prompt for nmake use to build wxWidgets libs
if: steps.cache-3rdparty.outputs.cache-hit != 'true'
uses: ilammy/msvc-dev-cmd@v1
- name: Build wxWidgets libs
if: steps.cache-3rdparty.outputs.cache-hit != 'true'
shell: cmd
run: |
cd derived\3rdparty\src\wxWidgets-3.2.1\build\msw
nmake /f makefile.vc BUILD=release TARGET_CPU=X64 RUNTIME_LIBS=static
- name: Install wxWidgets libs
if: steps.cache-3rdparty.outputs.cache-hit != 'true'
shell: cmd
run: |
mkdir derived\x64-VC-Unicode Release\3rdparty\install\lib\
cd derived\x64-VC-Unicode Release\3rdparty\install\lib\
xcopy "${{ github.workspace }}\derived\3rdparty\src\wxWidgets-3.2.1\lib\vc_x64_lib" . /y
- name: Build Catapult
run: msbuild -p:Configuration="Unicode Release" -p:Platform=x64 build\msvc\wxCatapult.sln /m
- name: Determine version and redistributable paths and names
shell: bash
id: catapult
run: |
CATAPULT_VERSION=`python3 build/version.py`
echo "version=$CATAPULT_VERSION" >> $GITHUB_OUTPUT
echo "target_file=catapult-$CATAPULT_VERSION-Windows-VC-x64-bin" >> $GITHUB_OUTPUT
echo "target_file_pdb=catapult-$CATAPULT_VERSION-Windows-VC-x64-pdb" >> $GITHUB_OUTPUT
- name: Prepare redistributable
shell: bash
run: |
mkdir -p derived/dist/Catapult
mkdir derived/dist/Catapult/bin
cp "derived/x64-VC-Unicode Release/install/catapult.exe" derived/dist/Catapult/bin
cp -r doc derived/dist/Catapult
cp -r resources derived/dist/Catapult
cp -r "derived/x64-VC-Unicode Release/install/dialogs" derived/dist/Catapult/resources
mkdir derived/dist/Catapult/resources/icons
cp src/catapult.xpm derived/dist/Catapult/resources/icons
cp README derived/dist/Catapult/doc
- name: Upload Windows VC redistributable
uses: actions/upload-artifact@v3
with:
name: ${{ steps.catapult.outputs.target_file }}.zip
path: derived/dist
- name: Upload Windows VC debug symbols
uses: actions/upload-artifact@v3
with:
name: ${{ steps.catapult.outputs.target_file_pdb }}.zip
path: derived/**/*.pdb