commit 8736b1f8acccb3241b8e2c3f1755f3fc2e5bdae7
parent 9ade43dd2fdaa702b8e69c279051d11d8884dabb
Author: Matt Demanett <matt@demanett.net>
Date: Mon, 27 Apr 2020 23:29:07 -0400
Github actions scripts to compile on push to master and build on release -- thanks to @david-c14 SubmarineFree.
Diffstat:
9 files changed, 185 insertions(+), 0 deletions(-)
diff --git a/.github/actions/build_linux/Dockerfile b/.github/actions/build_linux/Dockerfile
@@ -0,0 +1,9 @@
+FROM ubuntu:16.04
+
+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"]
diff --git a/.github/actions/build_linux/entrypoint.sh b/.github/actions/build_linux/entrypoint.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -eu
+
+export RACK_DIR=${GITHUB_WORKSPACE}/Rack-SDK
+export RACK_USER_DIR=${GITHUB_WORKSPACE}
+
+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 dist
diff --git a/.github/actions/build_osx/Dockerfile b/.github/actions/build_osx/Dockerfile
@@ -0,0 +1,50 @@
+
+FROM debian
+
+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
+
+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"]
diff --git a/.github/actions/build_osx/entrypoint.sh b/.github/actions/build_osx/entrypoint.sh
@@ -0,0 +1,16 @@
+#!/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
+
+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 dist
diff --git a/.github/actions/build_win/Dockerfile b/.github/actions/build_win/Dockerfile
@@ -0,0 +1,9 @@
+FROM debian:stretch
+
+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"]
diff --git a/.github/actions/build_win/entrypoint.sh b/.github/actions/build_win/entrypoint.sh
@@ -0,0 +1,16 @@
+#!/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
+
+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 dist
diff --git a/.github/actions/upload_zip/script.sh b/.github/actions/upload_zip/script.sh
@@ -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/"}
diff --git a/.github/workflows/buildDevelop.yml b/.github/workflows/buildDevelop.yml
@@ -0,0 +1,15 @@
+on:
+ push:
+ branches:
+ - master
+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
diff --git a/.github/workflows/buildRelease.yml b/.github/workflows/buildRelease.yml
@@ -0,0 +1,34 @@
+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 }}