Skip to content

Commit b47effd

Browse files
committed
include latest dxc in windows & linux x64 releases
1 parent 10399ed commit b47effd

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/dotnet.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,59 @@ jobs:
5353
- name: Restore dependencies
5454
run: dotnet restore Volatility/Volatility.csproj
5555

56+
- name: Fetch latest DXC
57+
shell: pwsh
58+
run: |
59+
$ErrorActionPreference = 'Stop'
60+
$rid = '${{ matrix.rid }}'
61+
$toolsDir = Join-Path $PWD 'tools'
62+
$dxcDir = Join-Path $toolsDir 'dxc'
63+
New-Item -ItemType Directory -Force -Path $dxcDir | Out-Null
64+
65+
$headers = @{ 'User-Agent' = 'volatility-ci' }
66+
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/microsoft/DirectXShaderCompiler/releases/latest" -Headers $headers
67+
68+
if ($rid -like 'win-*') {
69+
$asset = $release.assets | Where-Object { $_.name -like 'dxc_*.zip' } | Select-Object -First 1
70+
if (-not $asset) { throw "DXC zip asset not found." }
71+
$zip = Join-Path $env:TEMP $asset.name
72+
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $zip
73+
$extract = Join-Path $env:TEMP "dxc_extract_$rid"
74+
if (Test-Path $extract) { Remove-Item $extract -Recurse -Force }
75+
Expand-Archive -Path $zip -DestinationPath $extract
76+
77+
$arch = $rid -eq 'win-arm64' ? 'arm64' : 'x64'
78+
$src = Join-Path $extract "bin\\$arch"
79+
$dest = Join-Path $dxcDir $rid
80+
if (Test-Path $dest) { Remove-Item $dest -Recurse -Force }
81+
New-Item -ItemType Directory -Force -Path $dest | Out-Null
82+
Copy-Item -Path (Join-Path $src '*') -Destination $dest -Recurse -Force
83+
Copy-Item -Path (Join-Path $extract 'LICENSE-*.txt') -Destination $dxcDir -Force
84+
Copy-Item -Path (Join-Path $extract 'ReleaseNotes.md') -Destination $dxcDir -Force
85+
}
86+
elseif ($rid -eq 'linux-x64') {
87+
$asset = $release.assets | Where-Object { $_.name -like 'linux_dxc_*x86_64*.tar.gz' } | Select-Object -First 1
88+
if (-not $asset) { throw "DXC linux asset not found." }
89+
$tar = Join-Path $env:TEMP $asset.name
90+
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $tar
91+
$extract = Join-Path $env:TEMP "dxc_extract_$rid"
92+
if (Test-Path $extract) { Remove-Item $extract -Recurse -Force }
93+
New-Item -ItemType Directory -Force -Path $extract | Out-Null
94+
tar -xzf $tar -C $extract
95+
96+
$dest = Join-Path $dxcDir $rid
97+
if (Test-Path $dest) { Remove-Item $dest -Recurse -Force }
98+
New-Item -ItemType Directory -Force -Path $dest | Out-Null
99+
Copy-Item -Path (Join-Path $extract 'bin\\dxc') -Destination $dest -Force
100+
Copy-Item -Path (Join-Path $extract 'lib\\libdxcompiler.so') -Destination $dest -Force
101+
Copy-Item -Path (Join-Path $extract 'lib\\libdxil.so') -Destination $dest -Force
102+
Copy-Item -Path (Join-Path $extract 'LICENSE-*.txt') -Destination $dxcDir -Force
103+
Copy-Item -Path (Join-Path $extract 'ReleaseNotes.md') -Destination $dxcDir -Force
104+
}
105+
else {
106+
Write-Host "No official DXC asset for RID $rid; skipping."
107+
}
108+
56109
- name: Publish for ${{ matrix.rid }}
57110
shell: pwsh
58111
run: dotnet publish --configuration Release --runtime ${{ matrix.rid }} --self-contained true -p:ApplicationIcon=volatility_icon.ico --output ${{ matrix.output }} Volatility/Volatility.csproj

0 commit comments

Comments
 (0)