forked from GrognardsFromHell/OpenTemple.Native
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (131 loc) · 4.55 KB
/
ci.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on: [push]
jobs:
build-linux:
if: false # Currently disabled
name: Build Linux 64-bit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: 'recursive'
lfs: true
- run: sudo apt-get update && sudo apt-get install -y nasm libsdl2-dev
- run: mkdir build && cd build && cmake -DRUNTIME_ID=linux-x64 -DCMAKE_BUILD_TYPE=Release ..
- run: cmake --build build --config Release
- run: mkdir build-stripped && strip --strip-unneeded -o build-stripped/libOpenTemple.Native.so build/libOpenTemple.Native.so
- uses: actions/upload-artifact@v2
with:
name: native_lib_linux
path: 'build/libOpenTemple.Native.so'
- uses: actions/upload-artifact@v2
with:
name: native_lib_linux_stripped
path: 'build-stripped/libOpenTemple.Native.so'
build-windows:
name: Build Windows (${{ matrix.arch }})
runs-on: windows-latest
strategy:
matrix:
arch: [x64] #, arm64]
include:
- arch: x64
platform: x64
#- arch: arm64
# platform: arm64
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
lfs: true
- name: Build
run: |
cmake -B build -A $PLATFORM -DRUNTIME_ID=win-${PLATFORM} -DCMAKE_BUILD_TYPE=Release .
cmake --build build --config Release -t install
shell: bash
env:
PLATFORM: ${{ matrix.platform }}
- uses: actions/upload-artifact@v2
with:
name: native_lib_windows_${{ matrix.arch }}
path: build/nuget_files
build-macosx:
if: false # Currently disabled
name: Build MacOSX 64-bit
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
with:
submodules: 'recursive'
lfs: true
- run: brew install ninja nasm
- run: mkdir build && cd build && cmake -DRUNTIME_ID=osx-x64 -DCMAKE_BUILD_TYPE=Release -G Ninja ..
- run: cmake --build build --config Release
- run: mkdir build-stripped && strip -x -o build-stripped/libOpenTemple.Native.dylib build/libOpenTemple.Native.dylib
- uses: actions/upload-artifact@v2
with:
name: native_lib_macos
path: 'build/libOpenTemple.Native.dylib'
- uses: actions/upload-artifact@v2
with:
name: native_lib_macos_stripped
path: 'build-stripped/libOpenTemple.Native.dylib'
build-nuget-package:
name: Build Managed NuGet Package
needs: [build-windows] # build-linux, build-windows, build-macosx]
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
# Download all the dependents
# - uses: actions/download-artifact@v2
# with:
# name: native_lib_linux
# path: nuget_files
- uses: actions/download-artifact@v2
with:
name: native_lib_windows_x64
path: nuget_files
# - uses: actions/download-artifact@v2
# with:
# name: native_lib_windows_x86
# path: nuget_files
# - uses: actions/download-artifact@v2
# with:
# name: native_lib_macos
# path: nuget_files
- name: Restore
run: dotnet restore managed
- name: Build and Pack
run: |
dotnet msbuild -t:Clean,Build,Pack \
-p:Configuration=Release \
-p:Platform="Any CPU" \
-p:NuGetFiles=nuget_files \
-p:RepositoryUrl=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git \
-p:RepositoryType=git \
-p:RepositoryBranch=${GITHUB_REF} \
-p:RepositoryCommit=${GITHUB_SHA} \
-p:VersionSuffix=pre.${{ github.run_number }} \
managed
shell: bash
- uses: actions/upload-artifact@v2
with:
name: nuget_package
path: managed\Interop\bin\Release\*.nupkg
push-package:
name: Push NuGet Package
needs: [build-nuget-package]
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
with:
name: nuget_package
path: packages
- name: Install sleet
run: dotnet tool install -g sleet
- name: Upload Package
run: sleet push packages
env:
AWS_ACCESS_KEY_ID: ${{ secrets.OPENTEMPLE_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.OPENTEMPLE_AWS_SECRET_ACCESS_KEY }}