-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 2.51 KB
/
release.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
name: Release
on:
push:
branches:
- main
- release/*
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Release]
platform: [x64]
env:
Solution_Name: Luxoria.App.sln
steps:
# Checkout the code from the repository
- name: Checkout code
uses: actions/checkout@v3
# Set up .NET SDK
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.x' # Specify the .NET SDK version you are using
# 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 }}
working-directory: ./Luxoria.App
# 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 = "GitHubActionsWorkflow.pfx"
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
working-directory: ./Luxoria.App
# Create the app package by building and packaging the project
- name: Create the app package
run: msbuild $env:Solution_Name /p:Configuration=$env:Configuration /p:Platform=$env:Platform /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=GitHubActionsWorkflow.pfx /p:AppxPackageDir="$env:Appx_Package_Dir" /p:GenerateAppxPackageOnBuild=true
env:
Appx_Bundle: Never
Appx_Package_Build_Mode: SideloadOnly
Appx_Package_Dir: Packages\
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
working-directory: ./Luxoria.App
- name: Zip the published app
run: Compress-Archive -Path ./Luxoria.App/Luxoria.App/Packages -DestinationPath ./Luxoria.App.${{matrix.platform}}.zip
shell: pwsh
# Upload the published app
- name: Upload app
uses: actions/upload-artifact@v4
with:
name: Luxoria.App.${{matrix.platform}}
path: ./Luxoria.App.${{matrix.platform}}.zip
retention-days: 1