Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the macOS GHA workflow #14

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 171 additions & 0 deletions .github/workflows/build-mac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
name: Build macOS

on:
workflow_dispatch:
push:

concurrency:
group: ${{github.ref}}
cancel-in-progress: true

env:
PROJECT_NAME: TemplateProject
BUILD_DIR: build-mac
ARTIFACT_EXT: mac
PLUGINVAL_VER: v1.0.2
VST3_VER: v3.7.9_build_61
CLAP_VER: v1.2.5

jobs:
build-mac:
name: Build macOS
runs-on: macos-latest

steps:
- name: Check out repository
uses: actions/checkout@v3.3.0
with:
submodules: recursive

- name: Cache Prebuilt Libs
id: cache-deps
uses: actions/cache@v3
with:
path: |
iPlug2/Dependencies/Build
iPlug2/Dependencies/iPlug
key: ${{runner.os}}-deps-${{hashFiles('iPlug2/Dependencies/download-prebuilt-libs.sh', 'iPlug2/Dependencies/IGraphics/build-igraphics-libs-mac.sh', 'iPlug2/Dependencies/IGraphics/build-skia-mac.sh')}}

- name: Get Prebuilt Libs
if: steps.cache-deps.outputs.cache-hit != 'true'
shell: bash
run: |
cd iPlug2/Dependencies
./download-prebuilt-libs.sh

- name: Cache VST3 SDK
id: cache-vst3
uses: actions/cache@v3
with:
path: |
iPlug2/Dependencies/IPlug/VST3_SDK
key: ${{runner.os}}-vst3-${{env.VST3_VER}}

- name: Get VST3 SDK
if: steps.cache-vst3.outputs.cache-hit != 'true'
shell: bash
run: |
cd iPlug2/Dependencies/IPlug
./download-vst3-sdk.sh ${{env.VST3_VER}} build-validator

- name: Cache CLAP SDK
id: cache-clap
uses: actions/cache@v3
with:
path: |
iPlug2/Dependencies/IPlug/CLAP_SDK
key: ${{runner.os}}-clap-${{env.CLAP_VER}}

- name: Get CLAP SDK
if: steps.cache-clap.outputs.cache-hit != 'true'
shell: bash
run: |
cd iPlug2/Dependencies/IPlug
./download-clap-sdks.sh ${{env.CLAP_VER}}

- name: Get VST2 SDK
shell: bash
env:
VST2_SDK: ${{secrets.VST2_SDK}}
run: |
mkdir tmp
echo $VST2_SDK | base64 -d > tmp/tmp.zip
unzip tmp/tmp.zip -d tmp
mv tmp/VST2_SDK/* iPlug2/Dependencies/IPlug/VST2_SDK

- name: Build
shell: bash
run: |
cd ${{env.PROJECT_NAME}}/scripts
./makedist-mac.sh full zip

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.PROJECT_NAME}}-${{env.ARTIFACT_EXT}}
path: |
${{env.PROJECT_NAME}}/${{env.BUILD_DIR}}/out

test-mac:
name: Test macOS
runs-on: macos-latest
needs: build-mac

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: ${{env.PROJECT_NAME}}-${{env.ARTIFACT_EXT}}

- name: Unzip files
shell: bash
run: |
unzip *-${{env.ARTIFACT_EXT}}.zip
unzip *-${{env.ARTIFACT_EXT}}-auval.zip

- name: Cache Pluginval
id: cache-pluginval
uses: actions/cache@v3
with:
path: |
./pluginval.app
key: ${{runner.os}}-pluginval-${{env.PLUGINVAL_VER}}

- name: Get Pluginval
if: steps.cache-pluginval.outputs.cache-hit != 'true'
shell: bash
run: |
curl -L "https://github.com/Tracktion/pluginval/releases/download/${{env.PLUGINVAL_VER}}/pluginval_macOS.zip" -o pluginval.zip
unzip pluginval

- name: Restore VST3 SDK
id: cache-vst3
uses: actions/cache/restore@v3
with:
path: |
iPlug2/Dependencies/IPlug/VST3_SDK
key: ${{runner.os}}-vst3-${{env.VST3_VER}}

- name: Test VST3 with VST3 Validator
shell: bash
run: |
./iPlug2/Dependencies/IPlug/VST3_SDK/validator ${{env.PROJECT_NAME}}.vst3

- name: Test VST3 with Pluginval
shell: bash
run: |
pluginval.app/Contents/MacOS/pluginval --skip-gui-tests --validate-in-process --output-dir "./bin" --validate ${{env.PROJECT_NAME}}.vst3 || exit 1

- name: Test AUv2 with Pluginval
shell: bash
run: |
mkdir -p ~/Library/Audio/Plug-Ins/Components
mv ${{env.PROJECT_NAME}}.component ~/Library/Audio/Plug-Ins/Components
pgrep -x AudioComponentRegistrar >/dev/null && killall -9 AudioComponentRegistrar; echo "killed AudioComponentRegistrar" || echo "AudioComponentRegistrar Process not found"
pluginval.app/Contents/MacOS/pluginval --skip-gui-tests --validate-in-process --output-dir "./bin" --validate ~/Library/Audio/Plug-Ins/Components/${{env.PROJECT_NAME}}.component || exit 1

- name: Test AUv2 with auval
shell: bash
run: |
./validate_audiounit.sh config.h

# - name: Test AUv2 with auval (RTSafe)
# shell: bash
# run: |
# ./validate_audiounit.sh config.h rtsafe

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{env.PROJECT_NAME}}-${{env.ARTIFACT_EXT}}-pluginval
path: ./bin
4 changes: 2 additions & 2 deletions .github/workflows/build-native.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Build Native

on:
# workflow_dispatch
push:
workflow_dispatch
# push:
# tags:
# - "v*"

Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
.DS_Store
xcuserdata
*.RPP-bak
build-*

build-mac/
build-win/
build-web/
*.ipch
*.db
*.suo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
buildPhases = (
);
dependencies = (
4F61D85E2D74836400578AA8 /* PBXTargetDependency */,
4F61D8582D7482DA00578AA8 /* PBXTargetDependency */,
4F06F18623566DC800FD0962 /* PBXTargetDependency */,
4F78DAFA13B6436B0032E0F3 /* PBXTargetDependency */,
4F9828F8140A9F0200F3FCC1 /* PBXTargetDependency */,
);
Expand Down Expand Up @@ -267,13 +267,6 @@
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
4F06F18523566DC800FD0962 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 089C1669FE841209C02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 4FD16A0813B63081001D0217;
remoteInfo = APP;
};
4F3EE1BC231438D000004786 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 089C1669FE841209C02AAC07 /* Project object */;
Expand All @@ -288,6 +281,13 @@
remoteGlobalIDString = 4F8E0FDF2BF5F3B500D360CE;
remoteInfo = CLAP;
};
4F61D85D2D74836400578AA8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 089C1669FE841209C02AAC07 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 4F3EE1BA231438D000004786;
remoteInfo = AUv3App;
};
4F78BE3522E742DE00AD537E /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 089C1669FE841209C02AAC07 /* Project object */;
Expand Down Expand Up @@ -2519,11 +2519,6 @@
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
4F06F18623566DC800FD0962 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4FD16A0813B63081001D0217 /* APP */;
targetProxy = 4F06F18523566DC800FD0962 /* PBXContainerItemProxy */;
};
4F3EE1BB231438D000004786 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4F78BE0122E73D0800AD537E /* TemplateProjectAU */;
Expand All @@ -2534,6 +2529,11 @@
target = 4F8E0FDF2BF5F3B500D360CE /* CLAP */;
targetProxy = 4F61D8572D7482DA00578AA8 /* PBXContainerItemProxy */;
};
4F61D85E2D74836400578AA8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4F3EE1BA231438D000004786 /* AUv3App */;
targetProxy = 4F61D85D2D74836400578AA8 /* PBXContainerItemProxy */;
};
4F78BE3622E742DE00AD537E /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 4F78BE0122E73D0800AD537E /* TemplateProjectAU */;
Expand Down
29 changes: 19 additions & 10 deletions TemplateProject/scripts/makedist-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ if [ -d build-mac ]; then
fi

#---------------------------------------------------------------------------------------------------------
#variables
# variables

IPLUG2_ROOT=../iPlug2
XCCONFIG=$IPLUG2_ROOT/../common-mac.xcconfig
SCRIPTS=$IPLUG2_ROOT/Scripts

# CODESIGN disabled by default.
CODESIGN=0
# CODE_SIGN disabled by default.
CODE_SIGN=0
NOTARIZE=0

# macOS codesigning/notarization
NOTARIZE_BUNDLE_ID=com.AcmeInc.TemplateProject
Expand Down Expand Up @@ -118,7 +119,7 @@ echo ""
touch *.cpp

#---------------------------------------------------------------------------------------------------------
#remove existing binaries
# remove existing binaries

echo "remove existing binaries"
echo ""
Expand Down Expand Up @@ -154,7 +155,7 @@ fi
#---------------------------------------------------------------------------------------------------------
# build xcode project. Change target to build individual formats, or add to All target in the xcode project

xcodebuild -project ./projects/$PLUGIN_NAME-macOS.xcodeproj -xcconfig ./config/$PLUGIN_NAME-mac.xcconfig DEMO_VERSION=$DEMO -target "All" -UseModernBuildSystem=NO -configuration Release | tee build-mac.log | xcpretty #&& exit ${PIPESTATUS[0]}
xcodebuild -project ./projects/$PLUGIN_NAME-macOS.xcodeproj -xcconfig ./config/$PLUGIN_NAME-mac.xcconfig DEMO_VERSION=$DEMO -configuration Release | tee build-mac.log | xcpretty #&& exit ${PIPESTATUS[0]}

if [ "${PIPESTATUS[0]}" -ne "0" ]; then
echo "ERROR: build failed, aborting"
Expand Down Expand Up @@ -221,7 +222,7 @@ if [ -d $CLAP ]; then
strip -x $CLAP/Contents/MacOS/$PLUGIN_NAME
fi

if [ $CODESIGN == 1 ]; then
if [ $CODE_SIGN == 1 ]; then
#---------------------------------------------------------------------------------------------------------
# code sign AAX binary with wraptool

Expand Down Expand Up @@ -259,15 +260,15 @@ if [ $BUILD_INSTALLER == 1 ]; then

./scripts/makeinstaller-mac.sh $FULL_VERSION

if [ $CODESIGN == 1 ]; then
if [ $CODE_SIGN == 1 ]; then
echo "code-sign installer for Gatekeeper on macOS 10.8+"
echo ""
mv "${PKG}" "${PKG_US}"
productsign --sign "${DEV_ID_INST_STR}" "${PKG_US}" "${PKG}"
rm -R -f "${PKG_US}"
fi

#set installer icon
# set installer icon
./$SCRIPTS/SetFileIcon -image resources/$PLUGIN_NAME.icns -file "${PKG}"

#---------------------------------------------------------------------------------------------------------
Expand All @@ -286,9 +287,9 @@ if [ $BUILD_INSTALLER == 1 ]; then

sudo rm -R -f build-mac/installer/

if [ $CODESIGN == 1 ]; then
if [ $NOTARIZE == 1 ]; then
#---------------------------------------------------------------------------------------------------------
#notarize dmg
# notarize dmg
echo "notarizing"
echo ""
# you need to create an app-specific id/password https://support.apple.com/en-us/HT204397
Expand Down Expand Up @@ -358,6 +359,14 @@ echo "packaging dSYMs"
echo ""
zip -r ./build-mac/$ARCHIVE_NAME-dSYMs.zip ./build-mac/*.dSYM

#---------------------------------------------------------------------------------------------------------
# auval tools
sudo rm -R -f build-mac/*-auval.zip

echo "packaging auval script"
echo ""
zip -j ./build-mac/$ARCHIVE_NAME-auval.zip ./config.h ./../iPlug2/Scripts/validate_audiounit.sh

#---------------------------------------------------------------------------------------------------------

# prepare out folder for CI
Expand Down
Loading