Skip to content

Commit 7f54e89

Browse files
authored
Fix symbols uploading
2 parents 3121587 + 74c6787 commit 7f54e89

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ jobs:
189189
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
190190
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
191191
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
192-
working-directory: ${{ github.workspace }}/openmw-deps/windows
193192
run: .\Store-Symbols.ps1 ${{ github.workspace }}\intermediate
194193

195194
- name: Upload symbols to symbol server
@@ -198,7 +197,7 @@ jobs:
198197
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
199198
AWS_DEFAULT_REGION: eu-west-3
200199
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
201-
working-directory: ${{ github.workspace }}/openmw-deps/windows/SymStore
200+
working-directory: ${{ github.workspace }}/SymStore
202201
run: aws --endpoint-url https://rgw.ctrl-c.liu.se s3 sync --size-only --exclude * --include *.dl_ --include *.pd_ . s3://openmw-sym
203202

204203
push-dynamic:

Store-Symbols.ps1

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
param (
2+
[string] $ArchivePath
3+
)
4+
5+
if (-not (Test-Path symstore-venv))
6+
{
7+
python -m venv symstore-venv
8+
if ($LASTEXITCODE -ne 0) {
9+
Write-Error "Command exited with code $LASTEXITCODE"
10+
}
11+
}
12+
$symstoreVersion = "0.3.4"
13+
if (-not (Test-Path symstore-venv\Scripts\symstore.exe) -or -not ((symstore-venv\Scripts\pip show symstore | Select-String '(?<=Version: ).*').Matches.Value -eq $symstoreVersion))
14+
{
15+
symstore-venv\Scripts\pip install symstore==$symstoreVersion
16+
if ($LASTEXITCODE -ne 0) {
17+
Write-Error "Command exited with code $LASTEXITCODE"
18+
}
19+
}
20+
21+
function ProcessDirectory {
22+
param (
23+
[string] $DirectoryPath
24+
)
25+
26+
$artifacts = Get-ChildItem -Recurse -File $DirectoryPath | Where-Object { $_.Extension -in (".dll", ".exe", ".pdb") } | ForEach-Object { Resolve-Path -Relative $_.FullName }
27+
28+
symstore-venv\Scripts\symstore --compress .\SymStore @artifacts
29+
if ($LASTEXITCODE -ne 0) {
30+
Write-Error "Command exited with code $LASTEXITCODE"
31+
}
32+
}
33+
34+
if (Test-Path $ArchivePath -PathType Leaf)
35+
{
36+
try {
37+
New-Item -ItemType Directory temp-symbols
38+
39+
7z x -r $ArchivePath -otemp-symbols *.dll *.exe *.pdb -y
40+
if ($LASTEXITCODE -ne 0) {
41+
Write-Error "Command exited with code $LASTEXITCODE"
42+
}
43+
44+
ProcessDirectory temp-symbols
45+
}
46+
finally {
47+
Remove-Item -Recurse temp-symbols
48+
}
49+
} elseif (Test-Path $ArchivePath -PathType Container) {
50+
ProcessDirectory $ArchivePath
51+
} else {
52+
Write-Error "$ArchivePath does not exist."
53+
}

0 commit comments

Comments
 (0)