-
Notifications
You must be signed in to change notification settings - Fork 55
104 lines (89 loc) · 3.76 KB
/
cd-store.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
# Copyright (c) 2024 0x5BFA
# Licensed under the MIT License. See the LICENSE.
name: FluentHub CD (Store)
on:
workflow_dispatch:
run-name: 'FluentHub CD (Store)'
jobs:
build:
if: github.repository_owner == '0x5bfa'
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Release] # Consider to use Store
platform: [x64]
env:
APPX_BUNDLE_PLATFORMS: 'x64|arm64'
CONFIGURATION: '${{ matrix.configuration }}'
PLATFORM: '${{ matrix.platform }}'
WORKING_DIR: '${{ github.workspace }}' # Default: 'D:\a\FluentHub\FluentHub'
SOLUTION_PATH: '${{ github.workspace }}\FluentHub.sln'
PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\FluentHub.Package'
PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\FluentHub.Package\FluentHub.Package.wapproj'
APP_CREDENTIALS_PATH: '${{ github.workspace }}\src\FluentHub.App\AppCredentials.config'
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages'
STORE_BROKER_STAGING_DIR: '${{ github.workspace }}\.github\configurations\MicrosoftStore\submission'
STORE_BROKER_CONFIG_PATH: '${{ github.workspace }}\.github\configurations\MicrosoftStore\config.json'
steps:
- name: Checkout the repository
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: NuGet/setup-nuget@v2
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Save base64 credentials into a file
shell: pwsh
run: |
$bytes = [Convert]::FromBase64String($env:GH_CREDENTIALS_SECRET)
[IO.File]::WriteAllBytes($env:APP_CREDENTIALS_PATH, $bytes)
env:
GH_CREDENTIALS_SECRET: '${{ secrets.GH_CREDENTIALS_JSON_BASE64 }}'
- name: Restore NuGet
shell: pwsh
run: 'nuget restore $env:SOLUTION_PATH'
- name: Restore FluentHub
shell: pwsh
run: |
msbuild $env:SOLUTION_PATH `
-t:Restore `
-p:Platform=$env:PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-p:PublishReadyToRun=true
- name: Build & package FluentHub
run: |
msbuild "$env:PACKAGE_PROJECT_PATH" `
-t:Build `
-t:_GenerateAppxPackage `
-clp:ErrorsOnly `
-p:Platform=$env:PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS `
-p:AppxPackageDir="$env:APPX_PACKAGE_DIR" `
-p:AppxBundle=Always `
-p:UapAppxPackageBuildMode=StoreUpload
- name: Upload the packages to the Artifacts
uses: actions/upload-artifact@v4
with:
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})'
path: ${{ env.ARTIFACTS_STAGING_DIR }}
#- name: Publish to Microsoft Store
# shell: pwsh
# run: |
# . './scripts/SubmitTo-MicrosoftStore.ps1' `
# -SubmissionDirPath=$env:STORE_BROKER_STAGING_DIR `
# -BrokerConfigPath=$env:STORE_BROKER_CONFIG_PATH `
# -AppxPackagePath=$env:ARTIFACTS_STAGING_DIR `
# -PartnerCenterClientId=$env:PARTNER_CENTER_CLIENT_ID `
# -PartnerCenterClientSecret=$env:PARTNER_CENTER_CLIENT_SECRET `
# -PartnerCenterStoreId=9NKB9HX8RJZ3 `
# -PartnerCenterTenantId=$env:PARTNER_CENTER_TENANT_ID
# env:
# PARTNER_CENTER_CLIENT_ID: ${{ secrets.PARTNER_CENTER_CLIENT_ID }}
# PARTNER_CENTER_CLIENT_SECRET: ${{ secrets.PARTNER_CENTER_CLIENT_SECRET }}
# PARTNER_CENTER_TENANT_ID: ${{ secrets.PARTNER_CENTER_TENANT_ID }}