Skip to content

Commit

Permalink
Merge pull request #7 from david-c14/feature/colors
Browse files Browse the repository at this point in the history
Feature/colors
  • Loading branch information
david-c14 authored Feb 5, 2020
2 parents 155fb31 + ac97d04 commit 24533dd
Show file tree
Hide file tree
Showing 20 changed files with 304 additions and 109 deletions.
18 changes: 18 additions & 0 deletions .github/actions/build_linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ubuntu:16.04

LABEL "com.github.actions.name"="VCVRackPluginBuilder-Linux"
LABEL "com.github.actions.description"="Builds a VCV Rack plugin for Linux"
LABEL "com.github.actions.icon"="headphones"
LABEL "com.github.actions.color"="purple"

LABEL "repository"="TBD"
LABEL "homepage"="TBD"
LABEL "maintainer"="dewb"

RUN apt-get update
RUN apt-get install -y build-essential cmake curl gcc g++ git make tar unzip zip libgl1-mesa-dev libglu1-mesa-dev jq

ADD entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
15 changes: 15 additions & 0 deletions .github/actions/build_linux/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

set -eu

export RACK_DIR=${GITHUB_WORKSPACE}/Rack-SDK
export RACK_USER_DIR=${GITHUB_WORKSPACE}

git submodule update --init --recursive

curl -L https://vcvrack.com/downloads/Rack-SDK-${RACK_SDK_VERSION}.zip -o rack-sdk.zip
unzip -o rack-sdk.zip
rm rack-sdk.zip

make clean
make dist
64 changes: 64 additions & 0 deletions .github/actions/build_osx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

FROM debian

LABEL "com.github.actions.name"="VCVRackPluginBuilder-OSX"
LABEL "com.github.actions.description"="Builds a VCV Rack plugin for OS X"
LABEL "com.github.actions.icon"="headphones"
LABEL "com.github.actions.color"="purple"

LABEL "repository"="TBD"
LABEL "homepage"="TBD"
LABEL "maintainer"="dewb"

RUN apt-get update && \
apt-get upgrade -yy && \
apt-get install -yy \
automake \
bison \
curl \
file \
flex \
git \
libtool \
pkg-config \
python \
texinfo \
vim \
wget \
zlib1g-dev \
build-essential \
cmake \
make \
tar \
unzip \
zip \
libgl1-mesa-dev \
libglu1-mesa-dev \
jq \
rsync

# Install osxcross
# NOTE: The Docker Hub's build machines run varying types of CPUs, so an image
# built with `-march=native` on one of those may not run on every machine - I
# ran into this problem when the images wouldn't run on my 2013-era Macbook
# Pro. As such, we remove this flag entirely.
ENV OSXCROSS_SDK_VERSION 10.11
RUN SDK_VERSION=$OSXCROSS_SDK_VERSION \
mkdir /opt/osxcross && \
cd /opt && \
git clone /~https://github.com/tpoechtrager/osxcross.git && \
cd osxcross && \
git checkout e0a171828a72a0d7ad4409489033536590008ebf && \
sed -i -e 's|-march=native||g' ./build_clang.sh ./wrapper/build.sh && \
./tools/get_dependencies.sh && \
curl -L -o ./tarballs/MacOSX${OSXCROSS_SDK_VERSION}.sdk.tar.xz \
/~https://github.com/apriorit/osxcross-sdks/raw/master/MacOSX${OSXCROSS_SDK_VERSION}.sdk.tar.xz && \
yes | PORTABLE=true ./build.sh && \
./build_compiler_rt.sh

ENV PATH $PATH:/opt/osxcross/target/bin

ADD entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
19 changes: 19 additions & 0 deletions .github/actions/build_osx/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -eu

export RACK_DIR=${GITHUB_WORKSPACE}/Rack-SDK
export RACK_USER_DIR=${GITHUB_WORKSPACE}

export CC=x86_64-apple-darwin15-clang
export CXX=x86_64-apple-darwin15-clang++
export STRIP=x86_64-apple-darwin15-strip

git submodule update --init --recursive

curl -L https://vcvrack.com/downloads/Rack-SDK-${RACK_SDK_VERSION}.zip -o rack-sdk.zip
unzip -o rack-sdk.zip
rm rack-sdk.zip

make clean
make dist
18 changes: 18 additions & 0 deletions .github/actions/build_win/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM debian:stretch

LABEL "com.github.actions.name"="VCVRackPluginBuilder-Windows"
LABEL "com.github.actions.description"="Builds a VCV Rack plugin for Windows"
LABEL "com.github.actions.icon"="headphones"
LABEL "com.github.actions.color"="purple"

LABEL "repository"="TBD"
LABEL "homepage"="TBD"
LABEL "maintainer"="dewb"

RUN apt-get update
RUN apt-get install -y build-essential cmake curl gcc g++ git make tar unzip zip libgl1-mesa-dev libglu1-mesa-dev jq g++-mingw-w64-x86-64

ADD entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
19 changes: 19 additions & 0 deletions .github/actions/build_win/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -eu

export RACK_DIR=${GITHUB_WORKSPACE}/Rack-SDK
export RACK_USER_DIR=${GITHUB_WORKSPACE}

export CC=x86_64-w64-mingw32-gcc-posix
export CXX=x86_64-w64-mingw32-g++-posix
export STRIP=x86_64-w64-mingw32-strip

git submodule update --init --recursive

curl -L https://vcvrack.com/downloads/Rack-SDK-${RACK_SDK_VERSION}.zip -o rack-sdk.zip
unzip -o rack-sdk.zip
rm rack-sdk.zip

make clean
make dist
42 changes: 42 additions & 0 deletions .github/actions/combine_zip/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/sh

set -eu

GITHUB_API_URL=https://api.github.com

GITHUB_TOKEN=$1

curl -o release.json \
--header "Authorization: token ${GITHUB_TOKEN}" \
--request GET \
${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${GITHUB_REF#"refs/"}

UPLOAD_URL=$(jq -r .upload_url release.json)

DOWNLOAD_LIST=$(jq -r ".assets | .[] | .url" release.json)

rm release.json

mkdir dist

echo "$DOWNLOAD_LIST" | while IFS= read -r line
do
curl -L -o $(basename $line).zip --header "Authorization: token ${GITHUB_TOKEN}" --header "Accept: application/octet-stream" --request GET $line
unzip -o $(basename $line).zip -d dist
rm $(basename $line).zip
done

PLUGIN_BUILD_SLUG=$(jq -r .slug plugin.json)
PLUGIN_BUILD_NAME=${PLUGIN_BUILD_SLUG}-$(jq -r .version plugin.json)
cd dist
zip -q -9 -r ${PLUGIN_BUILD_NAME}.zip ./${PLUGIN_BUILD_SLUG}
cd ..

ASSET_PATH=$(ls dist/*.zip)

curl -i \
--header "Authorization: token ${GITHUB_TOKEN}" \
--header "Content-Type: application/zip" \
--request POST \
--data-binary @"${ASSET_PATH}" \
${UPLOAD_URL%"{?name,label\}"}?name=${ASSET_PATH#"dist/"}
24 changes: 24 additions & 0 deletions .github/actions/upload_zip/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

set -eu

GITHUB_API_URL=https://api.github.com

GITHUB_TOKEN=$1

# Get release url
curl -o release.json \
--header "Authorization: token ${GITHUB_TOKEN}" \
--request GET \
${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${GITHUB_REF#"refs/"}

UPLOAD_URL=$(jq -r .upload_url release.json)

ASSET_PATH=$(ls dist/*.zip)

curl -i \
--header "Authorization: token ${GITHUB_TOKEN}" \
--header "Content-Type: application/zip" \
--request POST \
--data-binary @"${ASSET_PATH}" \
${UPLOAD_URL%"{?name,label\}"}?name=${ASSET_PATH#"dist/"}
15 changes: 15 additions & 0 deletions .github/workflows/buildDevelop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
push:
branches:
- develop
name: Develop
env:
RACK_SDK_VERSION: 1.1.6
jobs:
buildLinux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build Linux
uses: ./.github/actions/build_linux
42 changes: 42 additions & 0 deletions .github/workflows/buildRelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
on:
release:
types: [published]
name: Release
env:
RACK_SDK_VERSION: 1.1.6
jobs:
buildLinux:
name: Build Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build Linux
uses: ./.github/actions/build_linux
- name: upload zip
run: sh ./.github/actions/upload_zip/script.sh ${{ secrets.GITHUB_TOKEN }}
buildWindows:
name: Build Windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build Windows
uses: ./.github/actions/build_win
- name: upload zip
run: sh ./.github/actions/upload_zip/script.sh ${{ secrets.GITHUB_TOKEN }}
buildOsx:
name: Build OSX
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build OSX
uses: ./.github/actions/build_osx
- name: upload zip
run: sh ./.github/actions/upload_zip/script.sh ${{ secrets.GITHUB_TOKEN }}
combineDist:
name: Combine Distributions
runs-on: ubuntu-latest
needs: [buildLinux, buildWindows, buildOsx]
steps:
- uses: actions/checkout@master
- name: combine zip
run: sh ./.github/actions/combine_zip/script.sh ${{ secrets.GITHUB_TOKEN }}
93 changes: 0 additions & 93 deletions OFL.txt

This file was deleted.

14 changes: 0 additions & 14 deletions README.MD

This file was deleted.

Loading

0 comments on commit 24533dd

Please sign in to comment.