Skip to content

Commit

Permalink
Merge pull request #4 from MiikaRK/pipeline-develop
Browse files Browse the repository at this point in the history
Added separate build for Windows and Android
  • Loading branch information
MiikaRK authored Jan 9, 2024
2 parents ab5bc12 + 6b1078b commit 9e2386d
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 16 deletions.
69 changes: 54 additions & 15 deletions .github/workflows/FuelCostCalculator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,58 @@ on:
branches: [ "master" ]

jobs:
build:
runs-on: windows-latest
build-windows:
runs-on: windows-2022
name: Windows Build
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Install .NET MAUI workload
run: dotnet workload install maui
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Checkout
uses: actions/checkout@v2

- name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Install MAUI Workloads
run: |
dotnet workload install maui --ignore-failed-sources
- name: Restore Dependencies
run: dotnet restore FuelCostCalculator/FuelCostCalculator.csproj

- name: Build MAUI Windows
run: dotnet publish FuelCostCalculator/FuelCostCalculator.csproj -c Release -f net8.0-windows10.0.19041.0 --runtime win-x64 --no-restore

- name: Upload Windows Artifact
uses: actions/upload-artifact@v2.3.1
with:
name: windows-ci-build
path: FuelCostCalculator/bin/x64/Release/net8.0-windows10.0.19041.0/win-x64/AppPackages/FuelCostCalculator_1.0.0.1_Test/FuelCostCalculator_1.0.0.1_x64.msix


build-android:
runs-on: windows-2022
name: Android Build
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Install MAUI Workloads
run: dotnet workload install maui --ignore-failed-sources

- name: Restore Dependencies
run: dotnet restore FuelCostCalculator/FuelCostCalculator.csproj

- name: Build MAUI Android
run: dotnet build FuelCostCalculator/FuelCostCalculator.csproj -c Release -f net8.0-android --no-restore

- name: Upload Android Artifact
uses: actions/upload-artifact@v2.3.1
with:
name: android-ci-build
path: FuelCostCalculator/bin/Release/net8.0-android/*Signed.a*
4 changes: 3 additions & 1 deletion FuelCostCalculator/FuelCostCalculator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->

<RuntimeIdentifiers Condition=" '$(TargetFramework)' == 'net8.0-windows10.0.19041.0' ">win-x64</RuntimeIdentifiers>
<Platform Condition=" '$(TargetFramework)' == 'net8.0-windows10.0.19041.0' ">x64</Platform>
<PublishReadyToRun>false</PublishReadyToRun>
<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifier>.
Expand Down

0 comments on commit 9e2386d

Please sign in to comment.