-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (53 loc) · 2.1 KB
/
build-and-release.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
name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, fedora-latest, centos-latest]
include:
- os: ubuntu-latest
install: sudo apt-get update && sudo apt-get install -y libboost-all-dev clang
- os: windows-latest
install: |
choco install llvm
powershell -Command "Invoke-WebRequest -Uri 'https://boostorg.jfrog.io/artifactory/main/release/1.80.0/binaries/boost_1_80_0-msvc-14.1-64.exe' -OutFile 'boost_installer.exe'"
powershell -Command "Start-Process 'boost_installer.exe' -ArgumentList '/S' -Wait"
set PATH=C:\local\boost_1_80_0\lib64-msvc-14.1;%PATH%
- os: fedora-latest
install: sudo dnf install -y clang boost-devel
- os: centos-latest
install: sudo yum install -y clang boost-devel
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Clang
if: matrix.os == 'windows-latest'
uses: egor-tensin/setup-clang@v1
- name: Install dependencies
run: ${{ matrix.install }}
- name: Build project
run: |
if [ "${{ matrix.os }}" == "windows-latest" ]; then
clang++ -o cmr_cache.exe main.cpp -I./vendor/yaml -I"C:/local/boost_1_80_0" -L"C:/local/boost_1_80_0/lib64-msvc-14.1" -lboost_system-vc141-mt-x64-1_80 -lpthread -std=c++17 -O3
else
clang++ -o cmr_cache main.cpp -I./vendor/yaml -lboost_system -lpthread -std=c++17 -O3
fi
- name: Create Release Archive
run: |
mkdir -p release
if [ "${{ matrix.os }}" == "windows-latest" ]; then
cp cmr_cache.exe release/
else
cp cmr_cache release/
fi
tar -czf cmr_cache_${{ matrix.os }}.tar.gz release
- name: Upload Release Archive
uses: actions/upload-artifact@v3
with:
name: cmr_cache_${{ matrix.os }}
path: cmr_cache_${{ matrix.os }}.tar.gz