-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (65 loc) · 2.13 KB
/
Copy pathbuild.yml
File metadata and controls
77 lines (65 loc) · 2.13 KB
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
name: Build BaseVar
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [created]
jobs:
build:
name: Build on ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: basevar-linux
- os: macos-latest
artifact_name: basevar-macos
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake autoconf automake libgtest-dev \
zlib1g-dev libbz2-dev liblzma-dev libcurl4-openssl-dev libssl-dev
- name: Install Dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install autoconf automake zlib bzip2 xz curl googletest openssl@3
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C Release --output-on-failure
- name: Prepare artifacts
run: |
mkdir -p dist
cp bin/basevar dist/${{matrix.artifact_name}}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{matrix.artifact_name}}
path: dist/${{matrix.artifact_name}}
- name: Upload Release Assets
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: dist/${{matrix.artifact_name}}
- name: Show artifact location
run: |
echo "Build artifacts have been uploaded to:"
echo "- Actions tab: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}"
if [["${{github.event_name}}" == "release"]]; then
echo "- Release page: ${{github.server_url}}/${{github.repository}}/releases/latest"
fi