-
Notifications
You must be signed in to change notification settings - Fork 1
178 lines (152 loc) · 5.33 KB
/
builds-sdk.yaml
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
name: CMake build (SDK)
on: push
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows",
os: windows-latest,
path: "/c/ossia-sdk/llvm/bin",
common_flags: "-GNinja -DCMAKE_C_COMPILER=c:/ossia-sdk/llvm/bin/clang.exe -DCMAKE_CXX_COMPILER=c:/ossia-sdk/llvm/bin/clang++.exe -DCMAKE_UNITY_BUILD=1",
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
release_flags: "-DCMAKE_BUILD_TYPE=Release",
dependencies: "choco install -y ninja",
sdk: "/c/ossia-sdk",
score_sdk: "windows-sdk.zip"
}
- {
name: "Ubuntu",
os: ubuntu-latest,
path: "/opt/ossia-sdk/llvm/bin",
common_flags: "-DCMAKE_C_COMPILER=/opt/ossia-sdk/llvm/bin/clang -DCMAKE_CXX_COMPILER=/opt/ossia-sdk/llvm/bin/clang++ -DCMAKE_UNITY_BUILD=1",
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
release_flags: "-DCMAKE_BUILD_TYPE=Release",
dependencies: "sudo apt install libgl-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libxcomposite-dev libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libxcb-*-dev libX11-*-dev libz-dev libtinfo5 libxext-dev",
sdk: "/opt/ossia-sdk",
score_sdk: "linux-sdk.zip"
}
- {
name: "macOS",
os: macos-latest,
common_flags: "-DCMAKE_UNITY_BUILD=1",
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
release_flags: "-DCMAKE_BUILD_TYPE=Release",
sdk: "/opt/ossia-sdk-x86_64",
score_sdk: "mac-sdk.zip"
}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: "recursive"
path: addon
- uses: suisei-cn/[email protected]
name: Download fetch-sdk script
with:
url: "https://github.com/ossia/score/raw/master/tools/fetch-sdk.sh"
target: .
- name: Install dependencies
shell: bash
run: |
${{ matrix.config.dependencies }}
- name: Download ossia SDK
shell: bash
run: |
chmod +x fetch-sdk.sh
./fetch-sdk.sh
- name: Download score headers
uses: robinraju/[email protected]
with:
repository: "ossia/score"
tag: "continuous"
fileName: ${{ matrix.config.score_sdk }}
- name: Extract score headers
shell: bash
run: |
cmake -E tar xzf ${{ matrix.config.score_sdk }}
- name: Build debug
shell: bash
run: |
mkdir build-debug
cd build-debug
if [[ "${{ matrix.config.path }}" != "" ]]; then
export PATH=${{ matrix.config.path }}:$PATH
fi
cmake ../addon \
-DCMAKE_MODULE_PATH=../usr/lib/cmake/score \
-DSCORE_SDK=$PWD/../usr \
-DOSSIA_SDK=${{ matrix.config.sdk }} \
${{ matrix.config.common_flags }} \
${{ matrix.config.debug_flags }}
cmake --build .
- name: Build release
shell: bash
run: |
mkdir build-release
cd build-release
if [[ "${{ matrix.config.path }}" != "" ]]; then
export PATH=${{ matrix.config.path }}:$PATH
fi
cmake ../addon \
-DCMAKE_MODULE_PATH=../usr/lib/cmake/score \
-DSCORE_SDK=$PWD/../usr \
-DOSSIA_SDK=${{ matrix.config.sdk }} \
-DCMAKE_INSTALL_PREFIX=install \
${{ matrix.config.common_flags }} \
${{ matrix.config.release_flags }}
cmake --build .
cmake --build . --target install
- name: Upload release
uses: actions/upload-artifact@v3
with:
name: plugin-${{ matrix.config.os }}
path: |
build-release/install/plugins
build-release/install/lib
upload:
name: Combine
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: "recursive"
path: addon
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3
- name: Create addon release
shell: bash
run: |
pwd
ls
find .
mkdir deploy
find . -name '*.so' -exec cp {} deploy/ \;
find . -name '*.dylib' -exec cp {} deploy/ \;
find . -name '*.dll' -exec cp {} deploy/ \;
ls deploy/
cd deploy/
WIN32_PLUGIN=$(basename *.dll)
LINUX_PLUGIN=$(basename *.so)
MACOS_PLUGIN=$(basename *.dylib)
cat ../addon/addon.json \
| jq \
--arg win64 "$WIN32_PLUGIN" \
--arg linux64 "$LINUX_PLUGIN" \
--arg darwin64 "$MACOS_PLUGIN" \
'. + { "windows-amd64": $win64, "linux-amd64": $linux64, "darwin-amd64": $darwin64 }' \
> localaddon.json
cat localaddon.json
cp -rf ../addon/LICENSE* .
cp -rf ../addon/README* .
- name: Upload release
uses: actions/upload-artifact@v3
with:
name: plugin
path: deploy