Skip to content

Commit 1781a15

Browse files
committed
actions: update to shared action code
1 parent 95f98c4 commit 1781a15

File tree

4 files changed

+160
-379
lines changed

4 files changed

+160
-379
lines changed

.github/workflows/builds-dev.yaml

Lines changed: 59 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
name: CMake build (dev)
22

3-
on: push
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- main
9+
- dev
10+
- develop
11+
tags:
12+
- v*
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: true
417

518
jobs:
619
build:
7-
name: ${{ matrix.config.name }}
20+
name: "Dev ${{ matrix.config.name }}"
821
runs-on: ${{ matrix.config.os }}
922
strategy:
1023
fail-fast: false
@@ -13,116 +26,87 @@ jobs:
1326
- {
1427
name: "Windows",
1528
os: windows-latest,
16-
path: "/c/ossia-sdk/llvm/bin",
17-
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",
18-
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
19-
release_flags: "-DCMAKE_BUILD_TYPE=Release",
20-
dependencies: "choco install -y ninja",
21-
sdk: "/c/ossia-sdk",
29+
dependencies: "curl -L -O https://github.com/ninja-build/ninja/releases/download/v1.13.1/ninja-win.zip && unzip ninja-win.zip",
30+
additional_flags: "-GNinja"
2231
}
2332
- {
2433
name: "Ubuntu",
2534
os: ubuntu-latest,
26-
path: "/opt/ossia-sdk/llvm/bin",
27-
common_flags: "-DCMAKE_C_COMPILER=/opt/ossia-sdk/llvm/bin/clang -DCMAKE_CXX_COMPILER=/opt/ossia-sdk/llvm/bin/clang++ -DCMAKE_UNITY_BUILD=1",
28-
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
29-
release_flags: "-DCMAKE_BUILD_TYPE=Release",
30-
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",
31-
sdk: "/opt/ossia-sdk",
35+
dependencies: "sudo apt install -yqq 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 libtinfo6 libxext-dev",
36+
additional_flags: ""
3237
}
3338
- {
3439
name: "macOS",
3540
os: macos-latest,
36-
common_flags: "-DCMAKE_UNITY_BUILD=1",
37-
debug_flags: "-DCMAKE_BUILD_TYPE=Debug",
38-
release_flags: "-DCMAKE_BUILD_TYPE=Release",
39-
sdk: "/opt/ossia-sdk-x86_64",
41+
dependencies: "",
42+
additional_flags: ""
4043
}
4144
steps:
42-
- name: Checkout code
43-
uses: actions/checkout@v2
45+
- name: Checkout addon
46+
uses: actions/checkout@v4
4447
with:
4548
submodules: "recursive"
4649
path: addon
4750

4851
- name: Checkout score
49-
uses: actions/checkout@v2
52+
uses: actions/checkout@v4
5053
with:
5154
repository: ossia/score
5255
submodules: "recursive"
5356
path: score
5457

5558
- name: Install dependencies
59+
if: matrix.config.dependencies != ''
5660
shell: bash
5761
run: |
5862
${{ matrix.config.dependencies }}
5963
60-
- name: Download SDK
61-
shell: bash
62-
run: |
63-
cd score
64-
tools/fetch-sdk.sh
64+
- name: Download OSSIA SDK
65+
id: ossia-sdk
66+
uses: ossia/actions/download-ossia-sdk@master
67+
with:
68+
score-path: score
6569

6670
- name: Build debug
67-
shell: bash
68-
run: |
69-
mkdir build-debug
70-
cd build-debug
71-
72-
if [[ "${{ matrix.config.path }}" != "" ]]; then
73-
export PATH=${{ matrix.config.path }}:$PATH
74-
fi
75-
76-
cmake ../addon \
77-
-DCMAKE_MODULE_PATH=../score/cmake \
78-
-DSCORE_SOURCE_DIR=../score \
79-
-DOSSIA_SDK=${{ matrix.config.sdk }} \
80-
${{ matrix.config.common_flags }} \
81-
${{ matrix.config.debug_flags }}
82-
83-
cmake --build .
71+
uses: ossia/actions/build-addon@master
72+
with:
73+
addon-path: addon
74+
build-type: Debug
75+
score-path: score
76+
ossia-sdk-path: ${{ steps.ossia-sdk.outputs.sdk-path }}
77+
additional-flags: ${{ matrix.config.additional_flags }}
8478

8579
- name: Build release
86-
shell: bash
87-
run: |
88-
mkdir build-release
89-
cd build-release
90-
91-
if [[ "${{ matrix.config.path }}" != "" ]]; then
92-
export PATH=${{ matrix.config.path }}:$PATH
93-
fi
94-
95-
cmake ../addon \
96-
-DCMAKE_MODULE_PATH=../score/cmake \
97-
-DSCORE_SOURCE_DIR=../score \
98-
-DOSSIA_SDK=${{ matrix.config.sdk }} \
99-
-DCMAKE_INSTALL_PREFIX=install \
100-
${{ matrix.config.common_flags }} \
101-
${{ matrix.config.release_flags }}
102-
103-
cmake --build .
104-
cmake --build . --target install
80+
uses: ossia/actions/build-addon@master
81+
with:
82+
addon-path: addon
83+
build-type: Release
84+
score-path: score
85+
ossia-sdk-path: ${{ steps.ossia-sdk.outputs.sdk-path }}
86+
additional-flags: ${{ matrix.config.additional_flags }}
10587

10688
- name: Upload release
107-
uses: actions/upload-artifact@v3
89+
uses: actions/upload-artifact@v4
10890
with:
10991
name: plugin-${{ matrix.config.os }}
11092
path: |
111-
build-release/install/plugins
93+
build-Release/install/plugins
11294
113-
upload:
114-
name: Combine
95+
package:
96+
name: Package
11597
needs: build
116-
11798
runs-on: ubuntu-latest
11899
steps:
119-
- name: Download all workflow run artifacts
120-
uses: actions/download-artifact@v3
100+
- name: Checkout addon
101+
uses: actions/checkout@v4
102+
with:
103+
submodules: "recursive"
121104

122-
- name: ls
123-
shell: bash
124-
run: |
125-
pwd
126-
ls
127-
find .
105+
- name: Package addon
106+
uses: ossia/actions/package-addon@master
128107

108+
- name: Upload package
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: plugin
112+
path: deploy

0 commit comments

Comments
 (0)