summaryrefslogtreecommitdiff
path: root/release
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2019-12-16 03:19:18 +0530
committerGitHub <noreply@github.com>2019-12-16 03:19:18 +0530
commite61551bf3756a49f9eb4ee03bd726f3c6167dad7 (patch)
tree2a4c60c76aa6b24fb492cb2ea57def3cc29483c7 /release
parent3a7c54136047c5d2d7bb807100bcc40affad65d2 (diff)
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 <msfjarvis@gmail.com>
Diffstat (limited to 'release')
-rwxr-xr-xrelease/deploy-github.sh9
-rwxr-xr-xrelease/deploy-snapshot.sh11
-rw-r--r--release/keystore.cipherbin0 -> 4336 bytes
-rw-r--r--release/props.cipher2
-rwxr-xr-xrelease/signing-cleanup.sh7
-rwxr-xr-xrelease/signing-setup.sh13
6 files changed, 42 insertions, 0 deletions
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
--- /dev/null
+++ b/release/keystore.cipher
Binary files 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