diff --git a/.github/workflows/build-plugin.yml b/.github/workflows/build-plugin.yml index b8e298b..c110e68 100644 --- a/.github/workflows/build-plugin.yml +++ b/.github/workflows/build-plugin.yml @@ -37,38 +37,38 @@ jobs: # only modify plugin version if no tag was created if: "! startsWith(github.ref, 'refs/tags/v')" - # build: - # name: ${{ matrix.platform }} - # needs: modify-plugin-version - # runs-on: ubuntu-latest - # if: github.repository_owner == 'Simon-L' - # container: - # image: ghcr.io/qno/rack-plugin-toolchain-win-linux:v2 - # options: --user root - # strategy: - # fail-fast: false - # matrix: - # platform: [ win, linux ] - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive - # - uses: actions/cache@v2 - # id: plugin-version-cache - # with: - # path: plugin.json - # key: ${{ github.sha }}-${{ github.run_id }} - # - name: Build plugin - # run: | - # export PLUGIN_DIR=$GITHUB_WORKSPACE - # pushd ${{ env.rack-plugin-toolchain-dir }} - # sed -i "s/-G 'MSYS Makefiles'/-DCMAKE_SYSTEM_NAME=Windows/g" Rack-SDK-win/dep.mk - # make plugin-build-${{ matrix.platform }} - # - name: Upload artifact - # uses: actions/upload-artifact@v2 - # with: - # path: ${{ env.rack-plugin-toolchain-dir }}/plugin-build - # name: ${{ matrix.platform }} + build: + name: ${{ matrix.platform }} + needs: modify-plugin-version + runs-on: ubuntu-latest + if: github.repository_owner == 'Simon-L' + container: + image: ghcr.io/qno/rack-plugin-toolchain-win-linux:v2 + options: --user root + strategy: + fail-fast: false + matrix: + platform: [ win, linux ] + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: actions/cache@v2 + id: plugin-version-cache + with: + path: plugin.json + key: ${{ github.sha }}-${{ github.run_id }} + - name: Build plugin + run: | + export PLUGIN_DIR=$GITHUB_WORKSPACE + pushd ${{ env.rack-plugin-toolchain-dir }} + sed -i "s/-G 'MSYS Makefiles'/-DCMAKE_SYSTEM_NAME=Windows/g" Rack-SDK-win/dep.mk + make plugin-build-${{ matrix.platform }} + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + path: ${{ env.rack-plugin-toolchain-dir }}/plugin-build + name: ${{ matrix.platform }} build-mac: name: mac @@ -100,66 +100,66 @@ jobs: path: dist name: mac - # publish: - # name: Publish Release - # # only create a release if a tag was created that is called e.g. v1.2.3 - # # see also https://vcvrack.com/manual/Manifest#version - # if: startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'Simon-L' - # runs-on: ubuntu-latest - # needs: [ build, build-mac ] - # steps: - # - uses: actions/checkout@v3 - # - uses: FranzDiebold/github-env-vars-action@v1.2.1 - # - name: Check if plugin version matches tag - # run: | - # pluginversion=`jq -r '.version' plugin.json` - # if [ "v$pluginversion" != "${{ env.GITHUB_REF_NAME }}" ]; then - # echo "Plugin version from plugin.json 'v$pluginversion' doesn't match with tag version '${{ env.GITHUB_REF_NAME }}'" - # exit 1 - # fi - # - name: Create Release - # uses: actions/create-release@v1 - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # tag_name: ${{ github.ref }} - # release_name: Release ${{ github.ref }} - # body: | - # ${{ env.GITHUB_REPOSITORY_NAME }} VCV Rack Plugin ${{ env.GITHUB_REF_NAME }} - # draft: false - # prerelease: false - # - uses: actions/download-artifact@v2 - # with: - # path: _artifacts - # - name: Upload release assets - # uses: svenstaro/upload-release-action@v2 - # with: - # repo_token: ${{ secrets.GITHUB_TOKEN }} - # file: _artifacts/**/*.vcvplugin - # tag: ${{ github.ref }} - # file_glob: true + publish: + name: Publish Release + # only create a release if a tag was created that is called e.g. v1.2.3 + # see also https://vcvrack.com/manual/Manifest#version + if: startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'Simon-L' + runs-on: ubuntu-latest + needs: [ build, build-mac ] + steps: + - uses: actions/checkout@v3 + - uses: FranzDiebold/github-env-vars-action@v1.2.1 + - name: Check if plugin version matches tag + run: | + pluginversion=`jq -r '.version' plugin.json` + if [ "v$pluginversion" != "${{ env.GITHUB_REF_NAME }}" ]; then + echo "Plugin version from plugin.json 'v$pluginversion' doesn't match with tag version '${{ env.GITHUB_REF_NAME }}'" + exit 1 + fi + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: | + ${{ env.GITHUB_REPOSITORY_NAME }} VCV Rack Plugin ${{ env.GITHUB_REF_NAME }} + draft: false + prerelease: false + - uses: actions/download-artifact@v2 + with: + path: _artifacts + - name: Upload release assets + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: _artifacts/**/*.vcvplugin + tag: ${{ github.ref }} + file_glob: true - # publish-nightly: - # name: Publish Nightly - # # only create a release if a tag was created that is called e.g. v1.2.3 - # # see also https://vcvrack.com/manual/Manifest#version - # if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'Simon-L' }} - # runs-on: ubuntu-latest - # needs: [ build, build-mac ] - # steps: - # - uses: actions/download-artifact@v2 - # with: - # path: _artifacts - # - name: Delete old release assets - # uses: mknejp/delete-release-assets@v1 - # with: - # token: ${{ github.token }} - # tag: Nightly # This may also be of the form 'refs/tags/staging' - # assets: '*' - # - name: Upload release assets - # uses: svenstaro/upload-release-action@v2 - # with: - # repo_token: ${{ secrets.GITHUB_TOKEN }} - # file: _artifacts/**/*.vcvplugin - # tag: Nightly - # file_glob: true + publish-nightly: + name: Publish Nightly + # only create a release if a tag was created that is called e.g. v1.2.3 + # see also https://vcvrack.com/manual/Manifest#version + if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'Simon-L' }} + runs-on: ubuntu-latest + needs: [ build, build-mac ] + steps: + - uses: actions/download-artifact@v2 + with: + path: _artifacts + - name: Delete old release assets + uses: mknejp/delete-release-assets@v1 + with: + token: ${{ github.token }} + tag: Nightly # This may also be of the form 'refs/tags/staging' + assets: '*' + - name: Upload release assets + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: _artifacts/**/*.vcvplugin + tag: Nightly + file_glob: true diff --git a/Makefile b/Makefile index de08ad8..a3aad1a 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ $(chowdsp): echo "add_subdirectory(../chowdsp_utils .)" >> dep/libchowdsp/CMakeLists.txt echo "setup_chowdsp_lib(chowdsp MODULES chowdsp_filters)" >> dep/libchowdsp/CMakeLists.txt echo "target_compile_features(chowdsp PRIVATE cxx_std_17)" >> dep/libchowdsp/CMakeLists.txt - cd dep/libchowdsp && $(CMAKE) . && make -j16 + cd dep/libchowdsp && $(CMAKE) . -DCMAKE_BUILD_TYPE=Release && make -j16 git clone https://github.com/Chowdhury-DSP/chowdsp_wdf dep/chowdsp_wdf # Careful about linking to shared libraries, since you can't assume much about the user's environment and library search path.