diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index 5daa57e..35eb86c 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -16,9 +16,9 @@ jobs: with: submodules: recursive - - name: "build_debug.sh" + - name: "build_and_copy.sh debug" run: | - ./ci_cd/build_debug.sh + ./ci_cd/build_and_copy.sh debug shell: bash - name: "validate.sh" diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 24835af..7db0e06 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -17,9 +17,9 @@ jobs: with: submodules: recursive - - name: "build_release.sh" + - name: "build_and_copy.sh release" run: | - ./ci_cd/build_release.sh + ./ci_cd/build_and_copy.sh release shell: bash - name: "validate.sh" diff --git a/build/build.sh b/build/build.sh index 6f48fe7..36954ee 100755 --- a/build/build.sh +++ b/build/build.sh @@ -5,11 +5,11 @@ scriptdir="$(dirname "$0")" cd "$scriptdir" # Check the first argument for build type +build_type="debug" if [ -z "$1" ]; then echo "No argument supplied. Please specify 'release' or 'debug'." - echo "(Defaulting to release build!)" + echo "(Defaulting to $build_type build!)" - build_type="release" else build_type=$1 fi diff --git a/ci_cd/build_and_copy.sh b/ci_cd/build_and_copy.sh new file mode 100755 index 0000000..9b390ee --- /dev/null +++ b/ci_cd/build_and_copy.sh @@ -0,0 +1,32 @@ +#! /bin/bash -e + +# Disable shell debug output +set +x + +PLUGIN="utilities" + +ROOT=$(cd "$(dirname "$0")/.."; pwd) +cd "$ROOT" + +# Check the first argument for build type +if [ "$1" == "debug" ]; then + BUILD_TYPE="Debug" +elif [ "$1" == "release" ]; then + BUILD_TYPE="Release" +else + echo "Invalid argument. Please specify 'debug' or 'release'." + exit 1 +fi + +# Make folder for built plugins +cd "$ROOT/ci_cd" +rm -Rf bin +mkdir bin + +# Build plugin +cd "$ROOT/build" +./build.sh $1 + +# Copy plugin builds to dedicated folder +cp -R "$ROOT/build/${PLUGIN}_artefacts/$BUILD_TYPE/AU/$PLUGIN.component" "$ROOT/ci_cd/bin" +cp -R "$ROOT/build/${PLUGIN}_artefacts/$BUILD_TYPE/VST3/$PLUGIN.vst3" "$ROOT/ci_cd/bin" \ No newline at end of file diff --git a/ci_cd/build_debug.sh b/ci_cd/build_debug.sh deleted file mode 100755 index 5d4eae9..0000000 --- a/ci_cd/build_debug.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash -e - -# Disable shell debug output -set +x - -PLUGIN="utilities" - -ROOT=$(cd "$(dirname "$0")/.."; pwd) -cd "$ROOT" - -# Make folder for built plugins -cd "$ROOT/ci_cd" -rm -Rf bin -mkdir bin - -# Build in debug mode -cd "$ROOT/build" -./build.sh debug - -# Copy plugin builds to dedicated folder -cp -R "$ROOT/build/${PLUGIN}_artefacts/Debug/AU/$PLUGIN.component" "$ROOT/ci_cd/bin" -cp -R "$ROOT/build/${PLUGIN}_artefacts/Debug/VST3/$PLUGIN.vst3" "$ROOT/ci_cd/bin" \ No newline at end of file diff --git a/ci_cd/build_release.sh b/ci_cd/build_release.sh deleted file mode 100755 index 768ddc0..0000000 --- a/ci_cd/build_release.sh +++ /dev/null @@ -1,22 +0,0 @@ -#! /bin/bash -e - -# Disable shell debug output -set +x - -PLUGIN="utilities" - -ROOT=$(cd "$(dirname "$0")/.."; pwd) -cd "$ROOT" - -# Make folder for built plugins -cd "$ROOT/ci_cd" -rm -Rf bin -mkdir bin - -# Build in release mode -cd "$ROOT/build" -./build.sh release - -# Copy plugin builds to dedicated folder -cp -R "$ROOT/build/${PLUGIN}_artefacts/Release/AU/$PLUGIN.component" "$ROOT/ci_cd/bin" -cp -R "$ROOT/build/${PLUGIN}_artefacts/Release/VST3/$PLUGIN.vst3" "$ROOT/ci_cd/bin"