-
Notifications
You must be signed in to change notification settings - Fork 78
86 lines (71 loc) · 2.56 KB
/
Copy pathCPPBuild.yml
File metadata and controls
86 lines (71 loc) · 2.56 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
name: 'C++ Build'
on:
push:
branches:
- master
pull_request:
branches:
- '*'
jobs:
AngouriMathCpp:
strategy:
matrix:
include:
- os: windows-latest
flag: win-x64
- os: ubuntu-latest
flag: linux-x64
- os: macos-latest
flag: osx-x64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Setup .NET 10
uses: actions/setup-dotnet@v5
with:
dotnet-version: '10.x'
- name: 'Generating exports'
run: |
cd Sources/Utils
dotnet run -p Utils ExportsGenerator
- name: 'Install some libs for Linux'
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get install zlib1g-dev
sudo apt-get install libkrb5-dev
- name: 'Building the library into native for Windows'
if: ${{ matrix.os == 'windows-latest' }}
shell: cmd
run: |
cd Sources/Wrappers/AngouriMath.CPP.Exporting
mkdir ../AngouriMath.CPP.Importing/out-x64
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
dotnet publish -p:NativeLib=Shared -p:SelfContained=true -r ${{ matrix.flag }} -c release
- name: 'Building the library into native for Linux & MacOS'
if: ${{ matrix.os != 'windows-latest' }}
run: |
cd Sources/Wrappers/AngouriMath.CPP.Exporting
mkdir ../AngouriMath.CPP.Importing/out-x64
dotnet publish -p:NativeLib=Shared -p:SelfContained=true -r ${{ matrix.flag }} -c release
- name: 'Renaming the library for Linux'
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64
mv AngouriMath.CPP.Exporting.so libAngouriMath.CPP.Exporting.so
- name: 'Renaming the library for OS X'
if: ${{ matrix.os == 'macos-latest' }}
run: |
cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64
mv AngouriMath.CPP.Exporting.dylib libAngouriMath.CPP.Exporting.dylib
install_name_tool -id "@rpath/libAngouriMath.CPP.Exporting.dylib" libAngouriMath.CPP.Exporting.dylib
- name: 'Uploading artifacts'
uses: actions/upload-artifact@v6
with:
name: AngouriMath.CPP-${{ matrix.os }}-x64
path: ./Sources/Wrappers/AngouriMath.CPP.Importing
retention-days: 3
- name: 'Building AngouriMath.Importing'
run: |
cd Sources/Wrappers/AngouriMath.CPP.Importing
cmake -S . -B build
cmake --build build