Skip to content

Commit

Permalink
Update build-plugin.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Jadael committed May 18, 2024
1 parent 327a317 commit 19ab703
Showing 1 changed file with 38 additions and 24 deletions.
62 changes: 38 additions & 24 deletions .github/workflows/build-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,18 @@ defaults:

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:
fail-fast: false
matrix:
platform: [win-x64, lin-x64]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/cache@v4
id: plugin-version-cache
with:
Expand All @@ -68,15 +48,49 @@ jobs:
with:
path: ${{ env.rack-plugin-toolchain-dir }}/plugin-build
name: ${{ matrix.platform }}
overwrite: true

build-mac:
name: mac
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%2barm64.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]
needs: [build, build-mac]
steps:
- uses: actions/checkout@v4
- uses: FranzDiebold/github-env-vars-action@v2
Expand Down Expand Up @@ -110,7 +124,7 @@ jobs:
publish-nightly:
name: Publish nightly
runs-on: ubuntu-latest
needs: [build]
needs: [build, build-mac]
steps:
- uses: actions/download-artifact@v4
with:
Expand Down

0 comments on commit 19ab703

Please sign in to comment.