1
+ name : Symbol file
2
+ description : Collect symbol files
3
+
4
+ runs :
5
+ using : " composite"
6
+ steps :
7
+ - name : Collect symbol files (Windows)
8
+ if : runner.os == 'Windows'
9
+ shell : pwsh
10
+ run : |
11
+ $PATTERN = "PDB file found at.*'(.*)'"
12
+ $env:_NT_ALT_SYMBOL_PATH = "${{ env.VCPKG_ROOT_DIR }}/installed/${{ env.VCPKG_TRIPLET }}/bin"
13
+
14
+ #Step 1: Collect DiffScope's pdb files
15
+ New-Item symbol_files/DiffScope -ItemType directory
16
+ $symbolFilesDirectory = Resolve-Path symbol_files
17
+ Push-Location $env:DIFFSCOPE_INSTALLED_DIR
18
+ $dllFiles = Get-ChildItem -Path . -Recurse | Where-Object { $_.Extension -eq '.exe' -or $_.Extension -eq '.dll' }
19
+ foreach ($dllFile in $dllFiles) {
20
+ dumpbin /PDBPATH:VERBOSE $dllFile.FullName
21
+ $dumpbinOutput = dumpbin /PDBPATH $dllFile.FullName
22
+ $matches = [regex]::Matches($dumpbinOutput, $PATTERN)
23
+ if ($matches.Count -gt 0) {
24
+ $pdbPath = $matches.Groups[1].Value
25
+ Write-Output "$dllFile -> $pdbPath"
26
+ $pdbTargetDirectory = "$symbolFilesDirectory/DiffScope/$(Split-Path $(Resolve-Path $dllFile.FullName -Relative))"
27
+ if (!(Test-Path $pdbTargetDirectory)) {
28
+ New-Item $pdbTargetDirectory -ItemType directory
29
+ }
30
+ Copy-Item $pdbPath $pdbTargetDirectory
31
+ } else {
32
+ Write-Output "No PDB file: $dllFile"
33
+ }
34
+ }
35
+ Pop-Location
36
+
37
+ #Step 2: Collect pdb files of DiffScope Bridge VST3
38
+ New-Item "symbol_files/DiffScope Bridge/VST3" -ItemType directory
39
+ Push-Location $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/VST3
40
+ Move-Item -Path (Get-ChildItem -Path . -Recurse -Filter *.pdb).FullName -Destination "$symbolFilesDirectory/DiffScope Bridge/VST3"
41
+ Remove-Item -Path (Get-ChildItem -Path . -Recurse -Filter *.ilk).FullName
42
+ Pop-Location
43
+
44
+ #Step 3: Collect pdb files of DiffScope Bridge LV2
45
+ New-Item "symbol_files/DiffScope Bridge/LV2" -ItemType directory
46
+ Push-Location $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/LV2
47
+ Move-Item -Path (Get-ChildItem -Path . -Recurse -Filter *.pdb).FullName -Destination "$symbolFilesDirectory/DiffScope Bridge/LV2"
48
+ Remove-Item -Path (Get-ChildItem -Path . -Recurse -Filter *.ilk).FullName
49
+ Pop-Location
50
+
51
+ Compress-Archive -Path "symbol_files/DiffScope", "symbol_files/DiffScope Bridge" -DestinationPath symbol_files.zip
52
+ Write-Output SYMBOL_FILES_PATH=$(Resolve-Path symbol_files.zip) >> $env:GITHUB_ENV
53
+
54
+ - name : Collect symbol files (Linux)
55
+ if : runner.os == 'Linux'
56
+ shell : pwsh
57
+ run : |
58
+ #Step 1: Collect DiffScope's debug info files
59
+ New-Item symbol_files/DiffScope -ItemType directory
60
+ $symbolFilesDirectory = Resolve-Path symbol_files
61
+ Push-Location $env:DIFFSCOPE_INSTALLED_DIR
62
+ $dllFiles = Get-ChildItem -Path . -Recurse | Where-Object { (file $_) -match "ELF 64-bit" }
63
+ foreach ($dllFile in $dllFiles) {
64
+ file $dllFile.FullName
65
+ $fileOutput = file $dllFile.FullName
66
+ if ($fileOutput -match "with debug_info") {
67
+ Write-Output "Copy and strip debug_info: $dllFile"
68
+ $pdbTargetDirectory = "$symbolFilesDirectory/DiffScope/$(Split-Path $(Resolve-Path $dllFile.FullName -Relative))"
69
+ if (!(Test-Path $pdbTargetDirectory)) {
70
+ New-Item $pdbTargetDirectory -ItemType directory
71
+ }
72
+ objcopy --only-keep-debug $dllFile.FullName "$pdbTargetDirectory/$($dllFile.Name).debug"
73
+ strip --strip-debug $dllFile.FullName
74
+ } else {
75
+ Write-Output "Skip: $dllFile"
76
+ }
77
+ }
78
+ Pop-Location
79
+
80
+ #Step 2: Collect debug info files of DiffScope Bridge VST3
81
+ New-Item "symbol_files/DiffScope Bridge/VST3" -ItemType directory
82
+ Push-Location $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/VST3
83
+ $vst3File = (Get-ChildItem -Path . -Recurse -Filter *.so)[0]
84
+ objcopy --only-keep-debug $vst3File.FullName "$symbolFilesDirectory/DiffScope Bridge/VST3/$($vst3File.Name).debug"
85
+ strip --strip-debug $vst3File.FullName
86
+ Pop-Location
87
+
88
+ #Step 3: Collect debug info files of DiffScope Bridge LV2
89
+ New-Item "symbol_files/DiffScope Bridge/LV2" -ItemType directory
90
+ Push-Location $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/LV2
91
+ $lv2File = (Get-ChildItem -Path . -Recurse -Filter *.so)[0]
92
+ objcopy --only-keep-debug $lv2File.FullName "$symbolFilesDirectory/DiffScope Bridge/VST3/$($lv2File.Name).debug"
93
+ strip --strip-debug $lv2File.FullName
94
+ Pop-Location
95
+
96
+ Compress-Archive -Path "symbol_files/DiffScope", "symbol_files/DiffScope Bridge" -DestinationPath symbol_files.zip
97
+ Write-Output SYMBOL_FILES_PATH=$(Resolve-Path symbol_files.zip) >> $env:GITHUB_ENV
98
+
99
+ - name : Collect symbol files (macOS)
100
+ if : runner.os == 'macOS'
101
+ shell : pwsh
102
+ run : |
103
+ #Step 1: Collect DiffScope's debug info files
104
+ New-Item symbol_files/DiffScope -ItemType directory
105
+ $symbolFilesDirectory = Resolve-Path symbol_files
106
+ Push-Location $env:DIFFSCOPE_INSTALLED_DIR
107
+ $dllFiles = Get-ChildItem -Path . -Recurse | Where-Object { (file $_) -match "Mach-O 64-bit" }
108
+ foreach ($dllFile in $dllFiles) {
109
+ $dsymutilOutput = dsymutil -s $dllFile.FullName
110
+ if ($dsymutilOutput -match "N_OSO") {
111
+ Write-Output "Copy and strip debug_info: $dllFile"
112
+ $pdbTargetDirectory = "$symbolFilesDirectory/DiffScope/$(Split-Path $(Resolve-Path $dllFile.FullName -Relative))"
113
+ if (!(Test-Path $pdbTargetDirectory)) {
114
+ New-Item $pdbTargetDirectory -ItemType directory
115
+ }
116
+ dsymutil $dllFile.FullName -o "$pdbTargetDirectory/$($dllFile.Name).dSYM"
117
+ strip -S $dllFile.FullName
118
+ } else {
119
+ Write-Output "Skip: $dllFile"
120
+ }
121
+ }
122
+ Pop-Location
123
+
124
+ #Step 2: Collect debug info files of DiffScope Bridge VST3
125
+ New-Item "symbol_files/DiffScope Bridge/VST3" -ItemType directory
126
+ Push-Location $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/VST3
127
+ $vst3File = (Get-ChildItem -Path . -Recurse -Filter "DiffScope Bridge")[0]
128
+ dsymutil $vst3File.FullName -o "$symbolFilesDirectory/DiffScope Bridge/VST3/$($vst3File.Name).dSYM"
129
+ strip -S $vst3File.FullName
130
+ Pop-Location
131
+
132
+ #Step 3: Collect debug info files of DiffScope Bridge LV2
133
+ New-Item "symbol_files/DiffScope Bridge/LV2" -ItemType directory
134
+ Push-Location $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/LV2
135
+ $lv2File = (Get-ChildItem -Path . -Recurse -Filter *.so)[0]
136
+ dsymutil $lv2File.FullName "$symbolFilesDirectory/DiffScope Bridge/LV2/$($lv2File.Name).dSYM"
137
+ strip -S $lv2File.FullName
138
+ Pop-Location
139
+
140
+ #Step 4: Collect debug info files of DiffScope Bridge AU
141
+ New-Item "symbol_files/DiffScope Bridge/AU" -ItemType directory
142
+ Push-Location $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/AU
143
+ $auFile = (Get-ChildItem -Path . -Recurse -Filter "DiffScope Bridge")[0]
144
+ dsymutil $auFile.FullName "$symbolFilesDirectory/DiffScope Bridge/AU/$($auFile.Name).dSYM"
145
+ strip -S $auFile.FullName
146
+ Pop-Location
147
+
148
+ Compress-Archive -Path "symbol_files/DiffScope", "symbol_files/DiffScope Bridge" -DestinationPath symbol_files.zip
149
+ Write-Output SYMBOL_FILES_PATH=$(Resolve-Path symbol_files.zip) >> $env:GITHUB_ENV
0 commit comments