mirror of
https://github.com/vsariola/sointu.git
synced 2025-05-28 03:10:24 -04:00
239 lines
9.0 KiB
YAML
239 lines
9.0 KiB
YAML
name: Binaries
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- dev
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- dev
|
|
|
|
jobs:
|
|
create_release:
|
|
name: Create release
|
|
runs-on: ubuntu-latest
|
|
# Note this. We are going to use that in further jobs.
|
|
outputs:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Create release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: ${{ github.ref_name }}
|
|
body_path: CHANGELOG.md
|
|
draft: false
|
|
prerelease: false
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
binaries:
|
|
needs: create_release # we need to know the upload URL
|
|
runs-on: ${{ matrix.config.os }}
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- os: windows-latest
|
|
asmnasm: C:\Users\runneradmin\nasm\nasm
|
|
output: sointu-track.exe
|
|
params: cmd/sointu-track/main.go
|
|
ldflags: -H=windowsgui
|
|
- os: windows-latest
|
|
asmnasm: C:\Users\runneradmin\nasm\nasm
|
|
output: sointu-compile.exe
|
|
params: cmd/sointu-compile/main.go
|
|
- os: windows-latest
|
|
asmnasm: C:\Users\runneradmin\nasm\nasm
|
|
output: sointu-track-native.exe
|
|
params: -tags=native cmd/sointu-track/main.go
|
|
ldflags: -H=windowsgui
|
|
- os: windows-latest
|
|
asmnasm: C:\Users\runneradmin\nasm\nasm
|
|
output: sointu-vsti.dll
|
|
params: -buildmode=c-shared -tags=plugin ./cmd/sointu-vsti/
|
|
- os: windows-latest
|
|
asmnasm: C:\Users\runneradmin\nasm\nasm
|
|
output: sointu-vsti-native.dll
|
|
params: -buildmode=c-shared -tags="plugin,native" ./cmd/sointu-vsti/
|
|
- os: ubuntu-latest
|
|
asmnasm: /home/runner/nasm/nasm
|
|
output: sointu-track
|
|
params: cmd/sointu-track/main.go
|
|
packages: libegl-dev libvulkan-dev libxkbcommon-x11-dev libwayland-dev libasound2-dev libx11-xcb-dev libxcursor-dev libxfixes-dev
|
|
- os: ubuntu-latest
|
|
asmnasm: /home/runner/nasm/nasm
|
|
output: sointu-compile
|
|
params: cmd/sointu-compile/main.go
|
|
packages: libegl-dev libvulkan-dev libxkbcommon-x11-dev libwayland-dev libasound2-dev libx11-xcb-dev libxcursor-dev libxfixes-dev
|
|
- os: ubuntu-latest
|
|
asmnasm: /home/runner/nasm/nasm
|
|
output: sointu-track-native
|
|
params: -tags=native cmd/sointu-track/main.go
|
|
packages: libegl-dev libvulkan-dev libxkbcommon-x11-dev libwayland-dev libasound2-dev libx11-xcb-dev libxcursor-dev libxfixes-dev
|
|
- os: ubuntu-latest
|
|
asmnasm: /home/runner/nasm/nasm
|
|
output: sointu-vsti.so
|
|
params: -buildmode=c-shared -tags=plugin ./cmd/sointu-vsti/
|
|
packages: libegl-dev libvulkan-dev libxkbcommon-x11-dev libwayland-dev libasound2-dev libx11-xcb-dev libxcursor-dev libxfixes-dev
|
|
- os: ubuntu-latest
|
|
asmnasm: /home/runner/nasm/nasm
|
|
output: sointu-vsti-native.so
|
|
params: -buildmode=c-shared -tags="plugin,native" ./cmd/sointu-vsti/
|
|
packages: libegl-dev libvulkan-dev libxkbcommon-x11-dev libwayland-dev libasound2-dev libx11-xcb-dev libxcursor-dev libxfixes-dev
|
|
- os: macos-latest
|
|
asmnasm: /Users/runner/nasm/nasm
|
|
output: sointu-track
|
|
params: cmd/sointu-track/main.go
|
|
- os: macos-latest
|
|
asmnasm: /Users/runner/nasm/nasm
|
|
output: sointu-compile
|
|
params: cmd/sointu-compile/main.go
|
|
- os: macos-13
|
|
asmnasm: /Users/runner/nasm/nasm
|
|
output: sointu-track-native
|
|
params: -tags=native cmd/sointu-track/main.go
|
|
- os: macos-13
|
|
asmnasm: /Users/runner/nasm/nasm
|
|
output: sointu-vsti.a
|
|
bundleoutput: sointu-vsti
|
|
MACOSX_DEPLOYMENT_TARGET: 11
|
|
params: -buildmode=c-archive -tags=plugin ./cmd/sointu-vsti/
|
|
bundle: true
|
|
- os: macos-13
|
|
asmnasm: /Users/runner/nasm/nasm
|
|
output: sointu-vsti-native.a
|
|
bundleoutput: sointu-vsti-native
|
|
MACOSX_DEPLOYMENT_TARGET: 11
|
|
params: -buildmode=c-archive -tags="plugin,native" ./cmd/sointu-vsti/
|
|
bundle: true
|
|
steps:
|
|
- uses: benjlevesque/short-sha@v3.0
|
|
id: short-sha
|
|
with:
|
|
length: 7
|
|
- uses: lukka/get-cmake@latest
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-go@v5 # has to be after checkout, see https://medium.com/@s0k0mata/github-actions-and-go-the-new-cache-feature-in-actions-setup-go-v4-and-what-to-watch-out-for-aeea373ed07d
|
|
with:
|
|
go-version: '>=1.21.0'
|
|
- uses: ilammy/setup-nasm@v1.5.1
|
|
- uses: awalsh128/cache-apt-pkgs-action@latest
|
|
with:
|
|
packages: ${{ matrix.config.packages }}
|
|
version: 1.0
|
|
if: runner.os == 'Linux'
|
|
- name: Build library
|
|
env:
|
|
ASM_NASM: ${{ matrix.config.asmnasm }}
|
|
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.MACOSX_DEPLOYMENT_TARGET }}
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake -GNinja ..
|
|
ninja sointu
|
|
- name: Build binary
|
|
env:
|
|
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.MACOSX_DEPLOYMENT_TARGET }}
|
|
run: |
|
|
go build -ldflags "-X github.com/vsariola/sointu/version.Version=$(git describe) ${{ matrix.config.ldflags}}" -o ${{ matrix.config.output }} ${{ matrix.config.params }}
|
|
- name: Upload binary
|
|
if: matrix.config.bundle != true
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ runner.os }}-${{ steps.short-sha.outputs.sha }}-${{ matrix.config.output }}
|
|
path: ${{ matrix.config.output }}
|
|
- name: Bundle VST
|
|
if: matrix.config.bundle
|
|
env:
|
|
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.config.MACOSX_DEPLOYMENT_TARGET }}
|
|
run: | # following https://github.com/RustAudio/vst-rs/blob/master/osx_vst_bundler.sh
|
|
mkdir -p "bundle/${{ matrix.config.bundleoutput }}.vst/Contents/MacOS"
|
|
clang -L./build/ -lsointu -bundle -o bundle/${{ matrix.config.bundleoutput }} -all_load ${{ matrix.config.output }}
|
|
echo "BNDL????" > "bundle/${{ matrix.config.bundleoutput }}.vst/Contents/PkgInfo"
|
|
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
|
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
|
|
<plist version=\"1.0\">
|
|
<dict>
|
|
<key>CFBundleDevelopmentRegion</key>
|
|
<string>English</string>
|
|
|
|
<key>CFBundleExecutable</key>
|
|
<string>${{ matrix.config.bundleoutput }}</string>
|
|
|
|
<key>CFBundleGetInfoString</key>
|
|
<string>vst</string>
|
|
|
|
<key>CFBundleIconFile</key>
|
|
<string></string>
|
|
|
|
<key>CFBundleIdentifier</key>
|
|
<string>com.vsariola.${{ matrix.config.bundleoutput }}</string>
|
|
|
|
<key>CFBundleInfoDictionaryVersion</key>
|
|
<string>6.0</string>
|
|
|
|
<key>CFBundleName</key>
|
|
<string>${{ matrix.config.bundleoutput }}</string>
|
|
|
|
<key>CFBundlePackageType</key>
|
|
<string>BNDL</string>
|
|
|
|
<key>CFBundleVersion</key>
|
|
<string>1.0</string>
|
|
|
|
<key>CFBundleSignature</key>
|
|
<string>$((RANDOM % 9999))</string>
|
|
|
|
<key>CSResourcesFileMapped</key>
|
|
<string></string>
|
|
|
|
</dict>
|
|
</plist>" > "bundle/${{ matrix.config.bundleoutput }}.vst/Contents/Info.plist"
|
|
mv "bundle/${{ matrix.config.bundleoutput }}" "bundle/${{ matrix.config.bundleoutput }}.vst/Contents/MacOS/${{ matrix.config.bundleoutput }}"
|
|
- name: Upload bundle
|
|
if: matrix.config.bundle
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ runner.os }}-${{ steps.short-sha.outputs.sha }}-${{ matrix.config.bundleoutput }}
|
|
path: bundle
|
|
upload_release_asset:
|
|
needs: [create_release, binaries]
|
|
runs-on: ubuntu-latest
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
strategy:
|
|
matrix:
|
|
config:
|
|
- os: Windows
|
|
- os: Linux
|
|
- os: macOS
|
|
steps:
|
|
- uses: benjlevesque/short-sha@v2.2
|
|
id: short-sha
|
|
with:
|
|
length: 7
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: ${{ matrix.config.os }}-${{ steps.short-sha.outputs.sha }}-*
|
|
merge-multiple: true
|
|
path: sointu-${{ matrix.config.os }}
|
|
- name: Zip binaries
|
|
run: |
|
|
zip ./sointu-${{ matrix.config.os }}.zip sointu-${{ matrix.config.os }}/*
|
|
- name: Upload release assets
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ needs.create_release.outputs.upload_url }}
|
|
asset_name: sointu-${{ matrix.config.os }}.zip
|
|
asset_path: ./sointu-${{ matrix.config.os }}.zip
|
|
asset_content_type: application/octet-stream |