-
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (95 loc) · 3.36 KB
/
Copy pathci.yml
File metadata and controls
112 lines (95 loc) · 3.36 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
release:
types: [created]
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
artifact-suffix: linux-x64
shared-lib: libarkilian.so
static-lib: libarkilian.a
- os: macos-latest
artifact-suffix: darwin-x64
shared-lib: libarkilian.dylib
static-lib: libarkilian.a
- os: windows-latest
artifact-suffix: windows-x64
shared-lib: arkilian.dll
static-lib: arkilian.lib
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Install Dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
$vcpkgPath = "${{ runner.temp }}/vcpkg"
git clone https://github.com/microsoft/vcpkg.git $vcpkgPath
& "$vcpkgPath/bootstrap-vcpkg.bat"
& "$vcpkgPath/vcpkg" install curl:x64-windows
echo "VCPKG_ROOT=$vcpkgPath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" -DARKILIAN_BUILD_EXAMPLES=OFF
shell: pwsh
- name: Configure CMake (Unix)
if: matrix.os != 'windows-latest'
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DARKILIAN_BUILD_EXAMPLES=OFF
- name: Build
run: cmake --build build --config Release
- name: Upload Build Artifacts (Shared)
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ matrix.shared-lib }}
asset_name: ${{ matrix.shared-lib }}
asset_content_type: application/octet-stream
- name: Upload Build Artifacts (Static)
if: github.event_name == 'release'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./build/${{ matrix.static-lib }}
asset_name: ${{ matrix.static-lib }}
asset_content_type: application/octet-stream
- name: Upload Header
if: github.event_name == 'release' && matrix.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./src/class.h
asset_name: class.h
asset_content_type: text/plain
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libcurl4-openssl-dev
- name: Configure CMake
run: cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug -DARKILIAN_BUILD_EXAMPLES=ON
- name: Build
run: cmake --build build --config Debug
- name: Run Example
run: ./build/arkilian_example