-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (176 loc) · 7.33 KB
/
Copy pathrelease.yml
File metadata and controls
193 lines (176 loc) · 7.33 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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: release
# Build the Old Cathode FFGL plugin for the two platforms Resolume runs on:
# - macOS -> universal (arm64 + x86_64) OldCathode.bundle
# - Windows -> x64 OldCathode.dll (GLEW static-linked via vcpkg)
# Each ships as a zip; drop the bundle/dll into Resolume's "Extra Effects"
# folder. Trigger manually (Actions > release > Run workflow) or by pushing a
# v* tag.
on:
workflow_dispatch:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { name: macos-universal, os: macos-14, artifact: OldCathode.bundle }
- { name: windows-x86_64, os: windows-latest, artifact: OldCathode.dll }
steps:
- uses: actions/checkout@v7
with:
submodules: recursive
# --- macOS: no extra deps, universal build straight from CMake ---
- name: Configure (macOS)
if: runner.os == 'macOS'
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DOLDCATHODE_BUILD_TOOLS=OFF
# --- Windows: GLEW comes from vcpkg, static-linked (static-md keeps the
# CRT dynamic so the plugin matches the host) so the .dll has no
# external glew32.dll runtime dependency. ---
- name: Configure (Windows)
if: runner.os == 'Windows'
run: >
cmake -B build -A x64
-DCMAKE_BUILD_TYPE=Release
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
- name: Build
run: cmake --build build --config Release --parallel
- name: Derive version
id: ver
shell: bash
run: |
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
else
echo "version=0.0.0-dev.${GITHUB_RUN_NUMBER}" >> "$GITHUB_OUTPUT"
fi
- name: Collect artifact
shell: bash
run: |
mkdir -p out
if [ "${{ runner.os }}" = "macOS" ]; then
cp -R "build/OldCathode.bundle" "out/OldCathode.bundle"
# Sanity-check the bundle really is universal and exports plugMain.
lipo -archs "out/OldCathode.bundle/Contents/MacOS/OldCathode"
# Actions runs `shell: bash` as `bash -eo pipefail`, so `cmd | grep -q X`
# FAILS when grep FINDS its match: grep exits at once, the writer takes
# SIGPIPE, and pipefail reports the pipeline as failed -- failing the
# release on a correct binary. It is output-size dependent, so it bites
# the biggest artefact first. Captured and matched with `case` instead.
__symbols=$( nm -gU "out/OldCathode.bundle/Contents/MacOS/OldCathode" )
case "$__symbols" in
*_plugMain*) ;;
*) echo "expected _plugMain, got: $__symbols"; exit 1 ;;
esac
else
cp "build/Release/OldCathode.dll" "out/OldCathode.dll"
fi
# OpenFX build: shipped as its own zip, not folded into the FFGL
# artefact — it installs to the OFX folder, not Resolume's.
mkdir -p ofxout
if [ "${{ runner.os }}" = "macOS" ]; then
cp -R "build/OldCathode.ofx.bundle" "ofxout/OldCathode.ofx.bundle"
lipo -archs "ofxout/OldCathode.ofx.bundle/Contents/MacOS/OldCathode.ofx"
nm -gU "ofxout/OldCathode.ofx.bundle/Contents/MacOS/OldCathode.ofx" | grep "_OfxGetPlugin" >/dev/null
codesign --force --sign - --timestamp=none "ofxout/OldCathode.ofx.bundle"
else
mkdir -p "ofxout/OldCathode.ofx.bundle/Contents/Win64"
cp "build/OldCathode.ofx.bundle/Contents/Win64/OldCathode.ofx" "ofxout/OldCathode.ofx.bundle/Contents/Win64/OldCathode.ofx"
fi
ls -R ofxout
ls -R out
- name: Archive (zip)
shell: bash
run: |
cd out
if command -v 7z >/dev/null 2>&1; then
7z a "../old-cathode-${{ matrix.name }}.zip" ./*
else
zip -r "../old-cathode-${{ matrix.name }}.zip" ./*
fi
cd ../ofxout
if command -v 7z >/dev/null 2>&1; then
7z a "../old-cathode-ofx-${{ matrix.name }}.zip" ./*
else
zip -r "../old-cathode-ofx-${{ matrix.name }}.zip" ./*
fi
- name: Disk image (macOS)
if: runner.os == 'macOS'
shell: bash
# A .dmg, but deliberately NOT a .pkg. An FFGL plugin's destination is
# per-user and edition-specific — the README installs to
# ~/Documents/Resolume {Arena,Avenue}/Extra Effects — so a .pkg would
# have to guess a path and would silently install to the wrong one for
# half of users. Mounting an image and dragging the bundle where the
# README says is the honest shape here.
run: |
source scripts/release-lib.sh
rl_init "Old Cathode" old-cathode "${{ steps.ver.outputs.version }}" \
com.stoatworks.old-cathode "$GITHUB_WORKSPACE"
cp README.md out/ 2>/dev/null || true
rl_adhoc_sign "out/OldCathode.bundle"
rl_dmg "${{ matrix.name }}" out
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: old-cathode-${{ matrix.name }}
path: |
*.zip
*.dmg
if-no-files-found: error
windows-installer:
name: Windows installer
needs: build
runs-on: ubuntu-latest
# makensis cross-compiles, so the installer is wrapped here from the zip the
# Windows job uploaded. Its directory page defaults to the common FFGL
# folder but stays editable, because Resolume reads plugins from a path the
# user chooses per edition.
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Install NSIS
run: sudo apt-get update && sudo apt-get install -y nsis
- name: Build installer
shell: bash
run: |
source scripts/release-lib.sh
version="${GITHUB_REF_NAME#v}"
case "$version" in [0-9]*) ;; *) version="0.0.0" ;; esac
rl_init "Old Cathode" old-cathode "$version" com.stoatworks.old-cathode "$PWD/installers"
zip="$(find artifacts -name "old-cathode-windows-x86_64.zip" | head -1)"
if [ -z "$zip" ]; then echo "no Windows artefact, nothing to do"; exit 0; fi
stage="$RUNNER_TEMP/stage-win"
rm -rf "$stage"; mkdir -p "$stage"
unzip -q "$zip" -d "$stage"
cp README.md "$stage/" 2>/dev/null || true
# --cli: a plugin has no executable to make a shortcut to.
rl_nsis windows-x86_64 "$stage" --cli
ls -l installers
- uses: actions/upload-artifact@v7
with:
name: old-cathode-windows-installer
path: installers/*
if-no-files-found: warn
release:
name: Publish release
needs: [build, windows-installer]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- uses: softprops/action-gh-release@v3
with:
files: artifacts/**/*
generate_release_notes: true