-
-
Save alvareztech/fac06904a87e119ec97e97f3b30e0317 to your computer and use it in GitHub Desktop.
AppCenter script: Uploading using the APIs
This file contains hidden or 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
# https://docs.microsoft.com/en-us/appcenter/distribution/uploading | |
UPLOAD=$(curl \ | |
-X POST --header 'Content-Type: application/json' \ | |
--header 'Accept: application/json' \ | |
--header 'X-API-Token: 123456789' 'https://api.appcenter.ms/v0.1/apps/a3dany/Android-Demo-CI/release_uploads') | |
echo "Upload response: $UPLOAD" | |
UPLOAD_ID=$(echo $UPLOAD | jq --raw-output '.upload_id') | |
UPLOAD_URL=$(echo $UPLOAD | jq --raw-output '.upload_url') | |
echo "Upload ID: $UPLOAD_ID" | |
echo "Upload URL: $UPLOAD_URL" | |
curl \ | |
-F "ipa=@app/app-debug.apk" \ | |
"$UPLOAD_URL" | |
RELEASE=$(curl \ | |
-X PATCH \ | |
--header 'Content-Type: application/json' \ | |
--header 'Accept: application/json' \ | |
--header 'X-API-Token: 123456789' -d '{ "status": "committed" }' "https://api.appcenter.ms/v0.1/apps/a3dany/Android-Demo-CI/release_uploads/$UPLOAD_ID") | |
RELEASE_ID=$(echo $RELEASE | jq --raw-output '.release_id') | |
RELEASE_URL=$(echo $RELEASE | jq --raw-output '.release_url') | |
echo "Release ID: $RELEASE_ID" | |
echo "Release URL: $RELEASE_URL" | |
curl \ | |
-X PATCH \ | |
--header 'Content-Type: application/json' \ | |
--header 'Accept: application/json' \ | |
--header 'X-API-Token: 123456789' -d '{ "destination_name": "QA Testers", "release_notes": "Example new release via the APIs" }' \ | |
"https://api.appcenter.ms/v0.1/apps/a3dany/Android-Demo-CI/releases/$RELEASE_ID" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use
jq
JSON processor: https://stedolan.github.io/jq/