Skip to content

Commit 720df97

Browse files
radicalCopilot
andcommitted
Wire CLI archive verification into CI pipelines
Add post-signing verification steps to both build_sign_native.yml (macOS/Linux) and BuildAndTest.yml (Windows) that run the verification scripts after the CLI archives are built and signed. Verification runs for RIDs that can fully execute on the build agent: - macOS (Apple Silicon): osx-arm64 only - Linux (amd64): linux-x64 only - Windows: win-x64 This ensures that signing/permissions regressions (like the ones fixed in this PR) are caught during the official build before release. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1fd5f7d commit 720df97

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

eng/pipelines/templates/BuildAndTest.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ steps:
9292
/p:BuildExtension=true
9393
displayName: 🟣Build
9494

95+
# Verify the signed win-x64 CLI archive works (version check + project creation + build)
96+
- pwsh: |
97+
$ErrorActionPreference = 'Stop'
98+
$archiveDir = "${{ parameters.repoArtifactsPath }}/packages/${{ parameters.buildConfig }}"
99+
$archive = Get-ChildItem -Path $archiveDir -Filter "aspire-cli-win-x64-*.zip" -Recurse -ErrorAction SilentlyContinue | Select-Object -First 1
100+
if (-not $archive) {
101+
Write-Host "##[warning]No win-x64 CLI archive found - skipping verification"
102+
exit 0
103+
}
104+
Write-Host "Found archive: $($archive.FullName)"
105+
& "$(Build.SourcesDirectory)/eng/scripts/verify-cli-archive.ps1" -ArchivePath $archive.FullName
106+
if ($LASTEXITCODE -ne 0) {
107+
Write-Host "##[error]CLI archive verification failed"
108+
exit 1
109+
}
110+
displayName: 🟣Verify CLI archive (win-x64)
111+
condition: succeeded()
112+
env:
113+
ASPIRE_CLI_TELEMETRY_OPTOUT: 'true'
114+
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
115+
95116
# Log MicroBuild environment for debugging
96117
# MicroBuildOutputFolderOverride is set by the MicroBuildSigningPlugin task in eng/common/templates-official/job/onelocbuild.yml
97118
# which is installed via the Arcade SDK's install-microbuild.yml template that runs before our build steps.

eng/pipelines/templates/build_sign_native.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,29 @@ jobs:
140140
env:
141141
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # Needed for the signing task
142142
143+
# Verify the signed CLI archive can execute and create a project.
144+
# Run for RIDs that can fully execute on the build agent:
145+
# macOS (Apple Silicon): osx-arm64 only (osx-x64 via Rosetta can run the CLI
146+
# but aspire-managed template resolution fails)
147+
# Linux (amd64): linux-x64 only (linux-arm64/linux-musl-x64 are cross-compiled)
148+
- ${{ if or(and(eq(parameters.agentOs, 'macos'), eq(targetRid, 'osx-arm64')), and(eq(parameters.agentOs, 'linux'), eq(targetRid, 'linux-x64'))) }}:
149+
- script: |
150+
set -euo pipefail
151+
echo "Finding CLI archive for ${{ targetRid }}..."
152+
ARCHIVE=$(find "$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)" -name "aspire-cli-${{ targetRid }}-*.tar.gz" -type f | head -1)
153+
if [ -z "$ARCHIVE" ]; then
154+
echo "##[error]No CLI archive found for ${{ targetRid }}"
155+
exit 1
156+
fi
157+
echo "Found archive: $ARCHIVE"
158+
chmod +x "$(Build.SourcesDirectory)/eng/scripts/verify-cli-archive.sh"
159+
"$(Build.SourcesDirectory)/eng/scripts/verify-cli-archive.sh" "$ARCHIVE"
160+
displayName: 🟣Verify CLI archive (${{ targetRid }})
161+
condition: succeeded()
162+
env:
163+
ASPIRE_CLI_TELEMETRY_OPTOUT: 'true'
164+
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
165+
143166
- task: 1ES.PublishBuildArtifacts@1
144167
displayName: 🟣Publish Artifacts
145168
condition: always()

0 commit comments

Comments
 (0)