-
Notifications
You must be signed in to change notification settings - Fork 51
65 lines (52 loc) · 1.5 KB
/
build-publish.yaml
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
name: Build and Publish
on:
push:
branches:
- main # Adjust to your main branch name
jobs:
build:
runs-on: ubuntu-latest # You can specify different OS and platforms here
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up CMake
uses: actions/setup-cmake@v2
with:
cmake-version: 3.x # Specify your desired CMake version
- name: Build and Test (Linux)
run: |
mkdir build
cd build
cmake ..
make
ctest
- name: Publish Artifact (Linux)
if: success()
uses: actions/upload-artifact@v2
with:
name: my-library-linux
path: build/my-library # Adjust the path and artifact name
build-windows:
runs-on: windows-latest # You can specify different OS and platforms here
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up CMake
uses: actions/setup-cmake@v2
with:
cmake-version: 3.0 # cmake version
- name: Build and Test (Windows)
run: |
mkdir build
cd build
cmake ..
cmake --build . --config Release
ctest
- name: Publish Artifact (Windows)
if: success()
uses: actions/upload-artifact@v2
with:
name: my-library-windows
path: build/Release/my-library.exe # Adjust the path and artifact name
# Add similar steps for other platforms (e.g., macOS)
# Define deployment steps here to release your library artifacts