Skip to content

Commit

Permalink
IOPS-1755 Use GH App Installation token for downloading libwebrtc assets
Browse files Browse the repository at this point in the history
  • Loading branch information
msobo1 committed Aug 16, 2023
1 parent ec985b7 commit cd37bee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ jobs:
GH_ACCESS_TOKEN_1H_EXPIRATION: $[ dependencies.PreprocessingBuild.outputs['accessToken.GH_ACCESS_TOKEN_1H_EXPIRATION'] ]
LIBWEBRTC_ASSETS_PATTERN: "^libWebRTC-${{ variables.LIBWEBRTC_VERSION }}.*-64-Release-H264-OpenSSL.*.dmg.*"
steps:
- script: git submodule update --init --recursive
displayName: 'Checkout Submodules'

# - script: git submodule update --init --recursive
# displayName: 'Checkout Submodules'
- checkout: none
- bash: |
echo $(LIBWEBRTC_ASSETS_PATTERN)
export LIBWEBRTC_RELEASE_URL=$(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $(GH_ACCESS_TOKEN_1H_EXPIRATION)" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/CoSMoSoftware/libwebrtc-cmake/releases/tags/${LIBWEBRTC_RELEASE_TAG} | jq .url | tr -d '"')
echo "LIBWEBRTC_RELEASE_URL: ${LIBWEBRTC_RELEASE_URL}"
curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $(GH_ACCESS_TOKEN_1H_EXPIRATION)" -H "X-GitHub-Api-Version: 2022-11-28" ${LIBWEBRTC_RELEASE_URL}/assets > assets.json
for asset_pair in $(cat assets.json | jq '.[] | (.id|tostring) + "|" + .name' | tr -d '"')
do
asset_pair=( ${asset_pair//|/ } )
echo ${asset_pair[0]} ${asset_pair[1]}
if [[ $(echo ${asset_pair[1]} | grep -e $(LIBWEBRTC_ASSETS_PATTERN)) ]]; then
echo "Downloading ${asset_pair[1]} from GitHub - GH_ASSET_ID: ${asset_pair[0]}..."
curl -L -H "Accept: application/octet-stream" -H "Authorization: Bearer $(GH_ACCESS_TOKEN_1H_EXPIRATION)" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/CoSMoSoftware/libwebrtc-cmake/releases/assets/${asset_pair[0]} > $(System.DefaultWorkingDirectory)/${asset_pair[1]}
Expand Down

0 comments on commit cd37bee

Please sign in to comment.