-
-
Notifications
You must be signed in to change notification settings - Fork 0
145 lines (122 loc) · 5.36 KB
/
build-action.yml
File metadata and controls
145 lines (122 loc) · 5.36 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
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
name: Build All
on:
workflow_dispatch:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
BUILD_TYPE: Release
BUILD_DIR: Builds
DISPLAY: :0
HOMEBREW_NO_INSTALL_CLEANUP: 1
SCCACHE_GHA_ENABLED: true
SCCACHE_CACHE_MULTIARCH: 1
defaults:
run:
shell: bash
jobs:
build_and_test:
# don't double run on PRs
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # show all errors for each platform (vs. cancel jobs on error)
matrix:
include:
- name: Linux
os: ubuntu-22.04
pluginval-binary: ./pluginval
extra-flags: -G Ninja
- name: macOS
os: macos-14
pluginval-binary: pluginval.app/Contents/MacOS/pluginval
extra-flags: -G Ninja -DCMAKE_OSX_ARCHITECTURES="arm64"
- name: Windows
os: windows-latest
pluginval-binary: ./pluginval.exe
steps:
# Setup MSVC toolchain and developer command prompt (Windows)
- uses: ilammy/msvc-dev-cmd@v1
# Use clang on Linux so we don't introduce a 3rd compiler (Windows and macOS use MSVC and Clang)
- name: Set up Clang
if: runner.os == 'Linux'
uses: egor-tensin/setup-clang@v1
# This also starts up our "fake" display (Xvfb), needed for pluginval
- name: Install JUCE's Linux Deps
if: runner.os == 'Linux'
run: |
sudo apt-get update && sudo apt install libasound2-dev libx11-dev libxinerama-dev libxext-dev libfreetype6-dev libwebkit2gtk-4.0-dev libglu1-mesa-dev xvfb ninja-build libcurl4-openssl-dev
sudo /usr/bin/Xvfb $DISPLAY &
- name: Install Ninja (Windows)
if: runner.os == 'Windows'
run: choco install ninja
- name: Install macOS Deps
if: ${{ matrix.name == 'macOS' }}
run: brew install ninja osxutils
# This block can be removed once 15.1 is default (JUCE requires it when building on macOS 14)
- name: Use latest Xcode on system (macOS)
if: ${{ matrix.name == 'macOS' }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Cache the build
uses: mozilla-actions/sccache-action@v0.0.9
- name: Configure
run: cmake -B ${{ env.BUILD_DIR }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ${{ matrix.extra-flags }} .
- name: Build
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.BUILD_TYPE }}
#- name: Test & Benchmarks
# working-directory: ${{ env.BUILD_DIR }}
# run: ctest --verbose --output-on-failure
- name: Read in .env from CMake # see GitHubENV.cmake
run: |
cat .env # show us the config
cat .env >> $GITHUB_ENV # pull in our PRODUCT_NAME, etc
- name: Set additional env vars for next steps
run: |
ARTIFACTS_PATH=${{ env.BUILD_DIR }}/${{ env.PROJECT_NAME }}_artefacts/${{ env.BUILD_TYPE }}
echo "ARTIFACTS_PATH=$ARTIFACTS_PATH" >> $GITHUB_ENV
echo "VST3_PATH=$ARTIFACTS_PATH/VST3/${{ env.PRODUCT_NAME }}.vst3" >> $GITHUB_ENV
echo "AU_PATH=$ARTIFACTS_PATH/AU/${{ env.PRODUCT_NAME }}.component" >> $GITHUB_ENV
echo "AUV3_PATH=$ARTIFACTS_PATH/AUv3/${{ env.PRODUCT_NAME }}.appex" >> $GITHUB_ENV
echo "CLAP_PATH=$ARTIFACTS_PATH/CLAP/${{ env.PRODUCT_NAME }}.clap" >> $GITHUB_ENV
echo "STANDALONE_PATH=$ARTIFACTS_PATH/Standalone/${{ env.PRODUCT_NAME }}.app" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${{ env.PRODUCT_NAME }}-${{ env.VERSION }}-${{ matrix.name }}" >> $GITHUB_ENV
- name: Pluginval
run: |
curl -LO "https://github.com/Tracktion/pluginval/releases/download/v1.0.4/pluginval_${{ matrix.name }}.zip"
7z x pluginval_${{ matrix.name }}.zip
${{ matrix.pluginval-binary }} --strictness-level 10 --verbose --validate "${{ env.VST3_PATH }}"
- if: ${{ runner.os=='Windows'}}
name: Pack (Windows)
run: |
mkdir ${{ github.event.repository.name }}-${{ runner.os }}
cd ${{ env.BUILD_DIR }}\*_artefacts\Release
del *.*
move * ..\..\..\${{ github.event.repository.name }}-${{ runner.os }}
cd ..\..\..
cmake -E tar cvf ${{ github.event.repository.name }}-${{ runner.os }}.zip --format=zip -- ${{ github.event.repository.name }}-${{ runner.os }}
- if: ${{ runner.os!='Windows'}}
name: Pack (Unix)
run: |
mkdir ${{ github.event.repository.name }}-${{ runner.os }}
cd ${{ env.BUILD_DIR }}/*_artefacts/Release
rm *.*
mv * ../../../${{ github.event.repository.name }}-${{ runner.os }}
cd ../../..
cmake -E tar cvf ${{ github.event.repository.name }}-${{ runner.os }}.zip --format=zip -- ${{ github.event.repository.name }}-${{ runner.os }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ runner.os }}
path: ${{ github.event.repository.name }}-${{ runner.os }}.zip
release:
runs-on: ubuntu-latest
needs: build_and_test
steps:
- name: Get Artifacts
uses: actions/download-artifact@v4