From 73b2f29388338468ef1d10476f51e32e684ec574 Mon Sep 17 00:00:00 2001 From: felixh Date: Thu, 13 Jun 2024 16:32:56 +0930 Subject: [PATCH] fixing build yml --- .github/workflows/build-plugin.yml | 2498 ++-------------------------- 1 file changed, 133 insertions(+), 2365 deletions(-) diff --git a/.github/workflows/build-plugin.yml b/.github/workflows/build-plugin.yml index 36446e3..6e29e0d 100644 --- a/.github/workflows/build-plugin.yml +++ b/.github/workflows/build-plugin.yml @@ -1,2365 +1,133 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - vcv-plugin-github-actions-example/.github/workflows/build-plugin.yml at main · qno/vcv-plugin-github-actions-example · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- Skip to content - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - -
- -
- -
- -
- - - - / - - vcv-plugin-github-actions-example - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - - -
- - - - - - - - - - - - - - - - -

Latest commit

 

History

History
133 lines (126 loc) · 4.17 KB

File metadata and controls

133 lines (126 loc) · 4.17 KB
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2024 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - -
- -
-
- - - +name: Build VCV Rack Plugin +on: [push, pull_request] + +env: + rack-sdk-version: latest + rack-plugin-toolchain-dir: /home/build/rack-plugin-toolchain + +defaults: + run: + shell: bash + +jobs: + + modify-plugin-version: + name: Modify plugin version + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + id: plugin-version-cache + with: + path: plugin.json + key: ${{ github.sha }}-${{ github.run_id }} + - run: | + gitrev=`git rev-parse --short HEAD` + pluginversion=`jq -r '.version' plugin.json` + echo "Set plugin version from $pluginversion to $pluginversion-$gitrev" + cat <<< `jq --arg VERSION "$pluginversion-$gitrev" '.version=$VERSION' plugin.json` > plugin.json + # 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 + container: + image: ghcr.io/qno/rack-plugin-toolchain-win-linux + options: --user root + strategy: + matrix: + platform: [win-x64, lin-x64] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/cache@v4 + 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 }} + make plugin-build-${{ matrix.platform }} + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + path: ${{ env.rack-plugin-toolchain-dir }}/plugin-build + name: ${{ matrix.platform }} + + build-mac: + name: mac + needs: modify-plugin-version + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + platform: [x64, arm64] + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: actions/cache@v4 + id: plugin-version-cache + with: + path: plugin.json + key: ${{ github.sha }}-${{ github.run_id }} + - name: Get Rack-SDK + run: | + pushd $HOME + wget -O Rack-SDK.zip https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}-mac-x64+arm64.zip + unzip Rack-SDK.zip + - name: Build plugin + run: | + CROSS_COMPILE_TARGET_x64=x86_64-apple-darwin + CROSS_COMPILE_TARGET_arm64=arm64-apple-darwin + export RACK_DIR=$HOME/Rack-SDK + export CROSS_COMPILE=$CROSS_COMPILE_TARGET_${{ matrix.platform }} + make dep + make dist + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + path: dist/*.vcvplugin + name: mac-${{ matrix.platform }} + + publish: + name: Publish plugin + # 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') + runs-on: ubuntu-latest + needs: [build, build-mac] + steps: + - uses: actions/checkout@v4 + - uses: FranzDiebold/github-env-vars-action@v2 + - name: Check if plugin version matches tag + run: | + pluginversion=`jq -r '.version' plugin.json` + if [ "v$pluginversion" != "${{ env.CI_REF_NAME }}" ]; then + echo "Plugin version from plugin.json 'v$pluginversion' doesn't match with tag version '${{ env.CI_REF_NAME }}'" + exit 1 + fi + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref }} + name: Release ${{ env.CI_REF_NAME }} + body: | + ${{ env.CI_REPOSITORY_NAME }} VCV Rack Plugin ${{ env.CI_REF_NAME }} + draft: false + prerelease: false + - uses: actions/download-artifact@v4 + 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