From e61551bf3756a49f9eb4ee03bd726f3c6167dad7 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 16 Dec 2019 03:19:18 +0530 Subject: Setup snapshot deployment (#599) * Setup snapshot deployment * README: Update repository links * README: Update workflow badge link * README: Add link to Snapshot builds * Fix snapshot/pull-request build conflict * Deploy from feature/deploy-snapshots as well * Revert "Deploy from feature/deploy-snapshots as well" Confirmed it works well This reverts commit 06f6bc0e8c19f238643655d09ca20f83dd416283. Signed-off-by: Harsh Shandilya --- release/deploy-github.sh | 9 +++++++++ release/deploy-snapshot.sh | 11 +++++++++++ release/keystore.cipher | Bin 0 -> 4336 bytes release/props.cipher | 2 ++ release/signing-cleanup.sh | 7 +++++++ release/signing-setup.sh | 13 +++++++++++++ 6 files changed, 42 insertions(+) create mode 100755 release/deploy-github.sh create mode 100755 release/deploy-snapshot.sh create mode 100644 release/keystore.cipher create mode 100644 release/props.cipher create mode 100755 release/signing-cleanup.sh create mode 100755 release/signing-setup.sh (limited to 'release') diff --git a/release/deploy-github.sh b/release/deploy-github.sh new file mode 100755 index 00000000..42a984c4 --- /dev/null +++ b/release/deploy-github.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +trap 'exit 1' SIGINT SIGTERM + +[ -z "$(command -v hub)" ] && { echo "hub not installed; aborting!"; exit 1; } +TAG="${1}" +hub tag -afs "${TAG:?}" +gradle clean bundleRelease assembleRelease +hub release create "${TAG}" -a app/build/outputs/apk/release/aps_"${TAG}".apk diff --git a/release/deploy-snapshot.sh b/release/deploy-snapshot.sh new file mode 100755 index 00000000..e5d64b0d --- /dev/null +++ b/release/deploy-snapshot.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env sh + +export SSHDIR="$HOME/.ssh" +mkdir -p "$SSHDIR" +echo "$ACTIONS_DEPLOY_KEY" > "$SSHDIR/key" +chmod 600 "$SSHDIR/key" +export SERVER_DEPLOY_STRING="$SSH_USERNAME@$SERVER_ADDRESS:$SERVER_DESTINATION" +cd "$GITHUB_WORKSPACE/app/build/outputs/apk/release" +rm output.json +rsync -ahvcr --omit-dir-times --progress --delete --no-o --no-g -e "ssh -i $SSHDIR/key -o StrictHostKeyChecking=no -p $SSH_PORT" . "$SERVER_DEPLOY_STRING" || true +exit 0 diff --git a/release/keystore.cipher b/release/keystore.cipher new file mode 100644 index 00000000..269ed5ef Binary files /dev/null and b/release/keystore.cipher differ diff --git a/release/props.cipher b/release/props.cipher new file mode 100644 index 00000000..986eab14 --- /dev/null +++ b/release/props.cipher @@ -0,0 +1,2 @@ +Salted__4Ӏ~Oj +r&4Y՝uD~R+s' [uӯvIه نq/L4OFUx4" #.RW!l#ܑhRq(H"ǶI1S}İҸc c \ No newline at end of file diff --git a/release/signing-cleanup.sh b/release/signing-cleanup.sh new file mode 100755 index 00000000..babe793e --- /dev/null +++ b/release/signing-cleanup.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +# Delete Release key +rm -f keystore.jks + +# Delete signing config +rm -f keystore.properties diff --git a/release/signing-setup.sh b/release/signing-setup.sh new file mode 100755 index 00000000..b60902ee --- /dev/null +++ b/release/signing-setup.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +ENCRYPT_KEY=$1 + +if [[ -n "$ENCRYPT_KEY" ]]; then + # Decrypt Release key + openssl enc -aes-256-cbc -md sha256 -d -in release/keystore.cipher -out keystore.jks -k "${ENCRYPT_KEY}" + + # Decrypt signing config + openssl enc -aes-256-cbc -md sha256 -d -in release/props.cipher -out keystore.properties -k "${ENCRYPT_KEY}" +else + echo "ENCRYPT_KEY is empty" +fi -- cgit v1.2.3