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

ci: Added delay to site extension publishing to wait for NPM #2665

Merged
Merged
Changes from 1 commit
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
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;
mrickard marked this conversation as resolved.
Show resolved Hide resolved

- name: Set package filename
run: |
Expand Down