Skip to content

Commit 6518c68

Browse files
committed
Use org action forks
1 parent f28c692 commit 6518c68

1 file changed

Lines changed: 15 additions & 128 deletions

File tree

.github/workflows/build-nabla.yml

Lines changed: 15 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -569,53 +569,13 @@ jobs:
569569
$imageBadge | Set-Content -Path "$imagePath/image-badge.json" -Encoding utf8
570570
571571
- name: Deploy Badges
572-
shell: pwsh
573-
env:
574-
PUSH_TOKEN: ${{ github.token }}
575-
run: |
576-
$publishDir = (Resolve-Path ".badge-public").Path
577-
$workDir = Join-Path $env:RUNNER_TEMP "badges-publish"
578-
$repoUrl = "https://x-access-token:$env:[email protected]/${{ github.repository }}.git"
579-
580-
if (Test-Path $workDir) {
581-
Remove-Item -Recurse -Force $workDir
582-
}
583-
584-
& git clone --depth 1 --branch badges $repoUrl $workDir
585-
$cloneSucceeded = $LASTEXITCODE -eq 0
586-
587-
if (-not $cloneSucceeded) {
588-
if (Test-Path $workDir) {
589-
Remove-Item -Recurse -Force $workDir
590-
}
591-
New-Item -ItemType Directory -Force -Path $workDir | Out-Null
592-
Push-Location $workDir
593-
git init
594-
git remote add origin $repoUrl
595-
git checkout --orphan badges
596-
Pop-Location
597-
}
598-
599-
& robocopy $publishDir $workDir /E /NFL /NDL /NJH /NJS /NP
600-
if ($LASTEXITCODE -ge 8) {
601-
throw "robocopy failed with exit code $LASTEXITCODE"
602-
}
603-
604-
Push-Location $workDir
605-
git config user.name "github-actions[bot]"
606-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
607-
608-
$status = git status --porcelain
609-
if (-not $status) {
610-
Write-Host "No badge changes to publish."
611-
Pop-Location
612-
exit 0
613-
}
614-
615-
git add .
616-
git commit -m "[CI] badges update"
617-
git push origin HEAD:badges
618-
Pop-Location
572+
uses: Devsh-Graphics-Programming/[email protected]
573+
with:
574+
github_token: ${{ secrets.GITHUB_TOKEN }}
575+
publish_branch: badges
576+
publish_dir: .badge-public
577+
keep_files: true
578+
commit_message: "[CI] badges update"
619579

620580
deploy-production:
621581
name: Deploy Godbolt production image
@@ -670,87 +630,14 @@ jobs:
670630
sparse-checkout: |
671631
smoke
672632
673-
- name: Install Vulkan SDK
674-
shell: pwsh
675-
run: |
676-
$sdkVersion = (Invoke-WebRequest 'https://vulkan.lunarg.com/sdk/latest/windows.txt' -UseBasicParsing).Content.Trim()
677-
if ([string]::IsNullOrWhiteSpace($sdkVersion)) {
678-
throw "Failed to resolve the latest Vulkan SDK version."
679-
}
680-
681-
$installer = Join-Path $env:RUNNER_TEMP 'vulkan_sdk.exe'
682-
Invoke-WebRequest -Uri 'https://sdk.lunarg.com/sdk/download/latest/windows/vulkan_sdk.exe?Human=true' -OutFile $installer
683-
684-
$shaInfo = Invoke-RestMethod -Uri 'https://sdk.lunarg.com/sdk/sha/latest/windows/vulkan_sdk.exe.json'
685-
if ([string]::IsNullOrWhiteSpace($shaInfo.sha)) {
686-
throw "Failed to resolve the expected Vulkan SDK installer SHA256."
687-
}
688-
689-
$actualSha = (Get-FileHash -LiteralPath $installer -Algorithm SHA256).Hash.ToLowerInvariant()
690-
$expectedSha = $shaInfo.sha.ToLowerInvariant()
691-
if ($actualSha -ne $expectedSha) {
692-
throw "Vulkan SDK installer SHA256 mismatch."
693-
}
694-
695-
$sdkRoot = Join-Path 'C:\VulkanSDK' $sdkVersion
696-
Start-Process -FilePath $installer -ArgumentList @(
697-
'--root', $sdkRoot,
698-
'--accept-licenses',
699-
'--default-answer',
700-
'--confirm-command', 'install'
701-
) -Verb RunAs -Wait
702-
703-
$vulkanInfo = Get-ChildItem -Path $sdkRoot -Recurse -Filter 'vulkaninfoSDK.exe' -File | Select-Object -First 1
704-
if (-not $vulkanInfo) {
705-
throw "Failed to locate vulkaninfoSDK.exe after installing the Vulkan SDK."
706-
}
707-
708-
$sdkBin = Split-Path -Parent $vulkanInfo.FullName
709-
"VULKAN_VERSION=$sdkVersion" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
710-
"VULKAN_SDK=$sdkRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
711-
$sdkBin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
712-
713-
- name: Install Lavapipe
714-
shell: pwsh
715-
env:
716-
GITHUB_TOKEN: ${{ github.token }}
717-
run: |
718-
$headers = @{
719-
Authorization = "Bearer $env:GITHUB_TOKEN"
720-
'User-Agent' = 'Nabla-CI'
721-
'X-GitHub-Api-Version' = '2022-11-28'
722-
}
723-
724-
$release = Invoke-RestMethod -Uri 'https://api.github.com/repos/jakoch/rasterizers/releases/latest' -Headers $headers
725-
$asset = $release.assets | Where-Object { $_.name -like 'lavapipe-win64-*.zip' } | Select-Object -First 1
726-
if (-not $asset) {
727-
throw "Failed to resolve the latest Lavapipe asset."
728-
}
729-
730-
$archive = Join-Path $env:RUNNER_TEMP $asset.name
731-
$extractRoot = 'C:\lavapipe'
732-
if (Test-Path $extractRoot) {
733-
Remove-Item -Recurse -Force $extractRoot
734-
}
735-
736-
Invoke-WebRequest -Uri $asset.browser_download_url -Headers $headers -OutFile $archive
737-
Expand-Archive -Path $archive -DestinationPath $extractRoot -Force
738-
739-
$lavapipeDll = Get-ChildItem -Path $extractRoot -Recurse -Filter 'vulkan_lvp.dll' -File | Select-Object -First 1
740-
if (-not $lavapipeDll) {
741-
throw "Failed to locate vulkan_lvp.dll after extracting Lavapipe."
742-
}
743-
744-
$lavapipeRoot = Split-Path -Parent (Split-Path -Parent $lavapipeDll.FullName)
745-
$icdPath = Join-Path $lavapipeRoot 'share\vulkan\icd.d\lvp_icd.x86_64.json'
746-
if (-not (Test-Path $icdPath)) {
747-
throw "Failed to locate the Lavapipe ICD manifest."
748-
}
749-
750-
"LAVAPIPE_ROOT=$lavapipeRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
751-
752-
- name: Add lavapipe driver
753-
run: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\Drivers" /v "$env:LAVAPIPE_ROOT\share\vulkan\icd.d\lvp_icd.x86_64.json" /t REG_DWORD /d 0 /f
633+
- name: Download VulkanSDK
634+
uses: Devsh-Graphics-Programming/[email protected]
635+
with:
636+
install_runtime: true
637+
cache: true
638+
stripdown: true
639+
install_lavapipe: true
640+
github_token: ${{ github.token }}
754641

755642
- name: Download Nabla install artifact
756643
uses: actions/download-artifact@v8

0 commit comments

Comments
 (0)