-
Notifications
You must be signed in to change notification settings - Fork 6
89 lines (74 loc) · 2.95 KB
/
dotnet-desktop.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: .NET Core Desktop
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: windows-latest
env:
Solution_Name: WpfMaiTouchEmulator.sln
Wap_Project_Directory: .
Wap_Project_Path: WpfMaiTouchEmulator.csproj
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
# Decode the base 64 encoded pfx and save the Signing_Certificate
- name: Decode the pfx
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.Base64_Encoded_Pfx }}")
$certificatePath = Join-Path -Path $env:Wap_Project_Directory -ChildPath GitHubActionsWorkflow.pfx
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
# Create the app package by building and packaging the Windows Application Packaging project
- name: Create the app package
run: msbuild $env:Wap_Project_Path /p:Configuration=$env:Configuration /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:PackageCertificatePassword=${{ secrets.Pfx_Key }} /p:Version=1.6.0.${{ github.run_number }}
env:
Appx_Bundle: Always
Appx_Bundle_Platforms: x86|x64
Appx_Package_Build_Mode: StoreUpload
Configuration: ${{ matrix.configuration }}
- name: Build AIP
uses: caphyon/[email protected]
with:
advinst-version: '22.2'
advinst-enable-automation: 'true'
aip-path: ${{ github.workspace }}\Installer\Mai Touch Emulator.aip
aip-build-name: DefaultBuild
aip-package-name: installMaiTouchEmulator.msi
aip-output-dir: ${{ github.workspace }}\setup
aip-commands: |
SetProperty FOO="foo"
SetVersion 1.6.0.${{ github.run_number }}
# Remove the pfx
- name: Remove the pfx
run: Remove-Item -path $env:Wap_Project_Directory\GitHubActionsWorkflow.pfx
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: MaiTouchEmulatorPortable
path: ./bin/Release/net8.0-windows10.0.17763.0/
- name: Publish setup artifact
uses: actions/upload-artifact@v3
with:
name: MaiTouchEmulatorInstaller
path: ./setup/installMaiTouchEmulator.msi