Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
zsliu98 committed Jan 19, 2025
1 parent 25dcc53 commit 290f658
Showing 1 changed file with 55 additions and 42 deletions.
97 changes: 55 additions & 42 deletions .github/workflows/cmake_full_test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: macOS/Windows/Linux Test

on:
push:
branches: [main, develop]
pull_request:
branches: [main]
workflow_dispatch:

# When pushing new commits, cancel any running builds on that branch
Expand All @@ -13,8 +17,9 @@ env:
BUILD_DIR: Builds
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DISPLAY: :0 # linux pluginval needs this
CMAKE_BUILD_PARALLEL_LEVEL: 3 # Use up to 3 cpus to build juceaide, etc
HOMEBREW_NO_INSTALL_CLEANUP: 1
SCCACHE_GHA_ENABLED: true
SCCACHE_CACHE_MULTIARCH: 1
IPP_DIR: C:\Program Files (x86)\Intel\oneAPI\ipp\latest\lib\cmake\ipp

# jobs are run in paralell on different machines
Expand All @@ -31,45 +36,62 @@ jobs:
os: ubuntu-22.04
pluginval-binary: ./pluginval
plugin_os_format: "VST3"
cmake_extra_flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
- name: macOS
os: macos-14
os: macos-15
pluginval-binary: pluginval.app/Contents/MacOS/pluginval
plugin_os_format: "AU"
cmake_extra_flags:
- name: Windows
os: windows-latest
pluginval-binary: ./pluginval.exe
plugin_os_format: "VST3"
cmake_extra_flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++

steps:
- name: Set up MSVC Developer Command Prompt (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: Set up Clang (Linux)
if: runner.os == 'Linux'
uses: egor-tensin/setup-clang@v1
# - name: Set up Clang (Linux)
# if: runner.os == 'Linux'
# run: |
# wget https://apt.llvm.org/llvm.sh
# chmod +x ./llvm.sh
# sudo ./llvm.sh 17

# This also starts up our "fake" display Xvfb, needed for pluginval
- name: Install JUCE's Linux Deps
- name: Install JUCE's Linux Deps (Linux)
if: runner.os == 'Linux'
# Thanks to McMartin & co https://forum.juce.com/t/list-of-juce-dependencies-under-linux/15121/44
run: |
sudo apt-get update && sudo apt install libasound2-dev libx11-dev libxinerama-dev libxext-dev libfreetype-dev libfontconfig1-dev libwebkit2gtk-4.1-dev libglu1-mesa-dev xvfb ninja-build
sudo /usr/bin/Xvfb $DISPLAY &
# - name: Cache Clang (Windows)
# if: runner.os == 'Windows'
# id: cache-llvm
# uses: actions/cache@v4
# with:
# path: |
# C:/Program Files/LLVM
# ./llvm
# key: llvm-17

- name: Set up Clang (Windows)
if: runner.os == 'Windows'
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
- name: Cache IPP (Windows)
if: runner.os == 'Windows'
id: cache-ipp
uses: actions/cache@v4
with:
key: ipp-v5
key: ipp-v6
path: C:\Program Files (x86)\Intel

- name: Install IPP (Windows)
if: (runner.os == 'Windows') && (steps.cache-ipp.outputs.cache-hit != 'true')
shell: bash
run: |
curl --output oneapi.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b4adec02-353b-4144-aa21-f2087040f316/w_ipp_oneapi_p_2021.11.0.533_offline.exe
curl --output oneapi.exe https://registrationcenter-download.intel.com/akdlm/IRC_NAS/2e89fab4-e1c7-4f14-a1ef-6cddba8c5fa7/intel-ipp-2022.0.0.796_offline.exe
./oneapi.exe -s -x -f oneapi
./oneapi/bootstrapper.exe -s -c --action install --components=intel.oneapi.win.ipp.devel --eula=accept -p=NEED_VS2022_INTEGRATION=1 --log-dir=.
Expand All @@ -78,35 +100,26 @@ jobs:
uses: actions/cache/save@v4
with:
path: C:\Program Files (x86)\Intel
key: ipp-v5
key: ipp-v6

- name: Install Ninja (Windows)
if: runner.os == 'Windows'
shell: bash
run: choco install ninja

- name: Install macOS Deps
if: ${{ matrix.name == 'macOS' }}
if: ${{ runner.os == '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: true

- name: Cache the build
uses: mozilla-actions/sccache-action@v0.0.5
submodules: recursive
fetch-depth: 0

- name: Import Certificates (macOS)
uses: apple-actions/import-codesign-certs@v3 # only exists as a tag right now
if: ${{ (matrix.name == 'macOS') && (env.p12-file-base64 != '')}}
if: ${{ (runner.os == 'macOS') && (env.p12-file-base64 != '')}}
with:
p12-file-base64: ${{ secrets.DEV_ID_APP_CERT }}
p12-password: ${{ secrets.DEV_ID_APP_PASSWORD }}
Expand All @@ -115,7 +128,7 @@ jobs:

- name: Configure
shell: bash
run: cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache }} -DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache }} -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" .
run: cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE}} ${{ matrix.cmake_extra_flags }} .
env:
PLUGIN_OS_FORMAT: ${{ matrix.plugin_os_format }}

Expand Down Expand Up @@ -146,8 +159,8 @@ jobs:
- name: Pluginval setup
shell: bash
run: |
curl -LO "https://github.com/Tracktion/pluginval/releases/download/v1.0.3/pluginval_${{ matrix.name }}.zip"
7z x pluginval_${{ matrix.name }}.zip
curl -LO "https://github.com/Tracktion/pluginval/releases/download/v1.0.3/pluginval_${{ runner.os }}.zip"
7z x pluginval_${{ runner.os }}.zip
echo "PLUGINVAL_DISABLED=Plugin state restoration" >> $GITHUB_ENV
- name: Setup Pluginval random seed
Expand All @@ -157,7 +170,7 @@ jobs:
format: YYYYMMDD

- name: Pluginval VST3 validations
if: ${{ matrix.name != 'macOS' }}
if: ${{ runner.os != 'macOS' }}
shell: bash
run: |
${{ matrix.pluginval-binary }} --verbose --validate "${{ env.VST3_PATH }}" --disabled-tests "${{ env.PLUGINVAL_DISABLED }}"
Expand All @@ -168,7 +181,7 @@ jobs:
RANDOM_SEED: "${{ steps.current-time.outputs.formattedTime }}"

- name: Pluginval AU validations (macOS)
if: ${{ matrix.name == 'macOS' }}
if: ${{ runner.os == 'macOS' }}
shell: bash
run: |
sudo cp -r "${{ env.AU_PATH }}" "/Library/Audio/Plug-ins/components"
Expand All @@ -181,75 +194,75 @@ jobs:
RANDOM_SEED: "${{ steps.current-time.outputs.formattedTime }}"

- name: Codesign and Create Individual Packages (macOS)
if: ${{ matrix.name == 'macOS' }}
if: ${{ runner.os == 'macOS' }}
run: |
python3 -u packaging/packager_macOS.py
env:
DEVELOPER_ID_APPLICATION: ${{ secrets.DEVELOPER_ID_APPLICATION }}

- name: Sign Final Package (macOS)
if: ${{ (matrix.name == 'macOS') && (env.APPLE_INSTALLER_DEV != '') }}
if: ${{ (runner.os == 'macOS') && (env.APPLE_INSTALLER_DEV != '') }}
run: productsign --sign "${{ secrets.APPLE_INSTALLER_DEV }}" "${{ env.ARTIFACT_NAME }}_unsigned.pkg" "${{ env.ARTIFACT_NAME }}.pkg"
env:
APPLE_INSTALLER_DEV: ${{ secrets.APPLE_INSTALLER_DEV }}

- name: Rename Final Package (macOS)
if: ${{ (matrix.name == 'macOS') && (env.APPLE_INSTALLER_DEV == '') }}
if: ${{ (runner.os == 'macOS') && (env.APPLE_INSTALLER_DEV == '') }}
run: mv "${{ env.ARTIFACT_NAME }}_unsigned.pkg" "${{ env.ARTIFACT_NAME }}.pkg"
env:
APPLE_INSTALLER_DEV: ${{ secrets.APPLE_INSTALLER_DEV }}

- name: Notarize and Staple PKG (macOS)
if: ${{ (matrix.name == 'macOS') && (env.NOTARIZATION_USERNAME != '')}}
if: ${{ (runner.os == 'macOS') && (env.NOTARIZATION_USERNAME != '')}}
run: |
xcrun notarytool submit "${{ env.ARTIFACT_NAME }}.pkg" --apple-id ${{ secrets.NOTARIZATION_USERNAME }} --password ${{ secrets.NOTARIZATION_PASSWORD }} --team-id ${{ secrets.TEAM_ID }} --wait
xcrun stapler staple "${{ env.ARTIFACT_NAME }}.pkg"
env:
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}

- name: Create DMG (macOS)
if: ${{ matrix.name == 'macOS' }}
if: ${{ runner.os == 'macOS' }}
run: |
mkdir "${{ env.ARTIFACTS_PATH }}/dmgtmp"
mv "${{ env.ARTIFACT_NAME }}.pkg" "${{ env.ARTIFACTS_PATH }}/dmgtmp"
hdiutil create "${{ env.ARTIFACTS_PATH }}/tmp.dmg" -ov -volname "${{ env.ARTIFACT_NAME }}" -fs HFS+ -srcfolder "${{ env.ARTIFACTS_PATH }}/dmgtmp"
hdiutil convert "${{ env.ARTIFACTS_PATH }}/tmp.dmg" -format UDZO -o "${{ env.ARTIFACT_NAME }}.dmg"
- name: Upload DMG (macOS)
if: ${{ matrix.name == 'macOS' }}
if: ${{ runner.os == 'macOS' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}.dmg
path: "${{ env.ARTIFACT_NAME }}.dmg"

- name: Generate InnoScript (Windows)
if: ${{ matrix.name == 'Windows' }}
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
python3 -u packaging/packager_Windows.py
cat "packaging\installer.iss"
- name: Generate Installer (Windows)
if: ${{ matrix.name == 'Windows' }}
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
iscc "packaging\installer.iss"
mv "packaging/Output/${{ env.ARTIFACT_NAME }}.exe" "${{ env.ARTIFACTS_PATH }}/"
- name: Upload Exe (Windows)
if: ${{ matrix.name == 'Windows' }}
if: ${{ runner.os == 'Windows' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}.exe
path: "${{ env.ARTIFACTS_PATH }}/${{ env.ARTIFACT_NAME }}.exe"

- name: Generate Zip (Linux)
if: ${{ matrix.name == 'Linux' }}
if: ${{ runner.os == 'Linux' }}
working-directory: ${{ env.ARTIFACTS_PATH }}
run: 7z a -tzip "${{ env.ARTIFACT_NAME }}.zip" "-xr!lib${{ env.PRODUCT_NAME }}_SharedCode.a" .

- name: Upload Zip (Linux)
if: ${{ matrix.name == 'Linux' }}
if: ${{ runner.os == 'Linux' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}.zip
Expand Down

0 comments on commit 290f658

Please sign in to comment.