Skip to content

Commit

Permalink
ci: Added delay to site extension publishing to wait for NPM
Browse files Browse the repository at this point in the history
Signed-off-by: mrickard <[email protected]>
  • Loading branch information
mrickard committed Oct 16, 2024
1 parent b917b3e commit bb0e1e5
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/azure-site-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,39 @@ jobs:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.arch }}

- name: Find agent version
- name: Get local agent version
run: |
$env:local_agent_version = node -p "require('./package.json').version"
echo "AGENT_VERSION=$env:local_agent_version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Find agent version at npm
run: |
$env:npm_agent_version = npm view newrelic version
echo "NPM_AGENT_VERSION=$env:npm_agent_version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Check NPM availability
if: ${{ env.NPM_AGENT_VERSION != env.AGENT_VERSION }}
run: |
$count = 0
while($count -lt 10) {
Start-Sleep -s 120
$npmversion = npm view newrelic version
echo "Checking npm ($count): $npmversion"
$test = [Version]$npmversion -match [Version]${{ env.AGENT_VERSION }}
if ([Version]$npmversion -match [Version]${{ env.AGENT_VERSION }}) {
break;
}
$count++
}
$env:npm_agent_version = npm view newrelic version
echo "AGENT_VERSION=$env:npm_agent_version" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "Done with delayed check. Published version: $env:npm_agent_version Local version: ${{env.AGENT_VERSION}}"
echo "NPM_AGENT_VERSION=$env:npm_agent_version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Has the new agent been published?
if: ${{ env.NPM_AGENT_VERSION != env.AGENT_VERSION }}
run: |
echo "Published agent version (${{env.NPM_AGENT_VERSION }}) is behind local agent version (${{env.AGENT_VERSION}}); exiting."
exit 1;
- name: Set package filename
run: |
Expand Down

0 comments on commit bb0e1e5

Please sign in to comment.