-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (63 loc) · 2.63 KB
/
windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
## This workflow is based on the one found at: https://blog.taranissoftware.com/building-net-maui-apps-with-github-actions
name: Windows Build
on:
push:
## Only run for pushes directly to main
branches: [ main ]
## Ignore any pushes which only have changes to markdown and git files
paths-ignore:
- '**/*.md'
- '**/*.gitignore'
pull_request:
## Run on all PRs to main
branches: [ main ]
## Allow builds to be run from the Actions view
workflow_dispatch:
## Provide read-only access to the repo
permissions:
contents: read
env:
DOTNET_NOLOGO: true # Disable the .NET logo
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Disable the .NET first time experience
DOTNET_CLI_TELEMETRY_OPTOUT: true # Disable sending .NET CLI telemetry
jobs:
# Build a Windows MSIX (installer package)
build-windows:
runs-on: windows-2022
name: Windows Build
steps:
## Get latest code
- name: Checkout
uses: actions/checkout@v3
## Install .NET v6
- name: Setup .NET 6
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
include-prerelease: true
## Install MSBuild vLatest
- name: Setup MSBuild
uses: microsoft/[email protected]
with:
vs-prerelease: true
## Install .NET Maui build tools
- name: Install MAUI Workloads
run: |
dotnet workload install maui --ignore-failed-sources
## Restore .NET packages
- name: Restore Dependencies
run: dotnet restore InvoiceGenerator-dotnet-maui-UI/InvoiceGenerator-dotnet-maui-UI.csproj
## Build as an MSIX
- name: Build MAUI app for Windows
## Note: it is curently easier to build WIHTOUT SIGNING the app.
## Signing the app requires a certificate, Gerald provides steps
## for generating a certificate in this video: https://youtu.be/8lvdLa0v8zY?t=446
run: dotnet publish InvoiceGenerator-dotnet-maui-UI/InvoiceGenerator-dotnet-maui-UI.csproj -c Release -f:net6.0-windows10.0.19041.0
## Once a certificate is generated, the following command will create a signed MSIX
## run: dotnet publish InvoiceGenerator-dotnet-maui-UI/InvoiceGenerator-dotnet-maui-UI.csproj -c Release -f:net6.0-windows10.0.19041.0 /p:GenerateAppxPackageOnBuild=true /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="${{ secrets.WINDOWS_PFX_THUMBPRINT }}"
## Allow the MXIS to be downloaded later
- name: Upload Windows Artifact
uses: actions/[email protected]
with:
name: windows-ci-build
path: .\**\AppPackages\**\*.*