diff --git a/.github/scripts/Configure-AppxManifest.ps1 b/.github/scripts/Configure-AppxManifest.ps1 index 055a3dfb0fd2..e0201db35ab4 100644 --- a/.github/scripts/Configure-AppxManifest.ps1 +++ b/.github/scripts/Configure-AppxManifest.ps1 @@ -67,20 +67,15 @@ elseif ($Branch -eq "Store") } } +# Replace the placeholders with the actual values 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 -Include *.cs -recurse | ForEach-Object -Process ` -{ (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "sentry.secret", "$SecretSentry" }) | ` Set-Content $_ -NoNewline ` -} -Get-ChildItem $WorkingDir -Include *.cs -recurse | ForEach-Object -Process ` -{ ` (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "githubclientid.secret", "$SecretGitHubOAuthClientId" }) | ` Set-Content $_ -NoNewline ` } diff --git a/.github/workflows/cd-preview.yml b/.github/workflows/cd-preview.yml index 961941c197f8..f3ea6ee5673c 100644 --- a/.github/workflows/cd-preview.yml +++ b/.github/workflows/cd-preview.yml @@ -33,10 +33,8 @@ jobs: WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\ 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' - TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App (Package)\Files.Package.wapproj' + PACKAGE_MANIFEST_PATH: '${{ github.workspace }}\src\Files.App (Package)\Package.appxmanifest' APP_INSTALLER_SIDELOAD_URL: 'https://cdn.files.community/files/preview/' steps: @@ -52,7 +50,6 @@ jobs: global-json-file: global.json - name: Configure the package manifest, logo, and secrets - shell: pwsh run: | . './.github/scripts/Configure-AppxManifest.ps1' ` -Branch "$env:CONFIGURATION" ` @@ -68,17 +65,10 @@ jobs: SECRET_SENTRY: ${{ secrets.SENTRY_SECRET }} SECRET_GITHUB_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }} - - name: Use Windows SDK Preview - shell: cmd - run: | - for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt - - name: Restore NuGet - shell: pwsh run: 'nuget restore $env:SOLUTION_NAME' - name: Restore Files - shell: pwsh run: | msbuild $env:SOLUTION_NAME ` -t:Restore ` @@ -87,7 +77,6 @@ jobs: -p:PublishReadyToRun=true - name: Build & package Files - shell: pwsh run: | msbuild "$env:PACKAGE_PROJECT_PATH" ` -t:Build ` @@ -135,15 +124,10 @@ jobs: with: creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Upload to Azure blob storage - uses: azure/powershell@v2 - with: - inlineScript: | - az storage blob upload-batch --account-name "filescommunity" --destination "files" --destination-path "preview" --source ${{ env.APPX_PACKAGE_DIR }} --overwrite true - azPSVersion: "latest" - - - name: Logout from Azure - run: 'az logout' + - name: Upload to Azure blob storage & logout from Azure + run: | + az storage blob upload-batch --account-name "filescommunity" --destination "files" --destination-path "preview" --source ${{ env.APPX_PACKAGE_DIR }} --overwrite true + az logout' - name: Upload the packages to GitHub Actions uses: actions/upload-artifact@v4 diff --git a/.github/workflows/cd-stable.yml b/.github/workflows/cd-stable.yml index be39a2707299..6a806e37e0b4 100644 --- a/.github/workflows/cd-stable.yml +++ b/.github/workflows/cd-stable.yml @@ -33,10 +33,9 @@ jobs: WORKING_DIR: '${{ github.workspace }}' # D:\a\Files\Files\ 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' - TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\Files.App (Package)' + PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App (Package)\Files.Package.wapproj' + PACKAGE_MANIFEST_PATH: '${{ github.workspace }}\src\Files.App (Package)\Package.appxmanifest' APP_INSTALLER_SIDELOAD_URL: 'https://cdn.files.community/files/stable/' steps: @@ -68,17 +67,10 @@ jobs: SECRET_SENTRY: ${{ secrets.SENTRY_SECRET }} SECRET_GITHUB_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }} - - name: Use Windows SDK Preview - shell: cmd - run: | - for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt - - name: Restore NuGet - shell: pwsh run: 'nuget restore $env:SOLUTION_NAME' - name: Restore Files - shell: pwsh run: | msbuild $env:SOLUTION_NAME ` -t:Restore ` @@ -87,7 +79,6 @@ jobs: -p:PublishReadyToRun=true - name: Build & package Files - shell: pwsh run: | msbuild "$env:PACKAGE_PROJECT_PATH" ` -t:Build ` @@ -135,15 +126,10 @@ jobs: with: creds: ${{ secrets.AZURE_CREDENTIALS }} - - name: Upload to Azure blob storage - uses: azure/powershell@v2 - with: - inlineScript: | - az storage blob upload-batch --account-name "filescommunity" --destination "files" --destination-path "stable" --source ${{ env.APPX_PACKAGE_DIR }} --overwrite true - azPSVersion: "latest" - - - name: Logout from Azure - run: 'az logout' + - name: Upload to Azure blob storage & logout from Azure + run: | + az storage blob upload-batch --account-name "filescommunity" --destination "files" --destination-path "stable" --source ${{ env.APPX_PACKAGE_DIR }} --overwrite true + az logout - name: Upload the packages to GitHub Actions uses: actions/upload-artifact@v4 diff --git a/.github/workflows/cd-store.yml b/.github/workflows/cd-store.yml index 86dafb0b2720..60f5f42f0453 100644 --- a/.github/workflows/cd-store.yml +++ b/.github/workflows/cd-store.yml @@ -65,17 +65,10 @@ jobs: SECRET_SENTRY: ${{ secrets.SENTRY_SECRET }} SECRET_GITHUB_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }} - - name: Use Windows SDK Preview - shell: cmd - run: | - for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt - - name: Restore NuGet - shell: pwsh run: 'nuget restore $env:SOLUTION_NAME' - name: Restore Files - shell: pwsh run: | msbuild $env:SOLUTION_NAME ` -t:Restore ` @@ -84,7 +77,6 @@ jobs: -p:PublishReadyToRun=true - name: Build & package Files - shell: pwsh run: | msbuild "$env:PACKAGE_PROJECT_PATH" ` -t:Build ` diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b26344bbdd6..2a0e1e036c88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,19 +29,19 @@ run-name: ${{ github.event_name == 'pull_request' && 'Files PR Validation' || 'F env: WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' - SOLUTION_PATH: '${{ github.workspace }}\Files.sln' - PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\Files.App (Package)' - PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App (Package)\Files.Package.wapproj' - AUTOMATED_TESTS_ARCHITECTURE: 'x64' + SOLUTION_PATH: '${{ github.workspace }}\Files.sln' + PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\Files.App (Package)' + PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App (Package)\Files.Package.wapproj' + AUTOMATED_TESTS_ARCHITECTURE: 'x64' AUTOMATED_TESTS_CONFIGURATION: 'Release' - AUTOMATED_TESTS_PROJECT_DIR: '${{ github.workspace }}\tests\Files.InteractionTests' - AUTOMATED_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj' - AUTOMATED_TESTS_ASSEMBLY_DIR: '${{ github.workspace }}\artifacts\TestsAssembly' - ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts' - APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages' - APPX_SELFSIGNED_CERT_PATH: '${{ github.workspace }}\.github\workflows\FilesApp_SelfSigned.pfx' - WINAPPDRIVER_EXE86_PATH: 'C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe' - WINAPPDRIVER_EXE64_PATH: 'C:\Program Files\Windows Application Driver\WinAppDriver.exe' + AUTOMATED_TESTS_PROJECT_DIR: '${{ github.workspace }}\tests\Files.InteractionTests' + AUTOMATED_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj' + AUTOMATED_TESTS_ASSEMBLY_DIR: '${{ github.workspace }}\artifacts\TestsAssembly' + ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts' + APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages' + APPX_SELFSIGNED_CERT_PATH: '${{ github.workspace }}\.github\workflows\FilesApp_SelfSigned.pfx' + WINAPPDRIVER_EXE86_PATH: 'C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe' + WINAPPDRIVER_EXE64_PATH: 'C:\Program Files\Windows Application Driver\WinAppDriver.exe' jobs: @@ -109,11 +109,9 @@ jobs: global-json-file: global.json - name: Restore NuGet - shell: pwsh run: 'nuget restore $env:SOLUTION_PATH' - name: Restore Files - shell: pwsh run: | msbuild $env:SOLUTION_PATH ` -t:Restore ` @@ -166,7 +164,6 @@ jobs: - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION name: Copy tests bin to the artifacts dir - shell: pwsh run: | Copy-Item ` -Path "$env:AUTOMATED_TESTS_PROJECT_DIR\bin" ` @@ -228,7 +225,6 @@ jobs: run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - name: Start WinAppDriver process - shell: pwsh run: Start-Process -FilePath "$env:WINAPPDRIVER_EXE86_PATH" # Retry integration tests if first attempt fails