-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (134 loc) · 5.31 KB
/
juce.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
137
138
139
140
141
142
143
144
145
146
name: JUCE workflow
defaults:
run:
shell: bash
on:
workflow_call:
inputs:
dir_build:
default: ./build
required: false
type: string
dir_sdk:
default: ./sdk
required: false
type: string
dir_source:
default: ./sdk
required: false
type: string
release_id:
required: true
type: string
release_url:
required: true
type: string
target:
default: AudioPluginExample_All
required: false
type: string
type:
default: Release
required: false
type: string
jobs:
juce:
name: JUCE
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
include:
- os: ubuntu-latest
name: linux
generator: Unix Makefiles
path: ${{ inputs.dir_build }}/examples/CMake/AudioPlugin/AudioPluginExample_artefacts/${{ inputs.type }}/VST3
- os: macos-latest
name: mac
generator: Xcode
path: ${{ inputs.dir_build }}/examples/CMake/AudioPlugin/AudioPluginExample_artefacts/${{ inputs.type }}/VST3
- os: windows-2019
name: win
generator: Visual Studio 16 2019
path: ${{ inputs.dir_build }}/examples/CMake/AudioPlugin/AudioPluginExample_artefacts/${{ inputs.type }}/VST3/Audio Plugin Example.vst3/Contents/x86_64-win
steps:
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get update && sudo apt-get install gcc "libstdc++6" libx11-xcb-dev libxcb-util-dev libxcb-cursor-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev libfontconfig1-dev libcairo2-dev libgtkmm-3.0-dev libsqlite3-dev libxcb-keysyms1-dev libasound2-dev
# - name: Install macOS dependencies
# if: matrix.os == 'macos-latest'
# run: brew install zip
# - name: Install Windows dependencies
# if: matrix.os == 'windows-2019'
# run: choco install zip
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build plugins
run: |
cmake \
-G "${{ matrix.generator }}" \
-DCMAKE_BUILD_TYPE="${{ inputs.type }}" \
-DJUCE_BUILD_EXAMPLES=ON \
-DJUCE_BUILD_EXTRAS=OFF \
-S "${{ inputs.dir_source }}" \
-B "${{ inputs.dir_build }}"
cmake --build "${{ inputs.dir_build }}" --config "${{ inputs.type }}" --target "${{ inputs.target }}"
- name: List errors
run: cat "${{ inputs.dir_build }}/CMakeFiles/CMakeError.log" || true
- name: List files
run: ls "${{ matrix.path }}"
- name: Metadata
run: |
npm install @studiorack/cli -g
cp -v ./src/assets/* "${{ matrix.path }}"
studiorack validate "${{ matrix.path }}/**/*.{vst,vst3}" --files --json --txt --zip --summary
- name: Upload
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const path = require('path');
const fs = require('fs');
const release_id = '${{ inputs.release_id }}';
for (let file of await fs.readdirSync('${{ matrix.path }}')) {
if (path.extname(file) === '.zip') {
console.log('upload zip', `${{ matrix.path }}/${file}`);
await github.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release_id,
name: `${path.basename(file, path.extname(file))}-${{ matrix.name }}.zip`,
data: await fs.readFileSync(`${{ matrix.path }}/${file}`)
});
if ("${{ matrix.os }}" == 'macos-latest') {
console.log('upload png', `${{ matrix.path }}/${path.basename(file, path.extname(file))}.png`);
await github.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release_id,
name: `${path.basename(file, path.extname(file))}.png`,
data: await fs.readFileSync(`${{ matrix.path }}/${path.basename(file, path.extname(file))}.png`)
});
console.log('upload wav', `${{ matrix.path }}/${path.basename(file, path.extname(file))}.wav`);
await github.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release_id,
name: `${path.basename(file, path.extname(file))}.wav`,
data: await fs.readFileSync(`${{ matrix.path }}/${path.basename(file, path.extname(file))}.wav`)
});
}
}
}
- name: Upload metadata
if: matrix.os == 'macos-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.release_url }}
asset_path: ${{ matrix.path }}/plugins.json
asset_name: plugins.json
asset_content_type: application/json