This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 325
80 lines (69 loc) · 2.91 KB
/
build-ubuntu.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
---
name: Build on Ubuntu
on: [push, pull_request]
jobs:
job:
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
buildtype: [Debug, Release]
include:
- os: ubuntu-18.04
triplet: x64-linux
- os: ubuntu-20.04
triplet: x64-linux
steps:
- uses: actions/checkout@v2
- uses: lukka/get-cmake@latest
- name: Install Dependencies
run: >
sudo apt-get update && sudo apt-get install ccache build-essential
libluajit-5.1-dev zip
- name: CCache
id: ccache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ matrix.os }}-${{ matrix.buildtype }}-${{ hashFiles('**/src') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.buildtype }}-${{ hashFiles('**/src') }}
${{ matrix.os }}-${{ matrix.buildtype }}-
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@v7
with:
setupOnly: true
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
appendedCacheKey: ${{ hashFiles( '**/vcpkg.json' ) }}
vcpkgTriplet: ${{ matrix.triplet }}
additionalCachedPaths: ${{ github.workspace }}/build/vcpkg_installed
vcpkgGitCommitId: b9cd2a7958dec657fb869ec487d2a98cf39a8d48
- name: 'Run CMake with Ninja, install dependencies with vcpkg, build with CMake'
uses: lukka/run-cmake@v3
with:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: ${{ github.workspace }}/build/
cmakeBuildType: ${{ matrix.buildtype }}
- name: Clean workspace
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
shell: bash
run: |
mv ${{ github.workspace }}/build/bin/otbr ${{ github.workspace }}/otbr
find . -maxdepth 1 ! -name otbr ! -name data ! -name config.lua.dist ! -name key.pem ! -name LICENSE ! -name README.md ! -name schema.sql -exec rm -r {} \;
- name: Prepare datapack contents
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
shell: bash
run: |
mv config.lua.dist config.lua
unzip -o data/world/world.zip -d data/world/
rm data/world/world.zip
cd ..
zip -r otservbr.zip otservbr-global-archived
- name: Upload binary
if: ${{ matrix.buildtype == 'Release' && github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/test' }}
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-otbr-amd64-${{ matrix.buildtype }}-${{ github.sha }}
path: ${{ runner.workspace }}/otservbr.zip