Skip to content

Commit

Permalink
Merge pull request #11 from mtsch/v1
Browse files Browse the repository at this point in the history
Add CI
  • Loading branch information
mtsch authored Jul 19, 2021
2 parents 0087224 + a7ec295 commit 10d0931
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 5 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Build VCV Rack Plugin
on: [push, pull_request]

env:
rack-sdk-version: 1.1.6

defaults:
run:
shell: bash

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
name: Linux,
os: ubuntu-latest,
prepare-os: sudo apt install -y libglu-dev
}
- {
name: MacOS,
os: macos-latest,
prepare-os: ""
}
- {
name: Windows,
os: windows-latest,
prepare-os: export CC=gcc
}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Get Rack-SDK
run: |
pushd $HOME
curl -o Rack-SDK.zip https://vcvrack.com/downloads/Rack-SDK-${{ env.rack-sdk-version }}.zip
unzip Rack-SDK.zip
- name: Patch plugin.mk, 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
run: |
${{ matrix.config.prepare-os }}
export RACK_DIR=$HOME/Rack-SDK
make -j dist
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: dist
name: ${{ matrix.config.name }}

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 }}
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/**/*.zip
tag: ${{ github.ref }}
file_glob: true
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# mtsch plugins

My modules for [VCVRack](https://github.com/VCVRack/Rack). I am currently unable to maintain
this project because I have problems with running Rack on my computer. If you want to become
a maintainer, let me know.
My modules for [VCVRack](https://github.com/VCVRack/Rack).

### Rationals

Expand Down
4 changes: 2 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"brand": "mtsch",
"author": "mtsch",
"authorEmail": "",
"authorEmail": "matijacufar@gmail.com",
"authorUrl": "",
"pluginUrl": "https://github.com/mtsch/mtsch-vcvrack-plugins",
"manualUrl": "https://github.com/mtsch/mtsch-vcvrack-plugins",
Expand Down Expand Up @@ -38,4 +38,4 @@
]
}
]
}
}

0 comments on commit 10d0931

Please sign in to comment.