Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub: Added build CI #13620

Merged
merged 87 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
eea0fb2
GitHub: Preview deploy action
yaira2 Oct 30, 2023
6d050f8
Add build CI
0x5bfa Oct 31, 2023
479f3b5
Update
0x5bfa Oct 31, 2023
a73693d
Update build-dev.yml
0x5bfa Oct 31, 2023
177ac00
Update
0x5bfa Nov 1, 2023
5cf469c
Fix
0x5bfa Nov 1, 2023
4b9cfeb
Update
0x5bfa Nov 1, 2023
bb5689e
Fix
0x5bfa Nov 1, 2023
038248c
Update
0x5bfa Nov 1, 2023
7e52558
Fix
0x5bfa Nov 1, 2023
1476a72
Update
0x5bfa Nov 1, 2023
8ab0a44
Update
0x5bfa Nov 1, 2023
c9d8b7b
Update
0x5bfa Nov 1, 2023
f9a00f5
Update
0x5bfa Nov 1, 2023
73a879a
Update
0x5bfa Nov 1, 2023
2abe1eb
Fix
0x5bfa Nov 1, 2023
182e84d
Update
0x5bfa Nov 1, 2023
2da0d28
Update
0x5bfa Nov 1, 2023
ed0dda7
Update
0x5bfa Nov 1, 2023
e0ad035
Update
0x5bfa Nov 1, 2023
9aac979
Update
0x5bfa Nov 1, 2023
ba86aef
Update
0x5bfa Nov 1, 2023
1b72a15
Update
0x5bfa Nov 1, 2023
e159d2f
Update
0x5bfa Nov 1, 2023
094ba03
Update
0x5bfa Nov 1, 2023
0e9a22b
Update
0x5bfa Nov 1, 2023
7888074
Update
0x5bfa Nov 1, 2023
0599c20
Update actions to start WinAppDriver, add second app id to find app
marcelwgn Nov 2, 2023
7a351d2
Delete builds/azure-pipelines.yml
0x5bfa Nov 2, 2023
bb9ba6e
Update and rename build-app.yml to ci.yml
0x5bfa Nov 2, 2023
3b375e4
Merge branch 'main' into 5bfa/Add-DevCIActions
0x5bfa Nov 3, 2023
190c288
Merge branch 'main' into 5bfa/Add-DevCIActions
0x5bfa Nov 4, 2023
30ef09b
Update .github/workflows/ci.yml
0x5bfa Nov 5, 2023
ff3291e
Update
0x5bfa Nov 5, 2023
f9c8c1d
Update
0x5bfa Nov 5, 2023
4c12684
Update
0x5bfa Nov 5, 2023
3e7222b
Update
0x5bfa Nov 5, 2023
f53d75e
Fix if statement
0x5bfa Nov 5, 2023
81eef00
Update
0x5bfa Nov 5, 2023
f371ff0
Updated
0x5bfa Nov 5, 2023
32a292b
Update
0x5bfa Nov 5, 2023
91bdbd7
Update
0x5bfa Nov 5, 2023
0b4f060
Update
0x5bfa Nov 5, 2023
fe2f5ab
Update
0x5bfa Nov 5, 2023
ed95c75
Update
0x5bfa Nov 5, 2023
98a14b2
Update
0x5bfa Nov 5, 2023
f4a8293
Update
0x5bfa Nov 5, 2023
962c15f
Update ci.yml
0x5bfa Nov 5, 2023
fe74185
Update ci.yml
0x5bfa Nov 6, 2023
2134186
Update
0x5bfa Nov 6, 2023
8dc815d
Update to run WinAppDriver :(
0x5bfa Nov 6, 2023
d6782a3
Update
0x5bfa Nov 6, 2023
64acb6d
Update
0x5bfa Nov 6, 2023
28f1595
Update
0x5bfa Nov 6, 2023
7182f95
Fix
0x5bfa Nov 6, 2023
0b89262
Fix
0x5bfa Nov 6, 2023
468c647
Update
0x5bfa Nov 6, 2023
a296850
Update
0x5bfa Nov 6, 2023
384624f
Update Convert-TrxToMarkdown.ps1
0x5bfa Nov 6, 2023
f92cccb
Update ci.yml
0x5bfa Nov 6, 2023
822fd93
Update
0x5bfa Nov 6, 2023
f28680e
merge
0x5bfa Nov 6, 2023
00cb8f0
Done
0x5bfa Nov 7, 2023
04b0754
Remove annotations
0x5bfa Nov 7, 2023
a8bcb29
Supress warnings
0x5bfa Nov 7, 2023
cb35cbd
Remove annotations 2
0x5bfa Nov 7, 2023
6d627b0
Fix conditional job running
0x5bfa Nov 7, 2023
87494dc
Update
0x5bfa Nov 7, 2023
320d6fe
Fixed tool name
0x5bfa Nov 7, 2023
b675fc8
Update
0x5bfa Nov 7, 2023
a9ed8dc
Fix
0x5bfa Nov 7, 2023
b8e730c
Update
0x5bfa Nov 7, 2023
2405f72
Fix
0x5bfa Nov 7, 2023
69f6003
Update
0x5bfa Nov 7, 2023
10b0f80
Update
0x5bfa Nov 7, 2023
ed3b54e
Switch to self sign script
marcelwgn Nov 7, 2023
a603ea4
Add additional app identity
marcelwgn Nov 7, 2023
53e441c
Delete .github/workflows/check-xaml-formatting.yml
0x5bfa Nov 8, 2023
35b26e9
Update ci.yml
0x5bfa Nov 8, 2023
d5ec8d6
Update
0x5bfa Nov 8, 2023
d2f87ad
Update
0x5bfa Nov 8, 2023
184d1dd
Updated
0x5bfa Nov 8, 2023
8a406d2
Update
0x5bfa Nov 8, 2023
ad1a7b1
Fix
0x5bfa Nov 8, 2023
3684adf
Update SessionManager.cs
0x5bfa Nov 8, 2023
14b45b6
Update SessionManager.cs
0x5bfa Nov 9, 2023
92e632b
Update SessionManager.cs
0x5bfa Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/build-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build Dev Pipeline

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'

jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Debug]
platform: [x64, arm64]
env:
SOLUTION_NAME: 'Files.sln'
PACKAGE_PROJECT_DIR: 'src\Files.App (Package)'
PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj'
TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj'
CONFIGURATION: ${{ matrix.configuration }}
PLATFORM: ${{ matrix.platform }}
WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
uses: NuGet/[email protected]

- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Restore NuGet
shell: pwsh
run: 'nuget restore $env:SOLUTION_NAME'

- name: Restore ${{ env.SOLUTION_NAME }}
shell: pwsh
run: |
msbuild $env:SOLUTION_NAME `
-t:Restore `
-p:Platform=$env:PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-p:PublishReadyToRun=true

- name: Build ${{ env.SOLUTION_NAME }}
shell: pwsh
run: |
msbuild "$env:PACKAGE_PROJECT_PATH" `
-t:Build `
-p:Platform=$env:PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-p:AppxBundle=Never

# TODO: Add tests running
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
155 changes: 155 additions & 0 deletions .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Deploy Preview Pipeline

on:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest
environment: Deployments
strategy:
fail-fast: false
matrix:
configuration: [Preview]
platform: [x64]
env:
SOLUTION_NAME: 'Files.sln'
PACKAGE_PROJECT_DIR: 'src\Files.App (Package)'
PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj'
TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj'
CONFIGURATION: ${{ matrix.configuration }}
PLATFORM: ${{ matrix.platform }}
APPX_BUNDLE_PLATFORMS: 'x64|arm64'
WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\
ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts
APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages

steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
uses: NuGet/[email protected]

- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

# TODO: Move the command to PowerShell script instead
- name: Update Package.appxmanifest
shell: pwsh
run: |
[xml]$xmlDoc = Get-Content "$env:PACKAGE_PROJECT_DIR\Package.appxmanifest"
$xmlDoc.Package.Identity.Name="FilesPreview"
$xmlDoc.Package.Identity.Publisher="$env:SIDELOAD_PUBLISHER_SECRET"
$xmlDoc.Package.Properties.DisplayName="Files - Preview"
$xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview"
$xmlDoc.Save("$env:PACKAGE_PROJECT_DIR\Package.appxmanifest")
env:
SIDELOAD_PUBLISHER_SECRET: ${{ secrets.SIDELOAD_PUBLISHER_SECRET }}

# TODO: Move the command to PowerShell script instead
- name: Use the ${{ env.CONFIGURATION }} logo sets
shell: pwsh
run: |
Get-ChildItem "$env:WORKING_DIR\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process `
{ `
(Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | `
Set-Content $_ -NoNewline `
}

- name: Inject the Bing Maps API token
shell: pwsh
run: |
Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process `
{ `
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "bingmapskey.secret", "$env:BING_MAPS_SECRET" }) | `
Set-Content $_ -NoNewline `
}
env:
BING_MAPS_SECRET: ${{ secrets.BING_MAPS_SECRET }}

- name: Inject the AppCenter token
shell: pwsh
run: |
Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process `
{ `
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "appcenter.secret", "$env:APP_CENTER_SECRET" }) | `
Set-Content $_ -NoNewline `
}
env:
APP_CENTER_SECRET: ${{ secrets.APP_CENTER_SECRET }}

- name: Inject the GitHub OAuth client ID
run: |
Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process `
{ `
(Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "githubclientid.secret", "$env:GH_OAUTH_CLIENT_ID" }) | `
Set-Content $_ -NoNewline `
}
env:
GH_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 ${{ env.SOLUTION_NAME }}
shell: pwsh
run: |
msbuild $env:SOLUTION_NAME `
-t:Restore `
-p:Platform=$env:PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-p:PublishReadyToRun=true

- name: Build ${{ env.SOLUTION_NAME }}
shell: pwsh
run: |
msbuild "$env:PACKAGE_PROJECT_PATH" `
-t:Build `
-t:_GenerateAppxPackage `
-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=Sideload `
-p:GenerateAppInstallerFile=True `
-p:AppInstallerUri=https://cdn.files.community/files/preview/

- name: Remove empty files from the packages
shell: bash
run: find $ARTIFACTS_STAGING_DIR -empty -delete

- name: Sign files with Azure Code Signing
uses: azure/[email protected]
with:
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }}
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }}
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
endpoint: https://wus2.codesigning.azure.net/
code-signing-account-name: ${{ secrets.SIGNING_ACCOUNT_NAME }}
certificate-profile-name: ${{ secrets.SIGNING_PROFILE_NAME }}
files-folder: ${{ env.APPX_PACKAGE_DIR }}
files-folder-filter: msixbundle
files-folder-recurse: true
files-folder-depth: 4
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256

- name: Upload the packages to GitHub Actions
uses: actions/upload-artifact@v3
with:
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})'
path: ${{ env.ARTIFACTS_STAGING_DIR }}
8 changes: 7 additions & 1 deletion builds/azure-pipelines.yml
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
trigger:
- main
branches:
include:
- main
paths:
exclude:
- 'docs/**'
- '*.md'

pool:
vmImage: 'windows-latest'
Expand Down
5 changes: 5 additions & 0 deletions src/Files.App (Package)/Files.Package.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -85,24 +85,29 @@
<Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>

<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
<PathToXAMLWinRTImplementations>Files.App\</PathToXAMLWinRTImplementations>
</PropertyGroup>

<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />

<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<Content Include="Assets\AppTiles\Dev\**" />
<Content Include="Package.appinstaller" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Files.App\Files.App.csproj">
<SkipGetTargetFrameworkProperties>True</SkipGetTargetFrameworkProperties>
<PublishProfile>Properties\PublishProfiles\win10-$(Platform).pubxml</PublishProfile>
</ProjectReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" IncludeAssets="build" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" IncludeAssets="build" />
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Files.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
<Link>NOTICE.md</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Resources\BingMapsKey.txt" />
<Content Include="Resources\PreviewPanePropertiesInformation.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
7 changes: 1 addition & 6 deletions src/Files.App/Helpers/LocationHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Copyright(c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using System.Text.Json;
using Windows.Devices.Geolocation;
using Windows.Services.Maps;
using Windows.Storage;

namespace Files.App.Helpers
{
Expand All @@ -19,10 +17,7 @@ public static async Task<string> GetAddressFromCoordinatesAsync(double? Lat, dou
{
try
{
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(@"ms-appx:///Resources/BingMapsKey.txt"));
var lines = await FileIO.ReadTextAsync(file);
using var obj = JsonDocument.Parse(lines);
MapService.ServiceToken = obj.RootElement.GetProperty("key").GetString();
MapService.ServiceToken = "bingmapskey.secret";
}
catch (Exception)
{
Expand Down
1 change: 0 additions & 1 deletion src/Files.App/Resources/BingMapsKey.txt

This file was deleted.