Skip to content

Commit 32c907c

Browse files
committed
Add platform-specific builds and package path variable
Updated `dotnet-windows.yml` to include a new environment variable `Package_Creation_Path` for package creation. Added steps for platform-specific builds for Windows, Android, and iOS for both the library and sample app. Modified existing build steps to accommodate these changes and clarified the NuGet packaging process to include all platforms.
1 parent 748ac9d commit 32c907c

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/dotnet-windows.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ env:
1818
SAMPLE_CSPROJ: samples/PJ.ContextActions.Sample/PJ.ContextActions.Sample.csproj
1919
NugetPackageVersion: '99.0.0-preview${{ github.run_number }}'
2020
CurrentSemanticVersionBase: '99.0.0'
21+
Package_Creation_Path: './src/PJ.ContextActions.Maui/bin/Release'
2122

2223
jobs:
2324
build:
@@ -41,18 +42,33 @@ jobs:
4142
- name: Workload install
4243
run: dotnet workload install maui
4344

45+
- name: Install Windows Runtime Pack
46+
run: dotnet workload install microsoft-net-runtime-windows-net9.0
47+
4448
- name: Restore library dependencies
4549
run: dotnet restore ${{env.LIB_CSPROJ}}
4650

4751
- name: Restore sample dependencies
4852
run: dotnet restore ${{env.SAMPLE_CSPROJ}}
4953

50-
- name: Build library
51-
run: dotnet build ${{env.LIB_CSPROJ}} -c Release -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }} --no-restore
54+
# Platform-specific builds for the library
55+
- name: Build library (Windows)
56+
run: dotnet build ${{env.LIB_CSPROJ}} -c Release -f net9.0-windows10.0.19041.0 -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }} --no-restore
57+
58+
- name: Build library (Android)
59+
run: dotnet build ${{env.LIB_CSPROJ}} -c Release -f net9.0-android -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }} --no-restore
60+
61+
- name: Build library (iOS)
62+
run: dotnet build ${{env.LIB_CSPROJ}} -c Release -f net9.0-ios -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }} --no-restore
63+
64+
# Platform-specific builds for the sample app
65+
- name: Build Sample app (Windows)
66+
run: dotnet build ${{env.SAMPLE_CSPROJ}} -c Release -f net9.0-windows10.0.19041.0 --no-restore
5267

53-
- name: Build Sample app
54-
run: dotnet build ${{env.SAMPLE_CSPROJ}} -c Release --no-restore
68+
- name: Build Sample app (Android)
69+
run: dotnet build ${{env.SAMPLE_CSPROJ}} -c Release -f net9.0-android --no-restore
5570

71+
# NuGet packaging - this will package all platforms since we've built them all above
5672
- name: Create Nuget
5773
run: dotnet pack ${{env.LIB_CSPROJ}} -c Release --no-restore --no-build --include-symbols --include-source
5874

0 commit comments

Comments
 (0)