Skip to content

Commit 009eca4

Browse files
committed
get kiota binary download link
1 parent 3eef546 commit 009eca4

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed
Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
steps:
22
- bash: |
3-
LATEST_TAG=$(curl -sL -o /dev/null -w "%{url_effective}" "https://github.com/microsoft/kiota/releases/latest" | rev | cut -d'/' -f1 | rev)
3+
RELEASE_JSON=$(curl -s "https://api.github.com/repos/microsoft/kiota/releases/latest")
4+
LATEST_TAG=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
5+
ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '.assets[] | select(.name | test("linux-x64")) | .browser_download_url')
46
echo "Downloading Kiota $LATEST_TAG"
5-
curl -L "https://github.com/microsoft/kiota/releases/download/${LATEST_TAG}/linux-x64.zip" -o kiota.zip
6-
unzip kiota.zip -d $(Build.ArtifactStagingDirectory)
7+
echo "Asset URL: $ASSET_URL"
8+
curl -L "$ASSET_URL" -o kiota_download
9+
if [[ "$ASSET_URL" == *.zip ]]; then
10+
unzip kiota_download -d $(Build.ArtifactStagingDirectory)
11+
else
12+
tar -xzf kiota_download -C $(Build.ArtifactStagingDirectory)
13+
fi
714
displayName: 'Download latest Kiota from GitHub'

0 commit comments

Comments
 (0)