Changes to compile on latest toolchain #256
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build VCV Rack Plugin Development | |
on: [workflow_dispatch,push,pull_request] | |
env: | |
rack-sdk-version: beta.1 | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
name: Linux | |
arch: lin | |
compiler: cc | |
install-dependencies: | | |
sudo apt-get update | |
sudo apt-get install libglu1-mesa-dev | |
- os: macos-latest | |
name: Mac | |
arch: mac | |
compiler: cc | |
install-dependencies: | | |
brew install mesa | |
- os: windows-latest | |
name: Windows | |
arch: win | |
compiler: gcc | |
install-dependencies: | | |
choco install --no-progress -y zip | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Get Rack-SDK | |
run: | | |
pushd $HOME | |
curl -o RackSDK.zip https://vcvrack.com/downloads/Rack-SDK-2.${{ env.rack-sdk-version }}-${{ matrix.arch }}.zip | |
unzip RackSDK.zip | |
- name: Patch makefiles, use 7zip on Windows | |
if: runner.os == 'windows' | |
run: | | |
sed -i 's/zip -q -9 -r/7z a -tzip -mx=9/' $HOME/Rack-SDK/plugin.mk | |
- name: Modify plugin version | |
# only modify plugin version if no tag was created | |
if: "! startsWith(github.ref, 'refs/tags/v')" | |
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 | |
- name: Build plugin | |
env: | |
RACK_DIR: Rack-SDK | |
CC: ${{ matrix.compiler }} | |
run: | | |
${{ matrix.install-dependencies }} | |
export RACK_DIR=$HOME/Rack-SDK | |
make dep | |
make dist | |
- name: Upload artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
path: dist | |
name: ${{ matrix.name }}-${{ env.rack-sdk-version }} | |
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 | |
steps: | |
- uses: actions/checkout@v2 | |
- 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 }} - Rack version ${{ env.rack-sdk-version }} | |
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 |