Skip to content

Limit CI build parallelism to 2 jobs on all platforms #35

Limit CI build parallelism to 2 jobs on all platforms

Limit CI build parallelism to 2 jobs on all platforms #35

Workflow file for this run

name: Build
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libasound2-dev libfreetype6-dev libx11-dev \
libxrandr-dev libxcursor-dev libxinerama-dev libwebkit2gtk-4.1-dev \
libcurl4-openssl-dev
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
- name: Build
run: cmake --build build --config Release --parallel 2
- name: Collect artifacts (macOS)
if: runner.os == 'macOS'
run: |
mkdir -p artifacts/{VST3,AU,LV2,Standalone}
find build -name "*.vst3" -type d -exec cp -R {} artifacts/VST3/ \;
find build -name "*.component" -type d -exec cp -R {} artifacts/AU/ \;
find build -name "*.lv2" -type d -exec cp -R {} artifacts/LV2/ \;
find build -name "*.app" -type d -exec cp -R {} artifacts/Standalone/ \;
cat > artifacts/README.md << 'EOF'
# Smartelectronix Plugins for macOS
## "App is damaged" error
If macOS says an app "is damaged and can't be opened", run this command in Terminal:
```
xattr -cr /path/to/app.app
```
Or to fix all apps at once, cd to the Standalone folder and run:
```
xattr -cr *
```
This removes the quarantine attribute that macOS adds to downloaded files.
EOF
- name: Collect artifacts (Linux)
if: runner.os == 'Linux'
run: |
mkdir -p artifacts/{VST3,LV2,Standalone}
find build -name "*.vst3" -type d -exec cp -R {} artifacts/VST3/ \;
find build -name "*.lv2" -type d -exec cp -R {} artifacts/LV2/ \;
find build -type f -executable -path "*/Standalone/*" -exec cp {} artifacts/Standalone/ \;
- name: Collect artifacts (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
mkdir -p artifacts/{VST3,Standalone}
find build -name "*.vst3" -type d -exec cp -R {} artifacts/VST3/ \;
find build -name "*.exe" ! -name "*_vst3_helper.exe" -exec cp {} artifacts/Standalone/ \;
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: smartelectronix-${{ runner.os }}
path: artifacts/
if-no-files-found: error
release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: all-artifacts
- name: Zip artifacts
run: |
cd all-artifacts
for dir in */; do
(cd "$dir" && zip -r "../../${dir%/}.zip" .)
done
- name: Delete existing release
run: gh release delete latest --yes --cleanup-tag || true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: latest
name: Smartelectronix Plugins (Latest Build)
body: |
Latest build from commit ${{ github.sha }}
Built on ${{ github.event.head_commit.timestamp }}
files: '*.zip'
prerelease: false