Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/dotnet-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,28 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '16.3'

- name: Workload install
run: dotnet workload install maui

- name: Restore library dependencies
run: dotnet restore ${{env.LIB_CSPROJ}}

- name: Restore sample dependencies
run: dotnet restore

- name: Build library
run: dotnet build ${{env.LIB_CSPROJ}} -c Release -f net9.0-ios --no-restore

- name: Build Sample app
run: dotnet build ${{env.SAMPLE_CSPROJ}} -c Release -f net9.0-ios --no-restore
37 changes: 36 additions & 1 deletion .github/workflows/dotnet-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
env:
LIB_CSPROJ: PJ.NavigationTrans.Maui/PJ.NavigationTrans.Maui.csproj
SAMPLE_CSPROJ: PJ.NavigationTrans.Sample/PJ.NavigationTrans.Sample.csproj
NugetPackageVersion: '99.0.0-preview${{ github.run_number }}'
CurrentSemanticVersionBase: '99.0.0'

jobs:
build:
Expand All @@ -22,17 +24,50 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Get Nuget version and Name for PR
if: ${{ github.event_name == 'pull_request' }}
run: |
echo "NugetPackageVersion=${{ env.CurrentSemanticVersionBase }}-build-${{ github.event.pull_request.number }}.${{ github.run_number }}+${{ github.sha }}"
shell: bash

- name: Workload install
run: dotnet workload install maui

- name: Restore library dependencies
run: dotnet restore ${{env.LIB_CSPROJ}}

- name: Restore sample dependencies
run: dotnet restore

- name: Build library
run: dotnet build ${{env.LIB_CSPROJ}} -c Release --no-restore
run: dotnet build ${{env.LIB_CSPROJ}} -c Release -p:PackageVersion=${{ env.NugetPackageVersion }} -p:Version=${{ env.NugetPackageVersion }} --no-restore

- name: Build Sample app
run: dotnet build ${{env.SAMPLE_CSPROJ}} -c Release --no-restore

- name: Create Nuget
run: dotnet pack ${{env.LIB_CSPROJ}} -c Release --no-restore --no-build --include-symbols --include-source

- name: Copy NuGet Packages to Staging Directory
if: ${{ runner.os == 'Windows' && !startsWith(github.ref, 'refs/tags/') }}
run: |
mkdir -p ${{ github.workspace }}/nuget
Get-ChildItem -Path "./PJ.NavigationTrans.Maui/" -Recurse | Where-Object { $_.Extension -match "nupkg" } | Copy-Item -Destination "${{ github.workspace }}/nuget"
shell: pwsh

- name: List NuGet packages found
run: |
Get-ChildItem -Path "${{ github.workspace }}/nuget" | Format-Table Name
shell: pwsh

- name: Publish Packages
uses: actions/upload-artifact@v4
with:
name: packages
path: ${{ github.workspace }}/nuget/
1 change: 1 addition & 0 deletions PJ.NavigationTrans.Sample/PJ.NavigationTrans.Sample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<OutputType>Exe</OutputType>
<RootNamespace>PJ.NavigationTrans.Sample</RootNamespace>
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>

<!-- Display name -->
<ApplicationTitle>PJ.NavigationTrans.Sample</ApplicationTitle>
Expand Down
Loading