This repository was archived by the owner on Sep 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (72 loc) · 2.29 KB
/
cmake-multi-platform.yml
File metadata and controls
84 lines (72 loc) · 2.29 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
78
79
80
81
82
83
84
name: CMake on multiple platforms
on:
push:
tags:
- 'v*' # Trigger workflow on tag push matching v*, e.g., v1.0.0
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-11] # Using both Ubuntu and macOS
build_type: [Release]
c_compiler: [gcc, clang]
include:
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
artifact_name: chris-linux
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
artifact_name: chris-linux-clang
- os: macos-11
c_compiler: clang
cpp_compiler: clang++
artifact_name: chris-macos
exclude:
- os: ubuntu-latest
c_compiler: cl
- os: macos-11
c_compiler: gcc
- os: macos-11
c_compiler: cl
steps:
- uses: actions/checkout@v3 # Checkout the repository
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt update && sudo apt-get install -y make cmake libcurl4-openssl-dev
- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install cmake curl
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-D API_KEY="${{ secrets.API_KEY }}"
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact_name }}
path: ${{ steps.strings.outputs.build-output-dir }}/chris_exec
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v2
with:
path: artifacts