-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (80 loc) · 2.63 KB
/
build.yml
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
name: Build
on:
push:
branches: [ master ]
env:
BUILD_TYPE: Release
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Upload Binaries
uses: actions/upload-artifact@v2
with:
path: ${{github.workspace}}/build/out/*
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Upload Binaries
uses: actions/upload-artifact@v2
with:
path: ${{github.workspace}}/build/out/*
build-osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}}
- name: Upload Binaries
uses: actions/upload-artifact@v2
with:
path: ${{github.workspace}}/build/out/*
deploy:
runs-on: ubuntu-latest
needs: [build-linux, build-windows, build-osx]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v4.1.7
with:
name: artifact
path: ${{github.workspace}}/build/out
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1.7.2
with:
dotnet-version: '5.0.x'
- name: Test
working-directory: ${{github.workspace}}/csharp
run: dotnet test -c Release
- name: Pack
working-directory: ${{github.workspace}}/csharp
run: dotnet pack -c Release
- name: Upload .nupkg
uses: actions/upload-artifact@v2
with:
path: ${{github.workspace}}/csharp/TinyParserMitsuba/bin/**/*.nupkg
- name: Publish on version change
uses: rohith/publish-nuget@v2
with:
PROJECT_FILE_PATH: csharp/TinyParserMitsuba/TinyParserMitsuba.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}