diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14dc8185..967141ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,22 +104,51 @@ jobs: - name: Set install name run: | echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV" - echo "install_name=sfizz-${GITHUB_REF##*/}-linux" >> "$GITHUB_ENV" + echo "install_name=sfizz-${GITHUB_REF##*/}-macos" >> "$GITHUB_ENV" - uses: actions/checkout@v2 with: submodules: recursive - - name: Build mac universal + - name: Create Build Environment + shell: bash + working-directory: ${{runner.workspace}} + run: cmake -E make_directory build + - name: Configure CMake + shell: bash + working-directory: ${{runner.workspace}}/build run: | - mkdir build - cd build - cmake .. - make - cd .. + cmake "$GITHUB_WORKSPACE" \ + -DCMAKE_BUILD_TYPE=Release \ + -DSFIZZ_AU=ON \ + -DSFIZZ_LV2=ON \ + -DSFIZZ_LV2_UI=ON \ + -DSFIZZ_VST=ON \ + -DSFIZZ_JACK=OFF \ + -DSFIZZ_TESTS=OFF \ + -DSFIZZ_SHARED=OFF \ + -DSFIZZ_STATIC_DEPENDENCIES=OFF + - name: Build plugins + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake --build . --config "Release" -j 2 + - name: Package OSX bundles + shell: bash + working-directory: ${{runner.workspace}} + run: ./sfizz/scripts/package-osx-bundles.sh + - name: Create OSX installer + shell: bash + working-directory: ${{runner.workspace}}/build + run: | + productbuild \ + --distribution $GITHUB_WORKSPACE/scripts/plugin.pkg/package.xml \ + --identifier "sfz.tools.sfizz" \ + --package-path "${{runner.workspace}}/build" \ + --version 0 \ + ${{env.install_name}}.pkg - uses: actions/upload-artifact@v2 with: - name: MacOS build + name: MacOS installer path: | - build/sfizz.* + ${{runner.workspace}}/build/${{env.install_name}}.pkg build_for_mod: runs-on: ubuntu-18.04 diff --git a/scripts/package-osx-bundles.sh b/scripts/package-osx-bundles.sh new file mode 100755 index 00000000..8d24bf37 --- /dev/null +++ b/scripts/package-osx-bundles.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# Adapted from Distrho's package-osx-bundles.sh script + +set -e + +if [ -d build ]; then + cd build +else + echo "Please run this script from the root folder" + exit +fi + +rm -rf au +rm -rf lv2 +rm -rf vst3 + +mkdir au lv2 vst3 +mv sfizz.component au/ +mv sfizz.lv2 lv2/ +mv sfizz.vst3 vst3/ + +pkgbuild \ + --identifier "sfz.tools.sfizz.au.bundle" \ + --install-location "/Library/Audio/Plug-Ins/Component/" \ + --root "${PWD}/au/" \ + sfz-tools-sfizz-au-bundle.pkg + +pkgbuild \ + --identifier "sfz.tools.sfizz.lv2.bundle" \ + --install-location "/Library/Audio/Plug-Ins/LV2/" \ + --root "${PWD}/lv2/" \ + sfz-tools-sfizz-lv2-bundle.pkg + +pkgbuild \ + --identifier "sfz.tools.sfizz.vst3.bundle" \ + --install-location "/Library/Audio/Plug-Ins/VST3/" \ + --root "${PWD}/vst3/" \ + sfz-tools-sfizz-vst3-bundle.pkg + +cd .. \ No newline at end of file diff --git a/scripts/plugin.pkg/package.xml b/scripts/plugin.pkg/package.xml new file mode 100644 index 00000000..51e64e99 --- /dev/null +++ b/scripts/plugin.pkg/package.xml @@ -0,0 +1,22 @@ + + + sfizz + + + + + + sfz-tools-sfizz-au-bundle.pkg + + + sfz-tools-sfizz-lv2-bundle.pkg + + + sfz-tools-sfizz-vst3-bundle.pkg + + + + + + + diff --git a/scripts/plugin.pkg/welcome.txt b/scripts/plugin.pkg/welcome.txt new file mode 100644 index 00000000..2db11151 --- /dev/null +++ b/scripts/plugin.pkg/welcome.txt @@ -0,0 +1,3 @@ +OSX installer for sfizz + +sfizz is a sample-based musical synthesizer. \ No newline at end of file