-
Notifications
You must be signed in to change notification settings - Fork 37
112 lines (102 loc) · 5.28 KB
/
cmake.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
109
110
111
112
name: build and test
on: [push]
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
include:
- platform: ubuntu-18.04
compiler: g++-9
compiler_c: gcc-9
- platform: ubuntu-18.04
compiler: clang++-9
compiler_c: clang-9
- platform: windows-2019
compiler: msvc2019 ## == vs 16
compiler_c: msvc2019
runs-on: ${{ matrix.platform }}
name: ${{ matrix.platform }}-${{ matrix.compiler }}
steps:
- uses: actions/checkout@v2
- name: "release dependency: linuxdeployqt (linux)"
run: |
wget "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -O "${{ runner.workspace }}/linuxdeployqt"
chmod +x "${{ runner.workspace }}/linuxdeployqt"
if: ${{ matrix.platform == 'ubuntu-18.04' }}
- name: "dependency: boost (linux)"
run: sudo apt update && sudo apt install -y libboost-filesystem-dev libboost-system-dev libboost-test-dev libboost-thread-dev libboost-dev
if: ${{ matrix.platform == 'ubuntu-18.04' }}
- name: "dependency: boost (windows)"
run: |
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.72.0/boost_1_72_0-msvc-14.2-64.exe"
(New-Object System.Net.WebClient).DownloadFile($Url, "$env:TEMP\boost.exe")
Start-Process -Wait -FilePath "$env:TEMP\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=C:\hostedtoolcache\windows\Boost\1.72.0\x86_64"
if: ${{ matrix.platform == 'windows-2019' }}
- name: "dependency: boost (windows) - env variable"
run: echo "BOOST_ROOT=C:\hostedtoolcache\windows\Boost\1.72.0\x86_64" >> $GITHUB_ENV
shell: bash
if: ${{ matrix.platform == 'windows-2019' }}
- name: "dependency: qt5 (linux)"
run: sudo apt update && sudo apt install -y qtbase5-dev qt5-default
if: ${{ matrix.platform == 'ubuntu-18.04' }}
- name: "dependency: qt5 (windows)"
uses: jurplel/install-qt-action@v2
with:
version: 5.15.1
arch: win64_msvc2019_64
if: ${{ matrix.platform == 'windows-2019' }}
- name: "dependency: stormlib"
run: |
git clone "https://github.com/ladislav-zezula/StormLib" "${{ runner.workspace }}/stormlib"
cmake -B "${{ runner.workspace }}/stormlib/build" -S "${{ runner.workspace }}/stormlib" -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_C_COMPILER=${{ matrix.compiler_c }} -DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/stormlib/install" -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build "${{ runner.workspace }}/stormlib/build" --config RelWithDebInfo
cmake --install "${{ runner.workspace }}/stormlib/build" --config RelWithDebInfo
- name: "configure"
run: cmake -Wdev -Wdeprecated --warn-uninitialized -B "${{ github.workspace }}/build" -S "${{ github.workspace }}" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_PREFIX_PATH="${{ runner.workspace }}/stormlib/install"
- name: "build"
run: cmake --build "${{ github.workspace }}/build" --config RelWithDebInfo
- name: "install"
run: cmake --install "${{ github.workspace }}/build" --prefix "${{ github.workspace }}/install" --config RelWithDebInfo
- name: "release: appimage (linux)"
run: |
echo '[Desktop Entry]' > "${{ github.workspace }}/install/default.desktop"
echo 'Type=Application' >> "${{ github.workspace }}/install/default.desktop"
echo 'Name=Noggit 3' >> "${{ github.workspace }}/install/default.desktop"
echo 'Icon=default' >> "${{ github.workspace }}/install/default.desktop"
echo 'Categories=Game;' >> "${{ github.workspace }}/install/default.desktop"
"${{ runner.workspace }}/linuxdeployqt" "${{ github.workspace }}/install/noggit" -appimage -bundle-non-qt-libs -no-strip -verbose=2
if: ${{ matrix.platform == 'ubuntu-18.04' }}
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-appimage
path: Noggit*.AppImage
if: ${{ matrix.platform == 'ubuntu-18.04' }}
- run: |
mkdir dependencies/
cp -av "${{ env.Qt5_Dir }}/bin/"*"dll" dependencies/
if: ${{ matrix.platform == 'windows-2019' }}
shell: bash
- run: |
mkdir dependencies/plugins/
cp -av "${{ env.QT_PLUGIN_PATH }}/" dependencies/
if: ${{ matrix.platform == 'windows-2019' }}
shell: bash
- uses: vimtor/action-zip@v1
with:
dest: noggit-${{ matrix.platform }}-${{ matrix.compiler }}-dependencies-${{ github.sha }}.zip
files: dependencies/
if: ${{ matrix.platform == 'windows-2019' }}
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}-dependencies
path: noggit-${{ matrix.platform }}-${{ matrix.compiler }}-dependencies-${{ github.sha }}.zip
if: ${{ matrix.platform == 'windows-2019' }}
- uses: vimtor/action-zip@v1
with:
dest: noggit-${{ matrix.platform }}-${{ matrix.compiler }}-${{ github.sha }}.zip
files: install
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.platform }}-${{ matrix.compiler }}
path: noggit-${{ matrix.platform }}-${{ matrix.compiler }}-${{ github.sha }}.zip