Skip to content

Instantly share code, notes, and snippets.

@waynezhang
Created May 21, 2021 07:54
Show Gist options
  • Save waynezhang/2dee342f2d5a213119a9e7f07b678948 to your computer and use it in GitHub Desktop.
Save waynezhang/2dee342f2d5a213119a9e7f07b678948 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
# sign.sh app release_id file
APP=$1
RELEASE_ID=$2
FILE=$3
SIGNATURE=$(./bin/sign_update ${FILE} | sed 's/[^"]*="\([^"]*\).*/\1/g')
TOKEN=$(security find-generic-password -gws "AppCenter Sparkle Token")
echo "Sign ${APP} release ${RELEASE_ID}, signature $SIGNATURE"
curl -X "PATCH" "https://api.appcenter.ms/v0.1/apps/${APP}/releases/${RELEASE_ID}" \
-H "X-API-Token: $TOKEN" \
-H 'Content-Type: application/json; charset=utf-8' \
-d $"{
\"metadata\": {
\"ed_signature\": \"$SIGNATURE\"
}
}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment