Skip to content

lets try cmake for macos #9

lets try cmake for macos

lets try cmake for macos #9

Workflow file for this run

name: Build AudioChain
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build-macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup CMake
uses: jwlawson/actions-setup-cmake@v1.14
with:
cmake-version: '3.22.x'
- name: Configure CMake build
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
- name: Build Release
run: |
cd build
cmake --build . --config Release --parallel $(sysctl -n hw.ncpu)
- name: Verify microphone permissions in built app
run: |
# Find the built app in the CMake build directory
APP_PATH=$(find build -name "*.app" -type d | head -1)
if [ -n "$APP_PATH" ]; then
echo "Checking Info.plist in: $APP_PATH"
INFO_PLIST_PATH="$APP_PATH/Contents/Info.plist"
if [ -f "$INFO_PLIST_PATH" ]; then
echo "=== Info.plist contents ==="
plutil -p "$INFO_PLIST_PATH"
echo ""
# Check specifically for microphone permission
if plutil -p "$INFO_PLIST_PATH" | grep -q "NSMicrophoneUsageDescription"; then
echo "✓ Microphone permission successfully included in final app"
echo "Permission text:"
plutil -p "$INFO_PLIST_PATH" | grep -A1 "NSMicrophoneUsageDescription"
else
echo "⚠️ Warning: NSMicrophoneUsageDescription not found in final Info.plist"
echo "This may cause the app to crash when requesting microphone access on macOS"
fi
else
echo "⚠️ Warning: Info.plist not found at expected location"
fi
else
echo "⚠️ Warning: Built app not found, cannot verify permissions"
echo "Listing build directory contents:"
find build -type f -name "*.app" || find build -type d
fi
- name: Create DMG
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
# Install create-dmg for creating the DMG
brew install create-dmg
# Find the built app in the CMake build directory
APP_PATH=$(find build -name "*.app" -type d | head -1)
if [ -n "$APP_PATH" ]; then
echo "Found app at: $APP_PATH"
# Create DMG
create-dmg \
--volname "AudioChain" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "AudioChain.app" 200 190 \
--hide-extension "AudioChain.app" \
--app-drop-link 600 185 \
"AudioChain-macOS.dmg" \
"$APP_PATH"
else
echo "App not found, listing build directory contents..."
find build -type f -name "*.app" || find build -type d
fi
- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: AudioChain-macOS
path: |
AudioChain-macOS.dmg
build/**/*.app
if-no-files-found: ignore
build-windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Visual Studio
uses: microsoft/setup-msbuild@v2
- name: Install JUCE
shell: powershell
run: |
# Download and install JUCE
Invoke-WebRequest -Uri "https://github.com/juce-framework/JUCE/releases/download/7.0.9/juce-7.0.9-windows.zip" -OutFile "juce.zip"
Expand-Archive -Path "juce.zip" -DestinationPath "juce-temp"
Move-Item -Path "juce-temp\JUCE" -Destination "C:\JUCE"
- name: Configure JUCE module paths
shell: powershell
run: |
# Update the .jucer file to set correct module paths for CI
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_audio_basics" path=""/>', '<MODULEPATH id="juce_audio_basics" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_audio_devices" path=""/>', '<MODULEPATH id="juce_audio_devices" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_audio_formats" path=""/>', '<MODULEPATH id="juce_audio_formats" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_audio_processors" path=""/>', '<MODULEPATH id="juce_audio_processors" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_audio_utils" path=""/>', '<MODULEPATH id="juce_audio_utils" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_core" path=""/>', '<MODULEPATH id="juce_core" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_data_structures" path=""/>', '<MODULEPATH id="juce_data_structures" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_dsp" path=""/>', '<MODULEPATH id="juce_dsp" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_events" path=""/>', '<MODULEPATH id="juce_events" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_graphics" path=""/>', '<MODULEPATH id="juce_graphics" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_gui_basics" path=""/>', '<MODULEPATH id="juce_gui_basics" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
(Get-Content AudioChain.jucer) -replace '<MODULEPATH id="juce_gui_extra" path=""/>', '<MODULEPATH id="juce_gui_extra" path="C:\JUCE\modules"/>' | Set-Content AudioChain.jucer
- name: Setup VST2 SDK (if available)
shell: powershell
run: |
if (Test-Path "external/VST_SDK_2.4") {
Write-Host "VST2 SDK submodule detected, setting up headers..."
$VST2_TARGET_DIR = "C:\JUCE\modules\juce_audio_processors\format_types\VST3_SDK\pluginterfaces\vst2.x"
New-Item -ItemType Directory -Force -Path $VST2_TARGET_DIR
Copy-Item -Path "external\VST_SDK_2.4\pluginterfaces\vst2.x\*" -Destination $VST2_TARGET_DIR -Recurse -Force -ErrorAction SilentlyContinue
Write-Host "VST2 headers setup complete"
} else {
Write-Host "No VST2 SDK submodule found, skipping VST2 setup"
}
- name: Generate Visual Studio project
shell: cmd
run: |
"C:\JUCE\Projucer.exe" --resave AudioChain.jucer
- name: Build Release
run: |
msbuild Builds/VisualStudio2022/AudioChain.sln /p:Configuration=Release /p:Platform=x64 /m
- name: Package Windows build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
shell: powershell
run: |
# Find the built executable
$exePath = Get-ChildItem -Path "Builds\VisualStudio2022" -Recurse -Filter "AudioChain.exe" | Where-Object { $_.Directory.Name -eq "Release" } | Select-Object -First 1
if ($exePath) {
Write-Host "Found executable at: $($exePath.FullName)"
$releaseDir = $exePath.Directory.FullName
# Create distribution folder
New-Item -ItemType Directory -Force -Path "AudioChain-Windows-Release"
Copy-Item -Path "$releaseDir\*" -Destination "AudioChain-Windows-Release" -Recurse -Force
# Create ZIP
Compress-Archive -Path "AudioChain-Windows-Release\*" -DestinationPath "AudioChain-Windows.zip"
} else {
Write-Host "Executable not found, listing build directories..."
Get-ChildItem -Path "Builds\VisualStudio2022" -Recurse -Include "*.exe" | ForEach-Object { Write-Host $_.FullName }
}
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: AudioChain-Windows
path: |
Builds/VisualStudio2022/**/Release/**/*.exe
AudioChain-Windows.zip
if-no-files-found: ignore
release:
needs: [build-macos, build-windows]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ github.run_number }}
name: AudioChain v${{ github.run_number }}
body: |
## AudioChain Release v${{ github.run_number }}
Cross-platform audio processing application with VST plugin chain support.
### Downloads
- **macOS**: AudioChain-macOS.dmg
- **Windows**: AudioChain-Windows.zip
### Features
- Real-time audio processing through VST plugin chains
- Support for VST2, VST3, and Audio Unit (macOS) plugins
- Cross-platform compatibility (macOS and Windows)
- Modern JUCE-based GUI
Built from commit: ${{ github.sha }}
files: |
AudioChain-macOS/AudioChain-macOS.dmg
AudioChain-Windows/AudioChain-Windows.zip
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}