Skip to content

Commit db9743e

Browse files
committed
Merge branch 'pack-arm' into develop
2 parents be2d1a7 + ec02f2b commit db9743e

33 files changed

+369
-844
lines changed

.github/actions/copy-native-libraries/action.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,14 @@ runs:
2424
- name: Copy native libraries near csproj
2525
shell: pwsh
2626
run: |
27-
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_Win_${{ inputs.win-arch }}/*.dll" -Destination "DryWetMidi" -Verbose
28-
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_macOS_${{ inputs.macos-arch }}/*.dylib" -Destination "DryWetMidi" -Verbose
27+
$winX64Destination = "Native\win_x64"
28+
New-Item -ItemType Directory -Force -Path $winX64Destination
29+
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_Win_x64/Melanchall_DryWetMidi_Native.dll" -Destination "$winX64Destination" -Force -Verbose
30+
31+
$winArm64Destination = "Native\win_arm64"
32+
New-Item -ItemType Directory -Force -Path $winArm64Destination
33+
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_Win_arm64/Melanchall_DryWetMidi_Native.dll" -Destination "$winArm64Destination" -Force -Verbose
34+
35+
$macosX64Arm64Destination = "Native\macos_x64_arm64"
36+
New-Item -ItemType Directory -Force -Path $macosX64Arm64Destination
37+
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_macOS_x64_arm64/Melanchall_DryWetMidi_Native.dylib" -Destination "$macosX64Arm64Destination" -Force -Verbose

.github/workflows/build-package.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,17 @@ jobs:
8585
if: inputs.package-type == 'Full'
8686
shell: pwsh
8787
run: |
88-
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_Win_x64/*.dll" -Destination "DryWetMidi" -Verbose
89-
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_macOS_x64_arm64/*.dylib" -Destination "DryWetMidi" -Verbose
88+
$winX64Destination = "Native\win_x64"
89+
New-Item -ItemType Directory -Force -Path $winX64Destination
90+
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_Win_x64/Melanchall_DryWetMidi_Native.dll" -Destination "$winX64Destination" -Force -Verbose
91+
92+
$winArm64Destination = "Native\win_arm64"
93+
New-Item -ItemType Directory -Force -Path $winArm64Destination
94+
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_Win_arm64/Melanchall_DryWetMidi_Native.dll" -Destination "$winArm64Destination" -Force -Verbose
95+
96+
$macosX64Arm64Destination = "Native\macos_x64_arm64"
97+
New-Item -ItemType Directory -Force -Path $macosX64Arm64Destination
98+
Copy-Item -Path "${{ runner.temp }}/NativeLibraries/Native_macOS_x64_arm64/Melanchall_DryWetMidi_Native.dylib" -Destination "$macosX64Arm64Destination" -Force -Verbose
9099
91100
- name: Build project
92101
run: dotnet build DryWetMidi/Melanchall.DryWetMidi.csproj --configuration ${{ vars.BUILD_CONFIGURATION || 'Release' }}

.github/workflows/run-check-dwm-api-tool.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run CheckDwmApi Tool
1+
name: Run CheckDwmApi tool
22

33
run-name: RunCheckDwmApiTool_Net_${{ github.ref_name }}_${{ vars.LIBRARY_VERSION }}_${{ github.run_number }}
44

@@ -39,9 +39,6 @@ jobs:
3939
#- os: windows-11-arm
4040
# framework: Net
4141
# win-arch: 'arm64'
42-
#- os: windows-11-arm
43-
# framework: NetFramework
44-
# win-arch: 'arm64'
4542
- os: macos-latest
4643
framework: Net
4744
win-arch: 'x64'

.github/workflows/test-core.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Core
1+
name: Test Core API
22

33
run-name: TestCore_${{ github.ref_name }}_${{ vars.LIBRARY_VERSION }}_${{ github.run_number }}
44

@@ -49,8 +49,6 @@ jobs:
4949
include:
5050
- os: windows-11-arm
5151
framework: Net
52-
- os: windows-11-arm
53-
framework: NetFramework
5452
- os: macos-latest
5553
framework: Net
5654
- os: ubuntu-24.04-arm

.github/workflows/test-mmedia.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test Multimedia
1+
name: Test Multimedia API
22

33
run-name: TestMultimedia_${{ github.ref_name }}_${{ vars.LIBRARY_VERSION }}_${{ github.run_number }}
44

@@ -53,8 +53,6 @@ jobs:
5353
fail-fast: false
5454
matrix:
5555
include:
56-
#- os: windows-11-arm
57-
# framework: NetFramework
5856
#- os: windows-11-arm
5957
# framework: Net
6058
- os: macos-latest

.github/workflows/test-net-package-integration.yml

Lines changed: 93 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test .NET Package Integration
1+
name: Test package integration
22

33
run-name: TestPackageIntegration_Net_${{ github.ref_name }}_${{ vars.LIBRARY_VERSION }}_${{ github.run_number }}
44

@@ -43,8 +43,10 @@ jobs:
4343
include:
4444
#- os: windows-11-arm
4545
# framework: Net
46+
# rid: win-arm64
4647
- os: macos-latest
4748
framework: Net
49+
rid: osx-arm64
4850

4951
steps:
5052
- name: Checkout
@@ -66,6 +68,29 @@ jobs:
6668
netframework-tfm: ${{ vars.BUILD_FRAMEWORK_NETFRAMEWORK_TFM || 'net48' }}
6769
netframework-sdk-version: ${{ vars.BUILD_FRAMEWORK_NETFRAMEWORK_SDK_VERSION || '8.0.x' }}
6870

71+
- name: Add package to the project
72+
shell: pwsh
73+
run: |
74+
Write-Host "Adding local NuGet source with the package..."
75+
dotnet nuget add source "${{ github.workspace }}/NuGetPackage"
76+
77+
Write-Host "Adding Melanchall.DryWetMidi.${{ vars.LIBRARY_VERSION }} package reference to the project..."
78+
$path = Resolve-Path 'Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj'
79+
dotnet add "$path" package Melanchall.DryWetMidi -v ${{ vars.LIBRARY_VERSION }} -s "${{ github.workspace }}/NuGetPackage"
80+
81+
- name: Check csproj package reference
82+
shell: pwsh
83+
run: |
84+
$path = "Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj"
85+
$expected = '<PackageReference Include="Melanchall.DryWetMidi" Version="${{ vars.LIBRARY_VERSION }}" />'
86+
Write-Host "Expecting: $expected"
87+
$found = Select-String -Path $path -Pattern $expected -SimpleMatch -Quiet
88+
if (-not $found) {
89+
Write-Error "Package reference not found: $expected"
90+
exit 1
91+
}
92+
Write-Host "Package reference found."
93+
6994
- name: Create MIDI ports (Windows)
7095
if: runner.os == 'Windows'
7196
uses: ./.github/actions/create-ports-windows
@@ -79,38 +104,75 @@ jobs:
79104
with:
80105
enabled: 'true'
81106

82-
- name: Add package to the project
83-
shell: pwsh
84-
run: |
85-
$path = Resolve-Path 'Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj'
86-
dotnet add "$path" package Melanchall.DryWetMidi -v ${{ vars.LIBRARY_VERSION }} -s "${{ github.workspace }}/NuGetPackage"
87-
88-
- name: Set csproj elements
89-
shell: pwsh
90-
run: |
91-
Write-Host "Parsing csproj..."
92-
[xml]$xml = Get-Content -Path 'Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj'
93-
94-
Write-Host "Setting TFM ${{ steps.framework.outputs.tfm }}..."
95-
$xml.Project.PropertyGroup.TargetFramework = '${{ steps.framework.outputs.tfm }}'
96-
97-
Write-Host "Saving csproj..."
98-
$path = Resolve-Path 'Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj'
99-
$xml.Save($path)
100-
101-
Write-Host "Displaying csproj content..."
102-
$content = Get-Content -Path 'Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj'
103-
Write-Host $content
104-
105-
- name: Restore packages
107+
- name: Run app via dotnet
106108
shell: pwsh
107109
run: |
108110
$path = Resolve-Path 'Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj'
109-
dotnet nuget add source "${{ github.workspace }}/NuGetPackage"
110-
dotnet restore "$path"
111-
112-
- name: Run test program
111+
dotnet run --project "$path" --configuration ${{ vars.BUILD_CONFIGURATION }}
112+
113+
- name: Run app after publish
113114
shell: pwsh
114115
run: |
115-
$path = Resolve-Path 'Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj'
116-
dotnet run --project "$path" --no-restore
116+
$projectPath = "Resources/PackageIntegrationTestUtilities/DwmNetConsoleApp/DwmNetConsoleApp/DwmNetConsoleApp.csproj"
117+
118+
foreach ($psf in @('true', 'false')) {
119+
foreach ($prtr in @('true', 'false')) {
120+
foreach ($inlfse in @('true', 'false')) {
121+
foreach ($sc in @('true', 'false')) {
122+
foreach ($pt in @('true', 'false')) {
123+
$publishOptions = @"
124+
SelfContained = $sc
125+
PublishSingleFile = $psf
126+
PublishReadyToRun = $prtr
127+
IncludeNativeLibrariesForSelfExtract = $inlfse
128+
PublishTrimmed = $pt
129+
"@
130+
Write-Host "$publishOptions"
131+
132+
$outputPath = "${{ runner.temp }}/publish/$rid/sc-$sc-psf-$psf-prtr-$prtr-inlfse-$inlfse-pt-$pt"
133+
Write-Host "Output path set to '$outputPath'"
134+
135+
Write-Host "Publishing the app..."
136+
dotnet publish `
137+
--configuration ${{ vars.BUILD_CONFIGURATION }} `
138+
--runtime ${{ matrix.rid }} `
139+
--self-contained=$sc `
140+
-p:PublishSingleFile=$psf `
141+
-p:PublishReadyToRun=$prtr `
142+
-p:IncludeNativeLibrariesForSelfExtract=$inlfse `
143+
-p:PublishTrimmed=$pt `
144+
-p:SolutionDir="${{ github.workspace }}/" `
145+
--output $outputPath `
146+
$projectPath
147+
148+
if ($LASTEXITCODE -ne 0) {
149+
Write-Error "Publish failed with exit code $LASTEXITCODE"
150+
exit $LASTEXITCODE
151+
}
152+
153+
Write-Host "Listing published files..."
154+
Write-Host ""
155+
Get-ChildItem -Recurse -Force -Path "$outputPath" | Format-Table @{Label="File Name"; Expression={$_.Name}}, @{Label="Size (KB)"; Expression={"{0:N2}" -f ($_.Length / 1KB)}}
156+
Write-Host ""
157+
158+
Write-Host "Running the app..."
159+
Write-Host ""
160+
if ($IsWindows) {
161+
& "$outputPath/DwmNetConsoleApp.exe"
162+
} else {
163+
& "$outputPath/DwmNetConsoleApp"
164+
}
165+
166+
if ($LASTEXITCODE -ne 0) {
167+
Write-Error "App execution failed with exit code $LASTEXITCODE"
168+
exit $LASTEXITCODE
169+
}
170+
171+
Write-Host ""
172+
Write-Host "Configuration test completed successfully"
173+
Write-Host ""
174+
}
175+
}
176+
}
177+
}
178+
}

.github/workflows/test-net-selfcontained-package-integration.yml

Lines changed: 0 additions & 144 deletions
This file was deleted.

DryWetMidi.Tests/Melanchall.DryWetMidi.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net48;net10.0</TargetFrameworks>
4+
<TargetFrameworks>net10.0</TargetFrameworks>
55
<OutputType>Library</OutputType>
66
<Configurations>Debug;Release;ReleaseTest;ReleaseTestFull</Configurations>
77
<SignAssembly>true</SignAssembly>

0 commit comments

Comments
 (0)