Skip to content

Commit

Permalink
Fix symbols uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
jvoisin authored Sep 18, 2024
2 parents 3121587 + 74c6787 commit 7f54e89
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ jobs:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: ${{ env.AWS_ACCESS_KEY_ID != '' && env.AWS_SECRET_ACCESS_KEY != '' }}
working-directory: ${{ github.workspace }}/openmw-deps/windows
run: .\Store-Symbols.ps1 ${{ github.workspace }}\intermediate

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

push-dynamic:
Expand Down
53 changes: 53 additions & 0 deletions Store-Symbols.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
param (
[string] $ArchivePath
)

if (-not (Test-Path symstore-venv))
{
python -m venv symstore-venv
if ($LASTEXITCODE -ne 0) {
Write-Error "Command exited with code $LASTEXITCODE"
}
}
$symstoreVersion = "0.3.4"
if (-not (Test-Path symstore-venv\Scripts\symstore.exe) -or -not ((symstore-venv\Scripts\pip show symstore | Select-String '(?<=Version: ).*').Matches.Value -eq $symstoreVersion))
{
symstore-venv\Scripts\pip install symstore==$symstoreVersion
if ($LASTEXITCODE -ne 0) {
Write-Error "Command exited with code $LASTEXITCODE"
}
}

function ProcessDirectory {
param (
[string] $DirectoryPath
)

$artifacts = Get-ChildItem -Recurse -File $DirectoryPath | Where-Object { $_.Extension -in (".dll", ".exe", ".pdb") } | ForEach-Object { Resolve-Path -Relative $_.FullName }

symstore-venv\Scripts\symstore --compress .\SymStore @artifacts
if ($LASTEXITCODE -ne 0) {
Write-Error "Command exited with code $LASTEXITCODE"
}
}

if (Test-Path $ArchivePath -PathType Leaf)
{
try {
New-Item -ItemType Directory temp-symbols

7z x -r $ArchivePath -otemp-symbols *.dll *.exe *.pdb -y
if ($LASTEXITCODE -ne 0) {
Write-Error "Command exited with code $LASTEXITCODE"
}

ProcessDirectory temp-symbols
}
finally {
Remove-Item -Recurse temp-symbols
}
} elseif (Test-Path $ArchivePath -PathType Container) {
ProcessDirectory $ArchivePath
} else {
Write-Error "$ArchivePath does not exist."
}

0 comments on commit 7f54e89

Please sign in to comment.