From 61ab2b1d1e4137604824f5b87d274da65a8dad7c Mon Sep 17 00:00:00 2001 From: Serge Poltavski Date: Sat, 24 Mar 2018 02:50:50 +0300 Subject: [PATCH] make deploy added for macosx --- ceammc/distrib/mac/github_upload_release.sh | 39 +++++++++++++++++++++ cmake/PdPlatform.cmake | 12 +++++++ 2 files changed, 51 insertions(+) create mode 100755 ceammc/distrib/mac/github_upload_release.sh diff --git a/ceammc/distrib/mac/github_upload_release.sh b/ceammc/distrib/mac/github_upload_release.sh new file mode 100755 index 0000000000..cd8fe07b2e --- /dev/null +++ b/ceammc/distrib/mac/github_upload_release.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +cd ~ +eval `gpgshell` +cd - + +if [[ -z ${GITHUB_TOKEN} ]] +then + tput setaf 9 + echo "ERROR: " + tput setaf 15 + echo " \$GITHUB_TOKEN is not set. Exiting..." + exit 1 +fi + +DMG="$1" + +if [ ! -f "$DMG" ] +then + tput setaf 9 + echo "ERROR: " + tput setaf 15 + echo " file is not found: $DMG. Exiting..." + exit 1 +fi + +TAG="v$2" +USER=uliss +REPO="pure-data" +NAME=$(basename $DMG) + +github-release upload --user $USER \ + --repo $REPO \ + --tag $TAG \ + --name $NAME \ + --file "$DMG" \ + --replace + + diff --git a/cmake/PdPlatform.cmake b/cmake/PdPlatform.cmake index fcce4fc991..d8f7aefc1e 100644 --- a/cmake/PdPlatform.cmake +++ b/cmake/PdPlatform.cmake @@ -328,6 +328,18 @@ if(APPLE) ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_BINARY_DIR} DEPENDS app) + + find_program(GPGENV_EXE NAMES gpgenv) + + if(GPGENV_EXE) + add_custom_target(deploy + COMMAND + ${PROJECT_SOURCE_DIR}/ceammc/distrib/mac/github_upload_release.sh + "${PROJECT_BINARY_DIR}/Pd_${PD_MACOSX_BUNDLE_SUFFIX}-macosx-${MACOSX_VERSION}.dmg" + ${CEAMMC_DISTRIB_VERSION} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + DEPENDS app) + endif() endif() if(UNIX AND NOT APPLE)