Skip to content

Commit 52c2747

Browse files
authored
Update
1 parent 09bb814 commit 52c2747

File tree

4 files changed

+48
-45
lines changed

4 files changed

+48
-45
lines changed

.github/scripts/Build-AppSolution.ps1

+31-28
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the MIT License.
33

44
param(
5-
[string]$ReleaseBranch = "Debug", # This has to correspond with one of the AppEnvironment enum values
5+
[string]$ReleaseBranch = "Debug", # Debug, Release, SideloadPreview, SideloadStable, StorePreview, or StoreStable
66
[string]$SolutionPath = "Files.slnx",
77
[string]$StartupProjectPath = "",
88
[string]$Platform = "x64",
@@ -18,36 +18,36 @@ msbuild $SolutionPath /t:Restore /p:Platform=$Platform /p:Configuration=$Configu
1818

1919
if ($ReleaseBranch -eq "Debug")
2020
{
21-
if ($Platform -eq "x64")
22-
{
23-
msbuild $StartupProjectPath `
24-
/t:Build `
25-
/clp:ErrorsOnly `
26-
/p:Platform=$Platform `
27-
/p:Configuration=$Configuration `
28-
/p:AppxBundlePlatforms=$Platform `
29-
/p:AppxBundle=Always `
30-
/p:UapAppxPackageBuildMode=SideloadOnly `
31-
/p:AppxPackageDir=$AppxPackageDir `
32-
/p:AppxPackageSigningEnabled=true `
33-
/p:PackageCertificateKeyFile=$AppxPackageCertKeyFile `
34-
/p:PackageCertificatePassword="" `
35-
/p:PackageCertificateThumbprint=""
36-
}
37-
else
38-
{
39-
msbuild $StartupProjectPath `
40-
/t:Build `
41-
/clp:ErrorsOnly `
42-
/p:Platform=$Platform `
43-
/p:Configuration=$Configuration `
44-
/p:AppxBundle=Never
45-
}
21+
msbuild $StartupProjectPath `
22+
/t:Build `
23+
/clp:ErrorsOnly `
24+
/p:Platform=$Platform `
25+
/p:Configuration=$Configuration `
26+
/p:AppxBundle=Never `
27+
/v:quiet
28+
}
29+
elseif ($ReleaseBranch -eq "Release")
30+
{
31+
msbuild $StartupProjectPath `
32+
/t:Build `
33+
/clp:ErrorsOnly `
34+
/p:Platform=$Platform `
35+
/p:Configuration=$Configuration `
36+
/p:AppxBundlePlatforms=$Platform `
37+
/p:AppxBundle=Always `
38+
/p:UapAppxPackageBuildMode=SideloadOnly `
39+
/p:AppxPackageDir=$AppxPackageDir `
40+
/p:AppxPackageSigningEnabled=true `
41+
/p:PackageCertificateKeyFile=$AppxPackageCertKeyFile `
42+
/p:PackageCertificatePassword="" `
43+
/p:PackageCertificateThumbprint="" `
44+
/v:quiet
4645
}
4746
elseif ($ReleaseBranch -contains "Sideload")
4847
{
4948
msbuild $StartupProjectPath `
5049
/t:Build `
50+
/t:_GenerateAppxPackage `
5151
/clp:ErrorsOnly `
5252
/p:Platform=$Platform `
5353
/p:Configuration=$Configuration `
@@ -56,7 +56,8 @@ elseif ($ReleaseBranch -contains "Sideload")
5656
/p:AppxBundle=Always `
5757
/p:UapAppxPackageBuildMode=Sideload `
5858
/p:GenerateAppInstallerFile=True `
59-
/p:AppInstallerUri=$AppInstallerUrl
59+
/p:AppInstallerUri=$AppInstallerUrl `
60+
/v:quiet
6061

6162
$newSchema = 'http://schemas.microsoft.com/appx/appinstaller/2018'
6263
$localFilePath = '$AppxPackageDir/Files.Package.appinstaller'
@@ -68,11 +69,13 @@ elseif ($ReleaseBranch -contains "Store")
6869
{
6970
msbuild $StartupProjectPath `
7071
/t:Build `
72+
/t:_GenerateAppxPackage `
7173
/clp:ErrorsOnly `
7274
/p:Platform=$Platform `
7375
/p:Configuration=$Configuration `
7476
/p:AppxBundlePlatforms=$AppxBundlePlatforms `
7577
/p:AppxPackageDir=$AppxPackageDir `
7678
/p:AppxBundle=Always `
77-
/p:UapAppxPackageBuildMode=StoreUpload
79+
/p:UapAppxPackageBuildMode=StoreUpload `
80+
/v:quiet
7881
}

.github/scripts/Configure-AppxManifest.ps1

+11-11
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# Licensed under the MIT License.
33

44
param(
5-
[string]$Branch = "", # This has to correspond with one of the AppEnvironment enum values
6-
[string]$PackageManifestPath = "",
7-
[string]$Publisher = "",
8-
[string]$WorkingDir = "",
9-
[string]$SecretBingMapsKey = "",
10-
[string]$SecretSentry = "",
5+
[string]$ReleaseBranch = "", # SideloadPreview, SideloadStable, StorePreview, or StoreStable
6+
[string]$PackageManifestPath = "",
7+
[string]$Publisher = "",
8+
[string]$WorkingDir = "",
9+
[string]$SecretBingMapsKey = "",
10+
[string]$SecretSentry = "",
1111
[string]$SecretGitHubOAuthClientId = ""
1212
)
1313

@@ -27,7 +27,7 @@ $ea = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Applications/pkg:Application/pk
2727
# Update the publisher
2828
$xmlDoc.Package.Identity.Publisher = $Publisher
2929

30-
if ($Branch -eq "SideloadPreview")
30+
if ($ReleaseBranch -eq "SideloadPreview")
3131
{
3232
# Set identities
3333
$xmlDoc.Package.Identity.Name="FilesPreview"
@@ -54,7 +54,7 @@ if ($Branch -eq "SideloadPreview")
5454
Set-Content $_ -NoNewline `
5555
}
5656
}
57-
elseif ($Branch -eq "StorePreview")
57+
elseif ($ReleaseBranch -eq "StorePreview")
5858
{
5959
# Set identities
6060
$xmlDoc.Package.Identity.Name="49306atecsolution.FilesPreview"
@@ -87,7 +87,7 @@ elseif ($Branch -eq "StorePreview")
8787
Set-Content $_ -NoNewline `
8888
}
8989
}
90-
elseif ($Branch -eq "SideloadStable")
90+
elseif ($ReleaseBranch -eq "SideloadStable")
9191
{
9292
# Set identities
9393
$xmlDoc.Package.Identity.Name="Files"
@@ -114,7 +114,7 @@ elseif ($Branch -eq "SideloadStable")
114114
Set-Content $_ -NoNewline `
115115
}
116116
}
117-
elseif ($Branch -eq "StoreStable")
117+
elseif ($ReleaseBranch -eq "StoreStable")
118118
{
119119
# Set identities
120120
$xmlDoc.Package.Identity.Name="49306atecsolution.FilesUWP"
@@ -148,7 +148,7 @@ elseif ($Branch -eq "StoreStable")
148148

149149
Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process `
150150
{ `
151-
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "cd_app_env_placeholder", $Branch }) | `
151+
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "cd_app_env_placeholder", $ReleaseBranch }) | `
152152
Set-Content $_ -NoNewline `
153153
}
154154

.github/workflows/cd.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ jobs:
7171
- name: Build Files
7272
run: |
7373
. './.github/scripts/Configure-AppxManifest.ps1' `
74-
-Branch "$env:RELEASE_BRANCH" `
74+
-ReleaseBranch "$env:RELEASE_BRANCH" `
7575
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
7676
-WorkingDir "$env:WORKING_DIR" `
7777
-Publisher "$env:SECRET_PUBLISHER_NAME" `
7878
-SecretBingMapsKey "$env:SECRET_BINGMAPS_KEY" `
7979
-SecretSentry "$env:SECRET_SENTRY" `
8080
-SecretGitHubOAuthClientId "$env:SECRET_GH_OAUTH_CLIENT_ID"
8181
. './.github/scripts/Build-AppSolution.ps1' `
82-
-Branch "$env:RELEASE_BRANCH" `
82+
-ReleaseBranch "$env:RELEASE_BRANCH" `
8383
-SolutionPath "$env:SOLUTION_PATH" `
8484
-StartupProjectPath "$env:PACKAGE_PROJECT_PATH" `
8585
-Configuration "$env:CONFIGURATION" `
@@ -158,15 +158,15 @@ jobs:
158158
- name: Build Files
159159
run: |
160160
. './.github/scripts/Configure-AppxManifest.ps1' `
161-
-Branch "$env:RELEASE_BRANCH" `
161+
-ReleaseBranch "$env:RELEASE_BRANCH" `
162162
-PackageManifestPath "$env:PACKAGE_MANIFEST_PATH" `
163163
-WorkingDir "$env:WORKING_DIR" `
164164
-Publisher "$env:SECRET_PUBLISHER_NAME" `
165165
-SecretBingMapsKey "$env:SECRET_BINGMAPS_KEY" `
166166
-SecretSentry "$env:SECRET_SENTRY" `
167167
-SecretGitHubOAuthClientId "$env:SECRET_GH_OAUTH_CLIENT_ID"
168168
. './.github/scripts/Build-AppSolution.ps1' `
169-
-Branch "$env:RELEASE_BRANCH" `
169+
-ReleaseBranch "$env:RELEASE_BRANCH" `
170170
-SolutionPath "$env:SOLUTION_PATH" `
171171
-StartupProjectPath "$env:PACKAGE_PROJECT_PATH" `
172172
-Configuration "$env:CONFIGURATION" `

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
name: Build Files
113113
run: |
114114
. './.github/scripts/Build-AppSolution.ps1' `
115-
-Branch "$env:CONFIGURATION" `
115+
-ReleaseBranch "$env:CONFIGURATION" `
116116
-SolutionPath "$env:SOLUTION_PATH" `
117117
-StartupProjectPath "$env:PACKAGE_PROJECT_PATH" `
118118
-Configuration "$env:CONFIGURATION" `
@@ -126,7 +126,7 @@ jobs:
126126
-Destination "$env:APPX_SELFSIGNED_CERT_PATH"
127127
# Restore and build
128128
. './.github/scripts/Build-AppSolution.ps1' `
129-
-Branch "$env:CONFIGURATION" `
129+
-ReleaseBranch "$env:CONFIGURATION" `
130130
-SolutionPath "$env:SOLUTION_PATH" `
131131
-StartupProjectPath "$env:PACKAGE_PROJECT_PATH" `
132132
-Configuration "$env:CONFIGURATION" `

0 commit comments

Comments
 (0)