Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AppCenter Download URL as environment variable #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ This action uploads artifacts (.apk or .ipa) to Visual Studio App Center.
**Required** Artifact to upload (.apk or .ipa)

### `buildVersion`

Build version parameter required for .zip, .msi, .pkg and .dmg files

### buildNumber

Build number parameter required for macOS .pkg and .dmg files

### `releaseNotes`
Expand All @@ -50,6 +52,14 @@ If set to true, shows useful debug information from the action execution.
This action is Docker-based. It means **it can only execute on runners with a Linux operating system**.
See Github Actions [documentation](https://docs.github.com/en/actions/creating-actions/about-actions#docker-container-actions) for details.

## Supported Evnvironment Variables

This action support environment variables for convenience. ([setting-an-environment-variable](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable))

| Env Var | Description |
| ------------------------- | ---------------------------------- |
| `APPCENTER_DOWNLOAD_LINK` | URL to download Artifact uploaded. |

## Sample usage

```
Expand Down
3 changes: 3 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ for group in $INPUT_GROUP; do
isFirst=false
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)
downloadUrl=$(appcenter distribute releases show --token "$INPUT_TOKEN" --app "$INPUT_APPNAME" --release-id "$releaseId" --output json | grep -o '"[^"]*"\s*:\s*"[^"]*"' | grep -E '^"downloadUrl"' | cut -d ':' -f 2,3 | tr -d '"')

echo "APPCENTER_DOWNLOAD_LINK=$downloadUrl" >> "$GITHUB_ENV"
else
appcenter distribute releases add-destination --token "$INPUT_TOKEN" -d $group -t group -r $releaseId --app "$INPUT_APPNAME" "${params[@]}"
fi
Expand Down