Skip to content

Commit

Permalink
Merge pull request #1 from valsteen/valsteen-patch-1
Browse files Browse the repository at this point in the history
Create rust.yml
  • Loading branch information
valsteen authored Nov 15, 2020
2 parents f11983b + 1470582 commit d0ffe59
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Rust

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: macos-10.15

steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Release
run: cargo build --verbose --release
- name: Produce bundle
run: ./osx_vst_bundler.sh
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: Mac OSX VST Bundle
path: artefact
if-no-files-found: error
57 changes: 57 additions & 0 deletions osx_vst_bundler.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

ARTEFACT_DIRECTORY=artefact
BUNDLE_NAME=NoteGenerator
LIB_PATH=target/release/libnote_generator.dylib

# Make the bundle folder
mkdir -p "${ARTEFACT_DIRECTORY}/${BUNDLE_NAME}.vst/Contents/MacOS"

# Create the PkgInfo
echo "BNDL????" > "${ARTEFACT_DIRECTORY}/${BUNDLE_NAME}.vst/Contents/PkgInfo"

#build the Info.Plist
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${BUNDLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>vst</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.rust-vst.${BUNDLE_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleVersion</key>
<string>1.$((RANDOM % 9999))</string>
<key>CFBundleSignature</key>
<string>$((RANDOM % 9999))</string>
<key>CSResourcesFileMapped</key>
<string></string>
</dict>
</plist>" > "${ARTEFACT_DIRECTORY}/${BUNDLE_NAME}.vst/Contents/Info.plist"

# move the provided library to the correct location
cp "${LIB_PATH}" "${ARTEFACT_DIRECTORY}/${BUNDLE_NAME}.vst/Contents/MacOS/${BUNDLE_NAME}"

echo "Created bundle ${BUNDLE_NAME}.vst"

0 comments on commit d0ffe59

Please sign in to comment.