Skip to content

Commit b3ad525

Browse files
committed
ci: use tagged efW releases
Use tagged releases in addition to main. This requires renaming the folder from the downloaded artifact since it contains spaces. install_ebpf.psm1 currently doesn't handle spaces in paths to the MSI. Signed-off-by: Lorenz Bauer <[email protected]>
1 parent 2d2a351 commit b3ad525

File tree

1 file changed

+52
-9
lines changed

1 file changed

+52
-9
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ jobs:
258258
matrix:
259259
version:
260260
- "main"
261+
- "1.0.0-rc1"
261262
env:
262263
# Fix slow Go compile and cache restore
263264
# See https://github.com/actions/setup-go/pull/515
@@ -277,12 +278,43 @@ jobs:
277278
with:
278279
script: |
279280
if ("${{ matrix.version }}" != "main") {
280-
// TODO: Workflow artifact and release artifact don't have the
281-
// same folder structure.
282-
core.setFailed('Installing tagged versions is not supported');
283-
return;
284-
}
281+
// Use version from matrix to fetch from release
282+
const version = "${{ matrix.version }}";
283+
const releaseTag = `Release-v${version}`;
284+
285+
console.log(`Fetching release: ${releaseTag}`);
286+
287+
// Get the release by tag
288+
const release = await github.rest.repos.getReleaseByTag({
289+
owner: 'microsoft',
290+
repo: 'ebpf-for-windows',
291+
tag: releaseTag
292+
});
293+
294+
if (!release.data) {
295+
core.setFailed(`Release ${releaseTag} not found`);
296+
return;
297+
}
298+
299+
console.log(`Found release: ${release.data.name}`);
300+
301+
// Find the Build.Debug.x64.zip asset
302+
const assetName = 'Build.Debug.x64.zip';
303+
const asset = release.data.assets.find(a => a.name === assetName);
304+
305+
if (!asset) {
306+
console.log('Available assets:', release.data.assets.map(a => a.name));
307+
core.setFailed(`${assetName} asset not found in release ${releaseTag}`);
308+
return;
309+
}
285310
311+
const download_url = asset.browser_download_url;
312+
console.log(`Download URL: ${download_url}`);
313+
314+
core.setOutput('download_url', download_url);
315+
return
316+
}
317+
286318
// Get the latest successful merge_group run
287319
const workflow_runs = await github.rest.actions.listWorkflowRuns({
288320
owner: 'microsoft',
@@ -344,12 +376,23 @@ jobs:
344376
shell: pwsh
345377
run: |
346378
Invoke-WebRequest -Uri "${{ steps.determine-url.outputs.download_url }}" -OutFile "$env:TEMP\efw.zip"
347-
Expand-Archive -Path "$env:TEMP\efw.zip" -DestinationPath "$env:TEMP"
348-
Expand-Archive -Path "$env:TEMP\build-Debug.zip" -DestinationPath "$env:TEMP\ebpf"
379+
380+
if ("${{ matrix.version }}" -eq "main") {
381+
# Workflow artifact has nested structure: outer zip contains build-Debug.zip
382+
Expand-Archive -Path "$env:TEMP\efw.zip" -DestinationPath "$env:TEMP"
383+
Expand-Archive -Path "$env:TEMP\build-Debug.zip" -DestinationPath "$env:TEMP\ebpf"
384+
} else {
385+
# Release asset is the final zip, extract directly
386+
Expand-Archive -Path "$env:TEMP\efw.zip" -DestinationPath "$env:TEMP\ebpf"
387+
}
388+
349389
$setupScript = Get-ChildItem -Path "$env:TEMP\ebpf" -Filter "install_ebpf.psm1" -Recurse | Select-Object -First 1
350390
if ($setupScript) {
351391
Write-Host "Found setup script: $($setupScript.FullName)"
352-
Set-Location -Path $setupScript.DirectoryName
392+
$releasePath = "$env:TEMP\ebpf\release"
393+
Rename-Item -Path $setupScript.DirectoryName -NewName $releasePath
394+
Write-Host "Renamed directory to: $releasePath"
395+
Set-Location -Path $releasePath
353396
Write-Host "Changed directory to: $(Get-Location)"
354397
Import-Module .\\install_ebpf.psm1 -ArgumentList ($pwd, "install.log") -Force
355398
Get-PSExec
@@ -381,7 +424,7 @@ jobs:
381424
if: always()
382425
uses: actions/upload-artifact@v5
383426
with:
384-
name: Test Results (windows ${{ matrix.tag }})
427+
name: Test Results (windows ${{ matrix.version }})
385428
path: junit.xml
386429

387430
results:

0 commit comments

Comments
 (0)