Skip to content

Commit

Permalink
Add automated MOD builds
Browse files Browse the repository at this point in the history
  • Loading branch information
davemollen committed Aug 20, 2024
1 parent 965ab49 commit 52e5fc1
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 20 deletions.
60 changes: 56 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,19 @@ defaults:
env:
binary_name: dm_rat
plugin_name: dm-Rat
mod_package_name: dm-rat

jobs:
package-nih-plug:
name: Package nih-plug binaries
strategy:
matrix:
include:
- { name: ubuntu, os: ubuntu-latest, cross-target: "" }
- { name: macos, os: macos-latest, cross-target: x86_64-apple-darwin }
- { name: windows, os: windows-latest, cross-target: "" }
name: Package nih-plug binaries
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Fetch all git history
Expand Down Expand Up @@ -81,7 +83,7 @@ jobs:
- name: Determine build archive name
run: |
# Windows (usually) doesn't like colons in file names
echo "ARCHIVE_NAME=$plugin_name-${{ matrix.name }}" >> "$GITHUB_ENV"
echo "ARCHIVE_NAME=$plugin_name-vst-and-clap-${{ matrix.name }}" >> "$GITHUB_ENV"
- name: Move all packaged plugin into a directory
run: |
Expand All @@ -90,8 +92,8 @@ jobs:
- name: Rename plugins
run: |
for file_name in $ARCHIVE_NAME/$binary_name.*;
do mv $file_name "${file_name/$binary_name/$plugin_name}";
for file_name in $ARCHIVE_NAME/$binary_name.*;
do mv $file_name "${file_name/$binary_name/$plugin_name}";
done
- name: Add an OS-specific readme file with installation instructions
Expand All @@ -105,3 +107,53 @@ jobs:
with:
name: ${{github.ref_name}}
files: ${{ env.ARCHIVE_NAME }}.zip

package-mod-plugin:
name: Package mod plugins
strategy:
matrix:
platform: [modduo-new, modduox-new, moddwarf-new]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Docker image from GHCR
run: docker pull ghcr.io/davemollen/${{ matrix.platform }}-plugin-builder:latest

- name: Run Docker container
run: docker run -t -d --name mpb ghcr.io/davemollen/${{ matrix.platform }}-plugin-builder:latest

- name: Update commit sha in build script
run: sed -i 's/<SHA>/${{ github.sha }}/' .github/workflows/$mod_package_name.mk

- name: Add local build script to Docker container
run: |
docker exec -w /root/mod-plugin-builder/plugins/package mpb mkdir -p $mod_package_name
docker cp .github/workflows/$mod_package_name.mk mpb:/root/mod-plugin-builder/plugins/package/$mod_package_name
- name: Build for modaudio
run: docker exec mpb ./build ${{ matrix.platform }} $mod_package_name

- name: Determine build archive name
run: echo "ARCHIVE_NAME=$plugin_name-${{ matrix.platform }}" >> "$GITHUB_ENV"

- name: Zip files
run: |
mkdir -p $ARCHIVE_NAME
docker cp mpb:/root/mod-workdir/${{ matrix.platform }}/plugins/$plugin_name.lv2 $ARCHIVE_NAME
cp .github/workflows/readme-Mod.txt "$ARCHIVE_NAME/README.txt"
tar -cf $ARCHIVE_NAME.zip $ARCHIVE_NAME
- name: Add zip to release
uses: softprops/action-gh-release@v2
with:
name: ${{github.ref_name}}
files: ${{ env.ARCHIVE_NAME }}.zip
31 changes: 31 additions & 0 deletions .github/workflows/dm-rat.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
######################################
#
# dm-rat
#
######################################

DM_RAT_VERSION = <SHA>
DM_RAT_SITE = https://github.com/davemollen/dm-Rat.git
DM_RAT_SITE_METHOD = git
DM_RAT_BUNDLES = dm-Rat.lv2

# Nightly toolchain is needed to enable simd
define DM_RAT_CONFIGURE_CMDS
~/.cargo/bin/rustup toolchain install nightly-2024-08-07
~/.cargo/bin/rustup default nightly-2024-08-07
~/.cargo/bin/rustup target add $(MOD_PLUGIN_BUILDER_RUST_TARGET)
endef

define DM_RAT_BUILD_CMDS
rm -f $(@D)/lv2/dm-Rat.lv2/libdm_rat.so
(cd $(@D)/lv2 && \
~/.cargo/bin/cargo build $(MOD_PLUGIN_BUILDER_RUST_BUILD_FLAGS))
endef

define DM_RAT_INSTALL_TARGET_CMDS
$(INSTALL) -d $(TARGET_DIR)/usr/lib/lv2
cp -rv $(@D)/lv2/dm-Rat.lv2 $(TARGET_DIR)/usr/lib/lv2/
$(INSTALL) -m 644 $(@D)/lv2/target/$(MOD_PLUGIN_BUILDER_RUST_TARGET)/release/libdm_rat.so $(TARGET_DIR)/usr/lib/lv2/dm-Rat.lv2/
endef

$(eval $(generic-package))
10 changes: 10 additions & 0 deletions .github/workflows/readme-Mod.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
To install the MOD plugin, copy the .lv2 folder to your MOD:

- Open the terminal and run "scp -O -rp <path-to-plugin.lv2> root@moddwarf.local:/root/.lv2/" to copy the lv2 folder to your MOD.
Don't forget to replace <path-to-plugin.lv2> with the correct path.
- If this is the first time you connect to your MOD via ssh you will get the following prompt:
“Are you sure you want to continue connecting (yes/no/[fingerprint])?”.
Answer this with “yes”.
- When asked for the root@moddwarf.local’s password, enter “mod”.
- The plugin files should have been successfully copied to your MOD. You might need to reboot your MOD to get the plugin to show up.

35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
## dm-Rat

A mono distortion effect written in Rust.
A distortion effect written in Rust modeled after the ProCo Rat.

The effect can be compiled to a [MOD devices](https://moddevices.com/), VST3 or CLAP plugin.
VST is a trademark of Steinberg Media Technologies GmbH, registered in Europe and other countries.

<img src="https://steinbergmedia.github.io/vst3_dev_portal/resources/licensing_6.png" width="60" height="auto" alt="VST trademark">
The effect can be compiled to a [MOD audio](https://mod.audio/), VST3 or CLAP plugin.

## Table of contents:

- [Download VST3 and CLAP plugin](#Download-VST3-and-CLAP-plugin)
- [MOD devices installation](#MOD-devices-installation)
- [Other plugin formats](#Other-plugin-formats)
- [VST3 and CLAP installation](#VST3-and-CLAP-installation)
- [MOD installation](#MOD-installation)
- [Copyright notices](#Copyright-notices)

## Download VST3 and CLAP plugin
## VST3 and CLAP installation

You can download the VST3 and CLAP plugins for Linux, Windows and macOS from the [release page](https://github.com/davemollen/dm-Rat/releases).
You can download the VST3 and CLAP plugins for Linux, Windows and macOS from the [releases page](https://github.com/davemollen/dm-Rat/releases).

On macOS you may need to [disable Gatekeeper](https://disable-gatekeeper.github.io/) as Apple has recently made it more difficult to run unsigned code on macOS.

If you want to build the plugin on your own machine, check out the [nih-plug readme](https://github.com/robbert-vdh/nih-plug).
If you want to build the plugin on your own machine check out the [nih-plug repository](https://github.com/robbert-vdh/nih-plug) for instructions.

## MOD devices installation
## MOD installation

This plugin is not yet in the MOD Audio plugin store.
However, you can find a build of the plugin for the MOD Dwarf at [./lv2/dm-Rat.lv2](./lv2/dm-Rat.lv2/). Copy this file to your MOD devices' plugin folder. If you want a build for MOD Duo or MOD Duo X you'll need to build the plugin yourself for now. For more information about building this plugin for your MOD device, see [these instructions](https://github.com/moddevices/mod-plugin-builder).
However, you can download the latest MOD Dwarf build from the [releases page](https://github.com/davemollen/dm-Rat/releases).

If you want to build the plugin on your own machine check out the [mod-plugin-builder repository](https://github.com/moddevices/mod-plugin-builder) for instructions.

## Copyright notices

## Other plugin formats
ProCo Rat is a trademark or trade name of another manufacturer and was used merely to identify the product whose sound was reviewed in the creation of this product.

Code for a LV2 plugin is also in this repository. But automated builds are excluded for LV2 because the rust lv2 crate doesn't have GUI support. The LV2 plugin format is being used for the MOD devices plugin which in turn does have a GUI. Because MOD has it's own GUI layer on top of the LV2 plugin.
VST is a trademark of Steinberg Media Technologies GmbH, registered in Europe and other countries.

All other trademarks are the property of their respective holders.

<img src="https://steinbergmedia.github.io/vst3_dev_portal/resources/licensing_6.png" width="60" height="auto" alt="VST trademark">
4 changes: 3 additions & 1 deletion lv2/dm-Rat.lv2/dm-Rat_dsp.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
mod:brand "DM" ;
mod:label "Rat" ;
rdfs:comment """
A distortion effect written in Rust.
A distortion effect modeled after the ProCo Rat(*).
(*) 'ProCo Rat is a trademark or trade name of another manufacturer and was used merely to identify the product whose sound was reviewed in the creation of this product. All other trademarks are the property of their respective holders.'
""" ;
lv2:requiredFeature lv2:inPlaceBroken ;
lv2:optionalFeature lv2:hardRTCapable ;
Expand Down
Binary file removed lv2/dm-Rat.lv2/libdm_rat.so
Binary file not shown.

0 comments on commit 52e5fc1

Please sign in to comment.