-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add app center Sparkle signing and deploy scripts (#164)
- Loading branch information
1 parent
2398b92
commit d26f733
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -euf -o pipefail | ||
|
||
APP_NAME="dexterleng/Vimac" | ||
|
||
SHOW_MASTER_BUILDS=$(appcenter build branches show -b master -a $APP_NAME) | ||
LATEST_MASTER_BUILD_ID=$(echo "$SHOW_MASTER_BUILDS" | awk '/^Build ID:/ {print $3}') | ||
|
||
echo "Creating release for Build ID $LATEST_MASTER_BUILD_ID." | ||
|
||
curl -X POST \ | ||
"https://appcenter.ms/api/v0.1/apps/dexterleng/Vimac/builds/$LATEST_MASTER_BUILD_ID/distribute" \ | ||
-H "authorization: $AUTH_TOKEN" \ | ||
-H 'cache-control: no-cache' \ | ||
-H 'content-type: application/json' \ | ||
-d '{ | ||
"destinations": [] | ||
}' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
set -e -o pipefail | ||
|
||
APP_NAME="dexterleng/Vimac" | ||
|
||
# SHOW_RELEASES=$(appcenter distribute releases list -a $APP_NAME) | ||
# LATEST_RELEASE_ID=$(echo "$SHOW_RELEASES" | awk '/^ID:/ {print $2}') | ||
|
||
echo $LATEST_RELEASE_ID | ||
|
||
RELEASE_API="https://appcenter.ms/api/v0.1/apps/dexterleng/Vimac/releases/${LATEST_RELEASE_ID}" | ||
|
||
RELEASE_DOWNLOAD_URL=$(curl -X GET \ | ||
"${RELEASE_API}" \ | ||
-H "authorization: $AUTH_TOKEN" \ | ||
-H 'cache-control: no-cache' \ | ||
-H 'content-type: application/json' \ | ||
| jq -r '.download_url') | ||
|
||
echo $RELEASE_DOWNLOAD_URL | ||
|
||
BINARY_FILE_LOCATION=$(mktemp) | ||
|
||
curl "$RELEASE_DOWNLOAD_URL" > $BINARY_FILE_LOCATION | ||
|
||
# Run this script from project root instead of script/ | ||
SIGN_UPDATE_OUTPUT=$(./Pods/Sparkle/bin/sign_update $BINARY_FILE_LOCATION) | ||
SIGNATURE=$(echo $SIGN_UPDATE_OUTPUT | awk -F '"' '{print $2}') | ||
|
||
echo $SIGN_UPDATE_OUTPUT | ||
echo $SIGNATURE | ||
|
||
# echo "Adding EdDSA signature and Sparkl destination for release $RELEASE_ID." | ||
|
||
curl -X PATCH \ | ||
"${RELEASE_API}" \ | ||
-H "authorization: $AUTH_TOKEN" \ | ||
-H 'cache-control: no-cache' \ | ||
-H 'content-type: application/json' \ | ||
-d "{ | ||
\"destinations\": [ | ||
{ | ||
\"name\": \"Sparkle\" | ||
} | ||
], | ||
\"metadata\": { | ||
\"ed_signature\": \"$SIGNATURE\" | ||
} | ||
}" |