-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (50 loc) · 2.46 KB
/
msbuild.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
name: MSBuild
on: [push]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./UFCase.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
jobs:
build:
runs-on: windows-2022
# runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.3
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
nuget restore ./UFCase/packages.config -SolutionDirectory .
nuget restore ./UFCase.Host/packages.config -SolutionDirectory .
nuget restore ./UFCase.Host.Test/packages.config -SolutionDirectory .
# Decode the base 64 encoded pfx and save the Signing_Certificate
- name: Decode the pfx
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.BASE64_ENCODED_PFX }}")
$certificatePath = Join-Path -Path ./UFCase -ChildPath UFCase_TemporaryKey.pfx
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
# Create the app package by building and packaging the project
- name: Create the app package
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild ${{ env.SOLUTION_FILE_PATH }} /m /p:Configuration=${{ env.BUILD_CONFIGURATION }} /p:Platform=${{ env.BUILD_PLATFORM }} /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=UFCase_TemporaryKey.pfx /p:PackageCertificatePassword="${{ secrets.PFX_KEY }}" /p:AppxPackageDir="$env:Appx_Package_Dir" /p:GenerateAppxPackageOnBuild=true
env:
Appx_Bundle: Never
Appx_Package_Build_Mode: SideloadOnly
Appx_Package_Dir: AppPackages\
Configuration: ${{ env.BUILD_CONFIGURATION }}
Platform: ${{ env.BUILD_PLATFORM }}
- name: Remove the pfx
working-directory: ${{env.GITHUB_WORKSPACE}}
run: Remove-Item -path ./UFCase/UFCase_TemporaryKey.pfx
# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact
- name: Upload MSIX package
uses: actions/upload-artifact@v2
with:
name: MSIX Package
path: UFCase\AppPackages\