-
Notifications
You must be signed in to change notification settings - Fork 2
114 lines (96 loc) · 3.23 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: UWP app
on:
push:
branches:
- release/*
workflow_dispatch:
env:
Project_Name: 'Yugen.Mosaic.Uwp'
jobs:
build:
runs-on: windows-latest
outputs:
MajorMinorPatch: ${{ steps.gitversion.outputs.MajorMinorPatch }}
env:
Configuration: 'Release'
Solution_Name: 'Yugen.Mosaic.sln'
appxPackageDir: '${{ github.workspace }}\AppxPackages'
appxmanifest: '**/*.appxmanifest'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0
- name: Update manifest version
run: |
[xml]$manifest = get-content ".\${{ env.Project_Name }}\Package.appxmanifest"
$manifest.Package.Identity.Version = "${{ steps.gitversion.outputs.MajorMinorPatch }}.0"
$manifest.save(".\${{ env.Project_Name }}\Package.appxmanifest")
- name: Set up dependency caching for faster builds
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup NuGet
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NUGET_KEY }}
- name: Restore dependencies
run: nuget restore ${{ env.Solution_Name }}
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1
with:
msbuild-architecture: x64
- name: Create the app package
run: |
msbuild ${{ env.Solution_Name }} `
/p:AppxBundlePlatforms="${{ env.Appx_Bundle_Platforms}}" `
/p:AppxPackageDir="${{ env.appxPackageDir }}" `
/p:AppxBundle=${{ env.Appx_Bundle }} `
/p:UapAppxPackageBuildMode=${{ env.Appx_Package_Build_Mode }} `
/p:AppxPackageSigningEnabled=false `
/p:Configuration=${{ env.Configuration }}
env:
Platform: x64
Appx_Bundle: Always
Appx_Bundle_Platforms: 'x64|ARM64'
Appx_Package_Build_Mode: StoreUpload
- name: Upload msixupload
uses: actions/upload-artifact@v3
with:
name: msixupload
path: ${{ env.appxPackageDir }}\**\*.msixupload
deploy:
runs-on: windows-latest
needs: [build]
environment: PROD
env:
ARTIFACT_DIRECTORY: artifact
STORE_APP_ID: 9PF0S24CX0D4
MajorMinorPatch: ${{needs.build.outputs.MajorMinorPatch}}
steps:
- uses: actions/download-artifact@v4.1.7
with:
name: msixupload
path: ${{ env.ARTIFACT_DIRECTORY }}
- uses: isaacrlevin/windows-store-action@1.0
name: Publish to Store
with:
tenant-id: ${{ secrets.AZURE_AD_TENANT_ID }}
client-id: ${{ secrets.AZURE_AD_APPLICATION_CLIENT_ID }}
client-secret: ${{ secrets.AZURE_AD_APPLICATION_SECRET }}
app-id: ${{ env.STORE_APP_ID }}
package-path: "${{ env.ARTIFACT_DIRECTORY }}"
- uses: softprops/action-gh-release@v1
name: Release
with:
tag_name: ${{env.MajorMinorPatch}}