-
Notifications
You must be signed in to change notification settings - Fork 60
116 lines (97 loc) · 3.72 KB
/
build.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
113
114
115
116
name: Build
on:
workflow_dispatch:
push:
tags:
- 'v*.*.*'
branches:
- 'master'
paths:
- '**.hpp'
- '**.cpp'
- '**.h'
- '**.c'
- '**CMakeLists.txt'
- '.github/workflows/build.yml'
pull_request:
branches:
- 'master'
paths:
- '**.hpp'
- '**.cpp'
- '**.h'
- '**.c'
- '**CMakeLists.txt'
- '.github/workflows/build.yml'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-20.04]
build-type: [Debug, Release]
include:
- os: windows-latest
cmake-args: '-AWin32 -Thost=x86 -DGH_ACBUILD=TRUE -DUSING_BOOST_NO_CONAN=TRUE -DUSING_OPENSSL_NO_CONAN=TRUE -DBoost_NO_BOOST_CMAKE=ON'
- os: ubuntu-20.04
cmake-args: '-DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32 -DGH_ACBUILD=TRUE'
runs-on: ${{ matrix.os }}
env:
BUILD_TYPE: ${{ matrix.build-type }}
CMAKE_BUILD_PARALLEL_LEVEL: 2
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set env
run: echo "REPO_TAG=$(git describe --tags --always)" >> $GITHUB_ENV
shell: bash
- name: get-cmake
uses: lukka/[email protected]
- if: runner.os == 'Windows'
name: Install boost
run: |
$Url = "https://sourceforge.net/projects/boost/files/boost-binaries/1.73.0/boost_1_73_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"
- if: runner.os == 'Windows'
name: Set boost env
run: echo "BOOST_ROOT=C:\\hostedtoolcache\windows\\Boost" >> $GITHUB_ENV
shell: bash
- if: runner.os == 'Windows'
name: Install openssl
run: choco install openssl --forcex86 | out-null
- if: runner.os == 'Windows'
name: Setup openssl envvar
run: echo "OPENSSL_ROOT=C:\\Program Files (x86)\\OpenSSL-Win32" >> $GITHUB_ENV
- if: runner.os == 'Linux'
name: Install gcc/g++-multilib
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt install gcc-9-multilib g++-9-multilib libstdc++-10-dev:i386
- name: Get python
uses: actions/setup-python@v2
with:
python-version: 3.9.0 # SemVer's version range syntax
- name: Install conan
run: |
python -m pip install --upgrade pip
pip install conan
conan remote add conan-transit-legacy https://api.bintray.com/conan/conan/conan-transit
- name: Generate build files
run: mkdir build && cd build && cmake .. ${{ matrix.cmake-args }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DDCC_VERSION="${{ env.REPO_TAG }}" -DBOOST_ROOT=${{ env.BOOST_ROOT }} -DOPENSSL_ROOT=${{ env.OPENSSL_ROOT }}
- if: runner.os == 'Windows'
name: Build Windows
run: cd build && cmake --build . --config ${{ matrix.build-type }}
- if: runner.os == 'Linux'
name: Build Linux
run: cd build && cmake --build .
- name: Zip artifact
run: Compress-Archive ${{ runner.workspace }}/samp-discord-connector/build/artifact/* ${{ runner.workspace }}/samp-discord-connector/build/artifact/discord-connector-${{ env.REPO_TAG }}-${{ runner.os }}-${{ matrix.build-type }}.zip
shell: pwsh
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: discord-connector-${{ env.REPO_TAG }}-${{ runner.os }}-${{ matrix.build-type }}
path: ${{ runner.workspace }}/samp-discord-connector/build/artifact/discord-connector-${{ env.REPO_TAG }}-${{ runner.os }}-${{ matrix.build-type }}.zip