Skip to content

Commit 7571ee8

Browse files
committed
update github action workflow
1 parent dbb7d86 commit 7571ee8

File tree

5 files changed

+292
-112
lines changed

5 files changed

+292
-112
lines changed

.github/actions/init-build/action.yml

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
name: Initialize Building Environment
2-
description: Initialize Building Environment
3-
inputs:
4-
os:
5-
description: OS
6-
required: true
1+
name: Initialize building environment
2+
description: Initialize building environment
73

84
runs:
95
using: "composite"
106
steps:
117
- name: Setup devcmd
12-
if: inputs.os == 'windows-latest'
8+
if: runner.os == 'Windows'
139
uses: ilammy/msvc-dev-cmd@v1
1410

1511
- name: Install build tools (Windows)
16-
if: inputs.os == 'windows-latest'
12+
if: runner.os == 'Windows'
1713
shell: pwsh
1814
run: |
1915
if ((Get-Command "ninja.exe" -ErrorAction SilentlyContinue) -eq $null)
@@ -27,7 +23,7 @@ runs:
2723
Write-Output QT_ARCH=win64_msvc2019_64 >> $env:GITHUB_ENV
2824
2925
- name: Install build tools (Ubuntu)
30-
if: inputs.os == 'ubuntu-latest'
26+
if: runner.os == 'Linux'
3127
shell: pwsh
3228
run: |
3329
sudo apt update
@@ -41,7 +37,7 @@ runs:
4137
Write-Output QT_ARCH=gcc_64 >> $env:GITHUB_ENV
4238
4339
- name: Install build tools (macOS)
44-
if: inputs.os == 'macos-13'
40+
if: runner.os == 'macOS'
4541
shell: pwsh
4642
env:
4743
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
@@ -57,14 +53,15 @@ runs:
5753
uses: jurplel/install-qt-action@v3
5854
with:
5955
version: '5.15.2'
60-
archives: ${{ inputs.os == 'ubuntu-latest' && 'icu qtbase' || 'qtbase' }} qtsvg qtdeclarative qtremoteobjects qttools
56+
archives: ${{ runner.os == 'Linux' && 'icu qtbase' || 'qtbase' }} qtsvg qtdeclarative qtremoteobjects qttools
6157
cache: true
6258

6359
- name: Prepare vcpkg
6460
shell: pwsh
6561
run: |
6662
Write-Output VCPKG_REPO_REF=$((Get-Content scripts/vcpkg-manifest/vcpkg.json | ConvertFrom-Json).'builtin-baseline') >> $env:GITHUB_ENV
6763
Write-Output VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}/vcpkg_archives >> $env:GITHUB_ENV
64+
Write-Output "VCPKG_BUILDTREES=$(Resolve-Path .)/vcpkg/buildtrees" >> $env:GITHUB_ENV
6865
Write-Output VCPKG_CACHE_HASH=${{ hashFiles('scripts/vcpkg-manifest/vcpkg.json', 'scripts/vcpkg/**') }} >> $env:GITHUB_ENV
6966
7067
- name: Restore vcpkg binary cache from cache
@@ -76,19 +73,31 @@ runs:
7673
restore-keys: |
7774
${{ runner.os }}-vcpkg-${{ env.VCPKG_REPO_REF }}-
7875
76+
- name: Restore vcpkg buildtrees from cache
77+
id: cache_vcpkg_buildtrees
78+
if: runner.os == 'macOS'
79+
uses: actions/cache/restore@v4
80+
with:
81+
path: ${{ env.VCPKG_BUILDTREES }}
82+
key: ${{ runner.os }}-vcpkg-buildtrees-${{ env.VCPKG_REPO_REF }}-${{ env.VCPKG_CACHE_HASH }}
83+
restore-keys: |
84+
${{ runner.os }}-vcpkg-buildtrees-${{ env.VCPKG_REPO_REF }}-
85+
7986
- name: Install vcpkg dependencies
8087
shell: pwsh
8188
run: |
8289
if (!(Test-Path $env:VCPKG_DEFAULT_BINARY_CACHE)) {
83-
mkdir $env:VCPKG_DEFAULT_BINARY_CACHE
90+
New-Item $env:VCPKG_DEFAULT_BINARY_CACHE -ItemType directory
8491
}
8592
git clone https://github.com/microsoft/vcpkg.git
86-
cd vcpkg
87-
${{ inputs.os == 'windows-latest' && './bootstrap-vcpkg.bat' || 'sh ./bootstrap-vcpkg.sh' }}
93+
Set-Location vcpkg
94+
${{ runner.os == 'Windows' && './bootstrap-vcpkg.bat' || 'sh ./bootstrap-vcpkg.sh' }}
8895
git checkout $env:VCPKG_REPO_REF
96+
8997
$env:QT_DIR="$env:Qt5_DIR/lib/cmake/Qt5"
9098
$env:Qt5_DIR=$env:QT_DIR
91-
$env:VCPKG_KEEP_ENV_VARS="QT_DIR;Qt5_DIR"
99+
$env:VCPKG_CMAKE_RELEASE_BUILD_TYPE="RelWithDebInfo"
100+
$env:VCPKG_KEEP_ENV_VARS="QT_DIR;Qt5_DIR;VCPKG_CMAKE_RELEASE_BUILD_TYPE"
92101
./vcpkg install `
93102
--x-manifest-root=${{ github.workspace }}/scripts/vcpkg-manifest `
94103
--x-install-root=./installed `
@@ -101,15 +110,22 @@ runs:
101110
--x-install-root=./bridge_installed `
102111
--triplet=${{ env.VCPKG_TRIPLET_STATIC }}
103112
104-
- name: Save vcpkg to cache
113+
- name: Save vcpkg binary cache to cache
105114
if: steps.cache_vcpkg.outputs.cache-hit != 'true'
106115
uses: actions/cache/save@v4
107116
with:
108117
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
109118
key: ${{ runner.os }}-vcpkg-${{ env.VCPKG_REPO_REF }}-${{ env.VCPKG_CACHE_HASH }}
110119

120+
- name: Save vcpkg buildtrees to cache
121+
if: runner.os == 'macOS' && steps.cache_vcpkg_buildtrees.outputs.cache_hit != 'true'
122+
uses: actions/cache/save@v4
123+
with:
124+
path: ${{ env.VCPKG_BUILDTREES }}
125+
key: ${{ runner.os }}-vcpkg-buildtrees-${{ env.VCPKG_REPO_REF }}-${{ env.VCPKG_CACHE_HASH }}
126+
111127
- name: Get ASIO SDK
112-
if: inputs.os == 'windows-latest'
128+
if: runner.os == 'Windows'
113129
shell: pwsh
114130
run: |
115131
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/CrSjimo/diffscope-ci-tools-mirror/refs/heads/main/asiosdk_2.3.3_2019-06-14.zip" -OutFile $env:RUNNER_TEMP/asiosdk.zip
@@ -122,14 +138,14 @@ runs:
122138
Write-Output VCPKG_ROOT_DIR=$(Resolve-Path -Path ./vcpkg) >> $env:GITHUB_ENV
123139
124140
- name: Set ASIO SDK directory variable (Windows)
125-
if: inputs.os == 'windows-latest'
141+
if: runner.os == 'Windows'
126142
shell: pwsh
127143
run: |
128-
mv asiosdk ..
144+
Move-Item asiosdk ..
129145
Write-Output ASIOSDK_DIR=$(Resolve-Path -Path ../asiosdk) >> $env:GITHUB_ENV
130146
131147
- name: Set ASIO SDK directory variable (Non-Windows)
132-
if: inputs.os != 'windows-latest'
148+
if: runner.os != 'Windows'
133149
shell: pwsh
134150
run: |
135151
Write-Output ASIOSDK_DIR= >> $env:GITHUB_ENV

.github/actions/pack/action.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Pack
2+
description: Create package for release
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Create installer (Windows)
8+
if: runner.os == 'Windows'
9+
shell: pwsh
10+
run: |
11+
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/jrsoftware/issrc/f59a90485af28067626e60ef7e42336e00ae7472/Files/Languages/Unofficial/ChineseSimplified.isl' -OutFile ChineseSimplified.isl
12+
Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/jrsoftware/issrc/e5e138e67bacd650650eac489fa861274a4b81ce/Files/Languages/Unofficial/ChineseTraditional.isl' -OutFile ChineseTraditional.isl
13+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/CrSjimo/diffscope-ci-tools-mirror/refs/heads/main/gpl-3.0.rtf" -OutFile gpl-3.0.rtf
14+
15+
$content = Get-Content build/CMakeCache.txt
16+
$variableValues = @{}
17+
foreach ($line in $content) {
18+
$pattern = "^\s*(.*):(.*)=(.*)$"
19+
if ($line -Match $pattern) {
20+
$key = $matches[1].Trim()
21+
$value = $matches[3].Trim()
22+
$variableValues[$key] = $value
23+
}
24+
}
25+
26+
$env:SETUP_APP_NAME = $variableValues.CMAKE_PROJECT_NAME
27+
$env:SETUP_APP_VERSION = $variableValues.CMAKE_PROJECT_VERSION
28+
$env:SETUP_APP_INSTALLED_DIR = $env:DIFFSCOPE_INSTALLED_DIR
29+
$env:SETUP_APP_BRIDGE_ARTEFACTS_DIR = $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR
30+
$env:SETUP_MESSAGE_FILES_DIR = Resolve-Path .
31+
$env:SETUP_OUTPUT_DIR = Resolve-Path .
32+
$env:SETUP_OUTPUT_FILE_BASE = $env:BINARY_NAME
33+
$env:GPL3_LICENSE_PATH = Resolve-Path -Path gpl-3.0.rtf
34+
35+
ISCC.exe scripts/setup/windows/setup.iss
36+
Write-Output PACKAGE_PATH=$(Resolve-Path -Path "$env:BINARY_NAME.exe") >> $env:GITHUB_ENV
37+
38+
- name: Create DMG bundle (macOS)
39+
if: runner.os == 'macOS'
40+
shell: pwsh
41+
run: |
42+
Set-Location scripts/setup/macos
43+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/CrSjimo/diffscope-ci-tools-mirror/refs/heads/main/Packages.dmg" -OutFile Packages.dmg
44+
New-Item Packages -ItemType directory
45+
hdiutil attach -mountpoint Packages Packages.dmg
46+
sudo installer -pkg 'Packages/Install Packages.pkg' -target /
47+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/CrSjimo/diffscope-ci-tools-mirror/refs/heads/main/gpl-3.0.rtf" -OutFile gpl-3.0.rtf
48+
ln -s $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR diffscope-bridge-artefacts
49+
packagesbuild diffscope-bridge-dist.pkgproj
50+
npm install
51+
node create-dmg.js $env:DIFFSCOPE_INSTALLED_DIR/DiffScope.app 'DiffScope Bridge.pkg' "$env:BINARY_NAME.dmg"
52+
Write-Output PACKAGE_PATH=$(Resolve-Path -Path "$env:BINARY_NAME.dmg") >> $env:GITHUB_ENV
53+
54+
- name: Create Binary Archive (Ubuntu)
55+
if: runner.os == 'Linux'
56+
shell: pwsh
57+
run: |
58+
Set-Location scripts/setup/linux
59+
Move-Item $env:DIFFSCOPE_INSTALLED_DIR DiffScope
60+
61+
Push-Location DiffScope/lib
62+
# Just steal the exclude list of dynamic libraries from AppImage
63+
$excludeListUrl = "https://raw.githubusercontent.com/AppImageCommunity/pkg2appimage/04af461f471a2bf49671057408e0313f1f731d4b/excludelist"
64+
$excludeList = (Invoke-WebRequest $excludeListUrl).Content.split("`n")
65+
if ($excludeList.Count -eq 0) {
66+
exit 1
67+
}
68+
foreach ($file in ($excludeList | ForEach-Object { ($_ -replace '\s*#.*$', '').Trim() } | Where-Object { $_ -ne "" })) {
69+
if (Test-Path $file) {
70+
Remove-Item $file
71+
}
72+
}
73+
Pop-Location
74+
75+
New-Item "DiffScope Bridge" -ItemType directory
76+
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/CrSjimo/diffscope-ci-tools-mirror/refs/heads/main/gpl-3.0.rtf" -OutFile "DiffScope Bridge/gpl-3.0.rtf"
77+
Move-Item $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/VST3/*.vst3 "DiffScope Bridge"
78+
Move-Item $env:DIFFSCOPE_BRIDGE_ARTEFACTS_DIR/LV2/*.lv2 "DiffScope Bridge"
79+
Move-Item create-desktop-entry.sh DiffScope
80+
Move-Item remove-desktop-entry.sh DiffScope
81+
tar --bzip2 -cf "$env:BINARY_NAME.tar.bz2" DiffScope "DiffScope Bridge" "Installation Guide.txt"
82+
Write-Output PACKAGE_PATH=$(Resolve-Path -Path "$env:BINARY_NAME.tar.bz2") >> $env:GITHUB_ENV
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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

Comments
 (0)