NR Update MSAL packages (#104) #506
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: NewsReader.CI | |
| on: | |
| push: | |
| paths: | |
| - 'src/*' | |
| - 'src/NewsReader/**' | |
| - 'src/NewsReader.UITest/**' | |
| - '.github/workflows/**' | |
| - '!.github/workflows/System.Waf.CI.yml' | |
| workflow_dispatch: | |
| jobs: | |
| GetVersion: | |
| uses: ./.github/workflows/GetBuildVersion.yml | |
| Android: | |
| runs-on: windows-2025 | |
| needs: GetVersion | |
| steps: | |
| - name: 🔖 Check-out | |
| uses: actions/checkout@v4 | |
| - name: ⚙️ Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9' | |
| - name: ⚙️ Install .NET MAUI | |
| run: dotnet workload install maui-android maui-ios | |
| - name: ⚙️ .NET MAUI Version info | |
| run: dotnet workload list | |
| - name: 📜 Prepare WebStorageService AppId | |
| shell: pwsh | |
| env: | |
| WebStorageServiceKeys64: ${{ secrets.WEB_STORAGE_SERVICE_KEYS64 }} | |
| run: | | |
| [IO.File]::WriteAllBytes((Join-Path $pwd "src/NewsReader/NewsReader.Presentation/Services" "WebStorageService.keys.cs"), [Convert]::FromBase64String($env:WebStorageServiceKeys64)) | |
| - name: 🛠️ Build | |
| run: | | |
| cd src/NewsReader/NewsReader.MauiSystem | |
| dotnet publish -f:net9.0-android -c:Release -p:ApplicationVersion=${{ needs.GetVersion.outputs.versionCode }} -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }} | |
| - name: 📦 Upload AAB, APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NewsReaderAndroid | |
| if-no-files-found: error | |
| path: | | |
| ./**/publish/*Signed.aab | |
| ./**/publish/*Signed.apk | |
| Windows: | |
| runs-on: windows-2025 | |
| needs: GetVersion | |
| steps: | |
| - name: 🔖 Check-out | |
| uses: actions/checkout@v4 | |
| - name: ⚙️ Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9' | |
| - name: ⚙️ Install .NET MAUI | |
| run: dotnet workload install maui-android maui-windows maui-ios | |
| - name: ⚙️ .NET MAUI Version info | |
| run: dotnet workload list | |
| - name: 📜 Prepare WebStorageService AppId | |
| shell: pwsh | |
| env: | |
| WebStorageServiceKeys64: ${{ secrets.WEB_STORAGE_SERVICE_KEYS64 }} | |
| run: | | |
| [IO.File]::WriteAllBytes((Join-Path $pwd "src/NewsReader/NewsReader.Presentation/Services" "WebStorageService.keys.cs"), [Convert]::FromBase64String($env:WebStorageServiceKeys64)) | |
| - name: 📜 Prepare certificate | |
| shell: pwsh | |
| env: | |
| MSStoreLocalCert64: ${{ secrets.MS_STORE_LOCAL_CERT64 }} | |
| run: | | |
| [IO.File]::WriteAllBytes((Join-Path $pwd "src/NewsReader/NewsReader.MauiSystem" "MSStoreLocalCert.p12"), [Convert]::FromBase64String($env:MSStoreLocalCert64)) | |
| - name: 🛠️ Build x64 | |
| # -p:ApplicationVersion=0 because of https://github.com/dotnet/maui/issues/18571 | |
| run: | | |
| cd src/NewsReader/NewsReader.MauiSystem | |
| dotnet publish -f:net9.0-windows10.0.19041.0 -c:Release -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }} -p:ApplicationVersion=0 -p:AppxPackageSigningEnabled=true -p:PackageCertificateKeyFile=MSStoreLocalCert.p12 --self-contained | |
| - name: 🛠️ Build arm64 | |
| run: | | |
| cd src/NewsReader/NewsReader.MauiSystem | |
| dotnet publish -f:net9.0-windows10.0.19041.0 -c:Release -p:RuntimeIdentifierOverride=win10-arm64 -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }} -p:ApplicationVersion=0 -p:AppxPackageSigningEnabled=true -p:PackageCertificateKeyFile=MSStoreLocalCert.p12 --self-contained | |
| - name: 📦 Upload MSIX | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NewsReaderWindows | |
| if-no-files-found: error | |
| path: | | |
| ./**/AppPackages/**/NewsReader*.msix | |
| - name: ⚙️ Install App | |
| shell: pwsh | |
| run: | | |
| $rootFolder = ".\src\NewsReader\NewsReader.MauiSystem\bin\Release\net9.0-windows10.0.19041.0\win10-x64\" | |
| $msixFile = Get-ChildItem -Path $rootFolder -Recurse -Filter *.msix | Select-Object -First 1 | |
| Export-Certificate -Cert (Get-AuthenticodeSignature -FilePath $msixFile).SignerCertificate -FilePath ".\App.cer" | |
| Import-Certificate -FilePath ".\App.cer" -CertStoreLocation "Cert:\LocalMachine\TrustedPeople" | |
| Add-AppxPackage -Path $msixFile | |
| Get-AppxPackage -Name Waf.NewsReader | |
| - name: ⚙️ Install Appium Server | |
| shell: pwsh | |
| run: | | |
| npm install -g appium | |
| appium driver install windows | |
| appium --version | |
| - name: ⚙️ Start Appium Server | |
| shell: bash | |
| run: appium & | |
| - name: 🖥️ UI Test | |
| run: | | |
| echo "## 🕵️ Test Results - NewsReader.UITest.sln" >> $Env:GITHUB_STEP_SUMMARY | |
| dotnet test ./src/NewsReader.UITest/NewsReader.UITest.sln --filter DevicePlatform=Windows --logger GitHubActions | |
| - name: 📦 Upload UI Test results | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: NewsReaderUITestResults | |
| if-no-files-found: ignore | |
| path: | | |
| out/NewsReader.UITest/ | |
| iOS: | |
| runs-on: macos-15 | |
| needs: GetVersion | |
| steps: | |
| - name: 🔖 Check-out | |
| uses: actions/checkout@v4 | |
| - name: ⚙️ Set Xcode version | |
| run: | | |
| XCODE_ROOT=/Applications/Xcode_26.0.1.app | |
| echo "MD_APPLE_SDK_ROOT=$XCODE_ROOT" >> $GITHUB_ENV # set environment variable to specify Xcode for Mono and Xamarin | |
| sudo xcode-select -s $XCODE_ROOT | |
| - name: ⚙️ Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9' | |
| - name: ⚙️ Install .NET MAUI | |
| run: dotnet workload install maui-android maui-ios | |
| - name: 📜 Prepare WebStorageService AppId | |
| shell: pwsh | |
| env: | |
| WebStorageServiceKeys64: ${{ secrets.WEB_STORAGE_SERVICE_KEYS64 }} | |
| run: | | |
| [IO.File]::WriteAllBytes((Join-Path $pwd "src/NewsReader/NewsReader.Presentation/Services" "WebStorageService.keys.cs"), [Convert]::FromBase64String($env:WebStorageServiceKeys64)) | |
| - name: 🛠️ Build | |
| run: | | |
| cd src/NewsReader/NewsReader.MauiSystem | |
| dotnet build -f net9.0-ios -c:Release /p:packageApp=false /p:buildForSimulator=true /p:ArchiveOnBuild=false -p:ApplicationVersion=${{ needs.GetVersion.outputs.version }} -p:ApplicationDisplayVersion=${{ needs.GetVersion.outputs.version }} | |
| Test: | |
| runs-on: windows-2025 | |
| needs: GetVersion | |
| steps: | |
| - name: 🔖 Check-out | |
| uses: actions/checkout@v4 | |
| - name: ⚙️ Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9' | |
| - name: ⚙️ Install .NET MAUI | |
| run: dotnet workload install maui-android maui-ios | |
| - name: 🕵️ Test | |
| run: | | |
| echo "## 🕵️ Test Results" >> $Env:GITHUB_STEP_SUMMARY | |
| dotnet test ./src/NewsReader/NewsReader.sln -c:Release -p:Version=${{ needs.GetVersion.outputs.version }} --logger GitHubActions |