-
Notifications
You must be signed in to change notification settings - Fork 4
148 lines (128 loc) · 4.63 KB
/
build-vcpkg.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Build with vcpkg
on:
push:
branches:
- master
- v*
tags:
- v*
paths:
- cmake/**
- src/**
- CMakeLists.txt
pull_request:
paths:
- cmake/**
- src/**
- CMakeLists.txt
jobs:
job:
name: ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
max-parallel: 8
matrix:
name: [ubuntu-gcc, ubuntu-clang, macos-clang, windows-msvc]
buildtype: [Debug, Release]
luajit: [on, off]
include:
- name: windows-msvc
os: windows
cxx: cl.exe
cc: cl.exe
triplet: x64-windows
packages: >
boost-asio boost-iostreams boost-system boost-filesystem boost-variant boost-lockfree
lua luajit libmariadb pugixml cryptopp
- name: ubuntu-gcc
os: ubuntu
cxx: g++
cc: gcc
triplet: x64-linux
packages: >
boost-asio boost-iostreams boost-system boost-filesystem boost-variant boost-lockfree
lua libmariadb pugixml cryptopp
- name: ubuntu-clang
os: ubuntu
cxx: clang++
cc: clang
triplet: x64-linux
packages: >
boost-asio boost-iostreams boost-system boost-filesystem boost-variant boost-lockfree
lua libmariadb pugixml cryptopp
- name: macos-clang
os: macos
cxx: clang++
cc: clang
triplet: x64-osx
packages: >
boost-asio boost-iostreams boost-system boost-filesystem boost-variant boost-lockfree
lua libmariadb pugixml cryptopp
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Unshallow
run: git fetch --prune --unshallow
- name: Get latest CMake
# Using 'latest' branch, the latest CMake is installed.
uses: lukka/get-cmake@latest
- name: Ubuntu - install luajit, remove libmysqlclient-dev
run: |
sudo apt-get install libluajit-5.1-dev
sudo apt-get remove -y libmysqlclient-dev
if: contains( matrix.os, 'ubuntu')
- name: MacOS - install luajit pkgconfig
run: brew install luajit pkgconfig
if: contains( matrix.os, 'macos')
- name: Windows - remove C:/mysql*
run: rm -r -fo C:/mysql-5.7.21-winx64
if: contains( matrix.os, 'windows')
- uses: lukka/set-shell-env@v1
with:
CXX: ${{ matrix.cxx }}
CC: ${{ matrix.cc }}
- name: Run vcpkg
uses: lukka/run-vcpkg@v2
with:
vcpkgArguments: ${{ matrix.packages }}
vcpkgDirectory: ${{ runner.workspace }}/vcpkg/
vcpkgTriplet: ${{ matrix.triplet }}
vcpkgGitCommitId: 7db401cb1ef1fc559ec9f9ce814d064c328fd767
- name: Build with CMake
uses: lukka/run-cmake@v2
with:
useVcpkgToolchainFile: true
buildDirectory: ${{ runner.workspace }}/build
cmakeBuildType: ${{ matrix.buildtype }}
cmakeAppendedArgs: -DUSE_LUAJIT=${{ matrix.luajit }}
- name: dir
run: find $RUNNER_WORKSPACE
shell: bash
- name: Upload artifact binary
uses: actions/upload-artifact@v2
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ runner.workspace }}/build/tfs
if: "! contains( matrix.os, 'windows')"
- name: Upload artifact binary (exe)
uses: actions/upload-artifact@v2
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ runner.workspace }}/build/tfs.exe
if: contains( matrix.os, 'windows')
- name: Upload artifact binary (dlls)
uses: actions/upload-artifact@v2
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ runner.workspace }}/build/*.dll
if: contains( matrix.os, 'windows')
- name: Prepare datapack contents
run: find . -maxdepth 1 ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \;
shell: bash
- name: Upload datapack contents
uses: actions/upload-artifact@v2
with:
name: tfs-${{ matrix.name }}-${{ matrix.buildtype }}-luajit=${{ matrix.luajit }}-${{ github.sha }}
path: ${{ github.workspace }}