From 3ae9c16a122459557fba0a5aea6a56eb7ddc21ca Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 4 Jul 2024 00:23:48 +0900 Subject: [PATCH] Init --- .github/workflows/cd-preview.yml | 4 ++-- .github/workflows/cd-stable.yml | 4 ++-- scripts/Configure-AppxManifest.ps1 | 27 ++++++++++++++------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/cd-preview.yml b/.github/workflows/cd-preview.yml index dad88347378a..a9e0403a38c0 100644 --- a/.github/workflows/cd-preview.yml +++ b/.github/workflows/cd-preview.yml @@ -31,8 +31,8 @@ jobs: PLATFORM: '${{ matrix.platform }}' APPX_BUNDLE_PLATFORMS: 'x64|arm64' WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\ - ARTIFACTS_STAGING_DIR: 'artifacts' # D:\a\Files\Files\artifacts\ - APPX_PACKAGE_DIR: 'artifacts\AppxPackages' + ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts' + APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages' PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' PACKAGE_MANIFEST_PATH: 'src\Files.App (Package)\Package.appxmanifest' diff --git a/.github/workflows/cd-stable.yml b/.github/workflows/cd-stable.yml index b2cc57311864..475066b28df0 100644 --- a/.github/workflows/cd-stable.yml +++ b/.github/workflows/cd-stable.yml @@ -31,8 +31,8 @@ jobs: PLATFORM: '${{ matrix.platform }}' APPX_BUNDLE_PLATFORMS: 'x64|arm64' WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\ - ARTIFACTS_STAGING_DIR: 'artifacts' # D:\a\Files\Files\artifacts\ - APPX_PACKAGE_DIR: 'artifacts\AppxPackages' + ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts' + APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages' PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' PACKAGE_MANIFEST_PATH: 'src\Files.App (Package)\Package.appxmanifest' diff --git a/scripts/Configure-AppxManifest.ps1 b/scripts/Configure-AppxManifest.ps1 index a98eb00adca6..7f7bf132b2b1 100644 --- a/scripts/Configure-AppxManifest.ps1 +++ b/scripts/Configure-AppxManifest.ps1 @@ -11,8 +11,8 @@ param( [string]$SecretGitHubOAuthClientId = "" ) -[xml]$xmlDoc = Get-Content "$PackageManifestPath" -$xmlDoc.Package.Identity.Publisher="$Publisher" +[xml]$xmlDoc = Get-Content $PackageManifestPath +$xmlDoc.Package.Identity.Publisher = $Publisher if ($Branch -eq "Preview") { @@ -20,10 +20,11 @@ if ($Branch -eq "Preview") $xmlDoc.Package.Identity.Name="FilesPreview" $xmlDoc.Package.Properties.DisplayName="Files - Preview" $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview" + $xmlDoc.Save($PackageManifestPath) - Get-ChildItem "$WorkingDir\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process ` + Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` { ` - (Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | ` Set-Content $_ -NoNewline ` } } @@ -33,10 +34,11 @@ elseif ($Branch -eq "Stable") $xmlDoc.Package.Identity.Name="Files" $xmlDoc.Package.Properties.DisplayName="Files" $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files" + $xmlDoc.Save($PackageManifestPath) - Get-ChildItem "$WorkingDir\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process ` + Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` { ` - (Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` Set-Content $_ -NoNewline ` } } @@ -53,29 +55,28 @@ elseif ($Branch -eq "Store") $nsmgr.AddNamespace("rescap", "http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities") $pm = $xmlDoc.SelectSingleNode("/pkg:Package/pkg:Capabilities/rescap:Capability[@Name='packageManagement']", $nsmgr) $xmlDoc.Package.Capabilities.RemoveChild($pm) + $xmlDoc.Save($PackageManifestPath) - Get-ChildItem "$WorkingDir\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process ` + Get-ChildItem $WorkingDir -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach-Object -Process ` { ` - (Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Release" }) | ` Set-Content $_ -NoNewline ` } } -$xmlDoc.Save("$PackageManifestPath") - -Get-ChildItem "$WorkingDir\src" -Include *.cs -recurse | ForEach-Object -Process ` +Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process ` { ` (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "bingmapskey.secret", "$SecretBingMapsKey" }) | ` Set-Content $_ -NoNewline ` } -Get-ChildItem "$WorkingDir\src" -Include *.cs -recurse | ForEach-Object -Process ` +Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process ` { (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "sentry.secret", "$SecretSentry" }) | ` Set-Content $_ -NoNewline ` } -Get-ChildItem "$WorkingDir\src" -Include *.cs -recurse | ForEach-Object -Process ` +Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process ` { ` (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "githubclientid.secret", "$SecretGitHubOAuthClientId" }) | ` Set-Content $_ -NoNewline `