diff --git a/README.md b/README.md index 034db0b..ace5aea 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ This action uploads artifacts (.apk or .ipa) to Visual Studio App Center. **Required** Distribution group (or multiple groups split by **;** delimiter) +### `appstore` + +App Store (or multiple stores split by **;** delimiter) + ### `file` **Required** Artifact to upload (.apk or .ipa) diff --git a/action.yml b/action.yml index 9aad221..347892c 100644 --- a/action.yml +++ b/action.yml @@ -11,6 +11,9 @@ inputs: group: description: "Distribution group" required: true + appstore: + description: "App Store" + required: false file: description: "Artefact to upload (.apk or .ipa)" required: true diff --git a/entrypoint.sh b/entrypoint.sh index 74968c1..180d46f 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -27,9 +27,19 @@ fi for group in $INPUT_GROUP; do if ${isFirst} ; then isFirst=false - appcenter distribute release --token "$INPUT_TOKEN" --app "$INPUT_APPNAME" --group $group --file "$INPUT_FILE" --release-notes "$RELEASE_NOTES" "${params[@]}" + appcenter distribute release --token "$INPUT_TOKEN" --app "$INPUT_APPNAME" --group "$group" --file "$INPUT_FILE" --release-notes "$RELEASE_NOTES" "${params[@]}" releaseId=$(appcenter distribute releases list --token "$INPUT_TOKEN" --app "$INPUT_APPNAME" | grep ID | tr -s ' ' | cut -f2 -d ' ' | sort -n -r | head -1) else - appcenter distribute releases add-destination --token "$INPUT_TOKEN" -d $group -t group -r $releaseId --app "$INPUT_APPNAME" "${params[@]}" + appcenter distribute releases add-destination --token "$INPUT_TOKEN" -d "$group" -t group -r "$releaseId" --app "$INPUT_APPNAME" "${params[@]}" + fi +done + +for appstore in $INPUT_APPSTORE; do + if ${isFirst} ; then + isFirst=false + appcenter distribute release --token "$INPUT_TOKEN" --app "$INPUT_APPNAME" --store "$appstore" --file "$INPUT_FILE" --release-notes "$RELEASE_NOTES" "${params[@]}" + releaseId=$(appcenter distribute releases list --token "$INPUT_TOKEN" --app "$INPUT_APPNAME" | grep ID | tr -s ' ' | cut -f2 -d ' ' | sort -n -r | head -1) + else + appcenter distribute releases add-destination --token "$INPUT_TOKEN" -d "$appstore" -t store -r "$releaseId" --app "$INPUT_APPNAME" fi done