Merge pull request #364 from unoplatform/dev/jela/disable-pwa #838
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - release/*/* | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| branches: | |
| - main | |
| - release/*/* | |
| env: | |
| UnoCheck_Version: '1.28.3' | |
| DOTNET_INSTALL_DIR: ${{ github.workspace }}/.dotnet | |
| DOTNET_ROOT: ${{ github.workspace }}/.dotnet | |
| DOTNET_MULTILEVEL_LOOKUP: '0' | |
| jobs: | |
| build_tool: | |
| name: Build | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.100 | |
| - uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2 | |
| id: nbgv | |
| with: | |
| toolVersion: 3.6.139 | |
| setAllVars: true | |
| - name: Adjust msbuild task name | |
| run: | | |
| cd src | |
| gci -r -File -Include *.cs,*.targets,*.props,*.csproj | foreach-object { $a = $_.fullname; ( get-content $a ) | foreach-object { $_ -replace "v0","${{ steps.nbgv.outputs.GitCommitId }}" } | set-content $a } | |
| - run: | | |
| & dotnet tool update --global uno.check --version ${{ env.UnoCheck_Version }} --add-source https://api.nuget.org/v3/index.json | |
| & uno-check -v --ci --non-interactive --fix --skip xcode --skip androidemulator --skip gtk3 --skip vswin --skip vsmac | |
| name: Install .NET Workloads | |
| - name: Build - CI | |
| run: | | |
| $adjustedPackageVersion="${{ steps.nbgv.outputs.SemVer2 }}".ToLower(); | |
| dotnet pack -c Release -p:PackageVersion=$adjustedPackageVersion -p:Version=${{ steps.nbgv.outputs.SimpleVersion }} -o .\artifacts src/Resizetizer/src/Resizetizer.csproj /bl:.\artifacts-logs\pack.binlog | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: .\artifacts | |
| - name: Upload Logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: logs | |
| path: .\artifacts-logs | |
| - name: Run UnitTests | |
| run: | | |
| dotnet test src/Resizetizer/test/UnitTests/Resizetizer.UnitTests.csproj -c Release -p:PackageVersion=$adjustedPackageVersion -p:Version=${{ steps.nbgv.outputs.SimpleVersion }} --logger GitHubActions --blame-crash --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
| validation_5_6_nix: | |
| name: Validate 5.6 | |
| needs: build_tool | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-15] | |
| config: [Debug, Release] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: samples/packages | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.100 | |
| - run: | | |
| ubuntu_release=`lsb_release -rs` | |
| wget https://packages.microsoft.com/config/ubuntu/${ubuntu_release}/packages-microsoft-prod.deb -O packages-microsoft-prod.deb | |
| sudo dpkg -i packages-microsoft-prod.deb | |
| sudo apt-get install apt-transport-https | |
| sudo apt-get update | |
| sudo apt-get install -y msopenjdk-11 | |
| sudo update-alternatives --list java | |
| echo "JAVA_HOME=/usr/lib/jvm/msopenjdk-11-amd64" >> "$GITHUB_ENV" | |
| if: runner.os == 'Linux' | |
| name: Install OpenJDK 11 | |
| - run: | | |
| & dotnet tool update --global uno.check --version ${{ env.UnoCheck_Version }} --add-source https://api.nuget.org/v3/index.json | |
| & uno-check -v --ci --non-interactive --fix --skip xcode --skip androidemulator --skip gtk3 --skip vswin --skip vsmac | |
| shell: pwsh | |
| name: Install .NET Workloads | |
| - name: Restore 5.6 Sample App (${{ matrix.config }}) | |
| shell: pwsh | |
| run: | | |
| cd samples/5.6/Uno52ResizetizerTests | |
| & dotnet restore | |
| - name: Delete nupkg files | |
| run: | | |
| Remove-Item -Recurse -Path $env:USERPROFILE\.nuget\packages\*.nupkg -Force | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| - name: Delete nupkg files | |
| run: | | |
| Remove-Item -Recurse -Path $env:HOME\.nuget\packages\*.nupkg -Force | |
| if: runner.os != 'Windows' | |
| shell: pwsh | |
| - name: Validate 5.6 Samples app (${{ matrix.config }}) | |
| shell: pwsh | |
| # Skip the macOS release build, the agent does not have | |
| # enough disk space to handle it. | |
| if: matrix.os == 'macos-latest' && matrix.config != 'Release' | |
| run: | | |
| & dotnet build -c ${{ matrix.config }} -p:RunAOTCompilation=false -p:WasmShellILLinkerEnabled=false /p:WindowsAppSDKSelfContained=false /p:WindowsPackageType=None -bl:./logs/sample-5.6-${{ matrix.config }}.binlog samples/5.6/Uno52ResizetizerTests/Uno52ResizetizerTests.sln | |
| - name: Validate PWA disabled (WasmPWAManifestFile stays empty) | |
| shell: pwsh | |
| if: matrix.os != 'macos-latest' || matrix.config != 'Release' | |
| run: | | |
| & dotnet build -c ${{ matrix.config }} -p:TargetFramework=net9.0-browserwasm -p:WasmPWAManifestFile= -p:_ValidateNoPwa=true -p:RunAOTCompilation=false -p:WasmShellILLinkerEnabled=false -bl:./logs/sample-5.6-${{ matrix.config }}-pwa-disabled.binlog samples/5.6/Uno52ResizetizerTests/Uno52ResizetizerTests/Uno52ResizetizerTests.csproj | |
| - name: Validate 5.6 Samples app (${{ matrix.config }} Incremental) | |
| # Skip the macOS release build, the agent does not have | |
| # enough disk space to handle it. | |
| if: matrix.os == 'macos-latest' && matrix.config != 'Release' | |
| shell: pwsh | |
| run: | | |
| & dotnet build -c ${{ matrix.config }} /p:RunAOTCompilation=false /p:WasmShellILLinkerEnabled=false /p:WindowsAppSDKSelfContained=false /p:WindowsPackageType=None /bl:.\logs\sample-5.6-${{ matrix.config }}-incremental.binlog samples\5.6\Uno52ResizetizerTests\Uno52ResizetizerTests.sln | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: logs_5_6_${{ matrix.config }}_${{ matrix.os }} | |
| path: .\logs | |
| validation_5_6_win: | |
| name: Validate 5.6 Samples (msbuild) | |
| needs: build_tool | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.100 | |
| - run: | | |
| & dotnet tool update --global uno.check --version ${{ env.UnoCheck_Version }} --add-source https://api.nuget.org/v3/index.json | |
| & uno-check -v --ci --non-interactive --fix --skip xcode --skip androidemulator --skip gtk3 --skip vswin --skip vsmac | |
| shell: pwsh | |
| name: Install .NET Workloads | |
| - name: Download Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: samples/packages | |
| - name: Validate 5.6 Sample app (Debug - DesignTimeBuild) | |
| run: | | |
| $installationPath = vswhere -latest -property installationPath | |
| $designTimeTarget = Join-Path $installationPath -ChildPath "\MSBuild\Microsoft\VisualStudio\Managed\Microsoft.CSharp.DesignTime.targets" | |
| $sampleSolution = 'samples\5.6\Uno52ResizetizerTests\Uno52ResizetizerTests.sln' | |
| $msbuild = vswhere -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe | |
| dotnet restore $sampleSolution | |
| & $msbuild $sampleSolution /p:TargetFramework=net9.0-android /p:AfterMicrosoftNETSdkTargets=$designTimeTarget /p:Configuration=Debug /p:DesignTimeBuild=true /p:DefineExplicitDefaults=true /p:ProvideCommandLineArgs=true /p:ResolveAssemblyReferencesSilent=false /p:SkipCompilerExecution=true /p:ContinueOnError=ErrorAndContinue /p:DesignTimeSilentResolution=false /t:ResolveFrameworkReferencesDesignTime /t:ResolveProjectReferencesDesignTime2 /t:CollectResolvedSDKReferencesDesignTime /t:CollectPackageReferences /t:ResolveComReferencesDesignTime /t:BuiltProjectOutputGroup /t:CollectFrameworkReferences /t:CollectUpToDateCheckBuiltDesignTime /t:CollectPackageDownloads /t:CollectBuildAccelerationIncompatiblePackageDesignTime /t:ResolveAssemblyReferencesDesignTime /t:GenerateSupportedTargetFrameworkAlias /t:CollectAnalyzersDesignTime /t:CollectUpToDateCheckInputDesignTime /t:CollectUpToDateCheckOutputDesignTime /t:ResolvePackageDependenciesDesignTime /t:CollectCentralPackageVersions /t:CollectCopyToOutputDirectoryItemDesignTime /t:CollectResolvedCompilationReferencesDesignTime | |
| & $msbuild $sampleSolution /p:TargetFramework=net9.0-android /p:Configuration=Debug /p:AndroidInstallAfterBuild=False /p:BuildingInsideVisualStudio=true /p:UseHostCompilerIfAvailable=false /p:DefineExplicitDefaults=true /p:RunConfiguration=Default /t:GetAndroidDependencies | |
| & $msbuild $sampleSolution /p:TargetFramework=net9.0-android /p:AfterMicrosoftNETSdkTargets=$designTimeTarget /p:Configuration=Debug /p:DesignTimeBuild=true /p:BuildingInsideVisualStudio=true /p:DefineExplicitDefaults=true /p:ProvideCommandLineArgs=true /p:ResolveAssemblyReferencesSilent=false /p:SkipCompilerExecution=true /p:ContinueOnError=ErrorAndContinue /p:DesignTimeSilentResolution=false /t:ResolveFrameworkReferencesDesignTime /t:ResolveProjectReferencesDesignTime2 /t:CollectResolvedSDKReferencesDesignTime /t:CollectPackageReferences /t:ResolveComReferencesDesignTime /t:BuiltProjectOutputGroup /t:CollectFrameworkReferences /t:CollectUpToDateCheckBuiltDesignTime /t:CollectPackageDownloads /t:CollectBuildAccelerationIncompatiblePackageDesignTime /t:ResolveAssemblyReferencesDesignTime /t:GenerateSupportedTargetFrameworkAlias /t:CollectAnalyzersDesignTime /t:CollectUpToDateCheckInputDesignTime /t:CollectUpToDateCheckOutputDesignTime /t:ResolvePackageDependenciesDesignTime /t:CollectSuggestedWorkloads /t:CollectCentralPackageVersions /t:CompileDesignTime /t:CollectCopyToOutputDirectoryItemDesignTime /t:CollectResolvedCompilationReferencesDesignTime | |
| & $msbuild $sampleSolution /p:TargetFramework=net9.0-android /p:AfterMicrosoftNETSdkTargets=$designTimeTarget /p:Configuration=Debug /p:DesignTimeBuild=true /p:BuildingInsideVisualStudio=true /p:DefineExplicitDefaults=true /p:ProvideCommandLineArgs=true /p:ResolveAssemblyReferencesSilent=false /p:SkipCompilerExecution=true /p:ContinueOnError=ErrorAndContinue /p:DesignTimeSilentResolution=false /t:ResolveFrameworkReferencesDesignTime /t:ResolveProjectReferencesDesignTime2 /t:CollectResolvedSDKReferencesDesignTime /t:CollectPackageReferences /t:ResolveComReferencesDesignTime /t:BuiltProjectOutputGroup /t:CollectFrameworkReferences /t:CollectUpToDateCheckBuiltDesignTime /t:CollectPackageDownloads /t:CollectBuildAccelerationIncompatiblePackageDesignTime /t:ResolveAssemblyReferencesDesignTime /t:GenerateSupportedTargetFrameworkAlias /t:CollectAnalyzersDesignTime /t:CollectUpToDateCheckInputDesignTime /t:CollectUpToDateCheckOutputDesignTime /t:ResolvePackageDependenciesDesignTime /t:CollectSuggestedWorkloads /t:CollectCentralPackageVersions /t:CompileDesignTime /t:CollectCopyToOutputDirectoryItemDesignTime /t:CollectResolvedCompilationReferencesDesignTime | |
| & $msbuild $sampleSolution /p:TargetFramework=net9.0-android /p:AfterMicrosoftNETSdkTargets=$designTimeTarget /p:Configuration=Debug /p:DesignTimeBuild=true /p:BuildingInsideVisualStudio=true /p:DefineExplicitDefaults=true /p:ProvideCommandLineArgs=true /p:ResolveAssemblyReferencesSilent=false /p:SkipCompilerExecution=true /p:ContinueOnError=ErrorAndContinue /p:DesignTimeSilentResolution=false /t:ResolveFrameworkReferencesDesignTime /t:ResolveProjectReferencesDesignTime2 /t:CollectResolvedSDKReferencesDesignTime /t:CollectPackageReferences /t:ResolveComReferencesDesignTime /t:BuiltProjectOutputGroup /t:CollectFrameworkReferences /t:CollectUpToDateCheckBuiltDesignTime /t:CollectPackageDownloads /t:CollectBuildAccelerationIncompatiblePackageDesignTime /t:ResolveAssemblyReferencesDesignTime /t:GenerateSupportedTargetFrameworkAlias /t:CollectAnalyzersDesignTime /t:CollectUpToDateCheckInputDesignTime /t:CollectUpToDateCheckOutputDesignTime /t:ResolvePackageDependenciesDesignTime /t:CollectSuggestedWorkloads /t:CollectCentralPackageVersions /t:CompileDesignTime /t:CollectCopyToOutputDirectoryItemDesignTime /t:CollectResolvedCompilationReferencesDesignTime | |
| & $msbuild $sampleSolution /p:TargetFramework=net9.0-android /p:Configuration=Debug /p:AndroidInstallAfterBuild=False /p:BuildingInsideVisualStudio=true /p:DefineExplicitDefaults=true /p:RunConfiguration=Default /t:GetAndroidDependencies | |
| & $msbuild $sampleSolution /p:TargetFramework= /p:Configuration=Debug /p:AndroidInstallAfterBuild=False /p:BuildingInsideVisualStudio=true /p:UseHostCompilerIfAvailable=false /p:DefineExplicitDefaults=true /p:RunConfiguration=Default /t:rebuild | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: logs_5_6 | |
| path: .\logs | |
| # This step is only used to add a required check for the PR | |
| Validation_Check: | |
| name: Validation Check | |
| runs-on: windows-latest | |
| needs: | |
| - build_tool | |
| - validation_5_6_win | |
| - validation_5_6_nix | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| sign: | |
| name: Sign | |
| if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }} | |
| runs-on: windows-latest | |
| environment: PackageSign | |
| permissions: | |
| id-token: write # Required for requesting the JWT | |
| needs: | |
| - build_tool | |
| - validation_5_6_win | |
| - validation_5_6_nix | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: artifacts | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| # Install the code signing tool | |
| - name: Install Sign CLI tool | |
| run: dotnet tool install --tool-path . sign --version 0.9.1-beta.25278.1 | |
| # Login to Azure using a ServicePrincipal configured to authenticate against a GitHub Action | |
| - name: 'Az CLI login' | |
| uses: azure/login@v1 | |
| with: | |
| allow-no-subscriptions: true | |
| client-id: ${{ secrets.SIGN_AZURE_CLIENT_ID }} | |
| tenant-id: ${{ secrets.SIGN_AZURE_TENANT_ID }} | |
| subscription-id: ${{ secrets.SIGN_AZURE_SUBSCRIPTION_ID }} | |
| # Run the signing command | |
| - name: Sign artifacts | |
| shell: pwsh | |
| run: > | |
| ./sign code azure-key-vault | |
| artifacts/**/*.nupkg | |
| --publisher-name "Uno.Resizetizer" | |
| --description "Uno.Resizetizer" | |
| --description-url "https://github.com/${{ env.GITHUB_REPOSITORY }}" | |
| --azure-key-vault-managed-identity true | |
| --azure-key-vault-url "${{ secrets.SIGN_KEY_VAULT_URL }}" | |
| --azure-key-vault-certificate "${{ secrets.SIGN_KEY_VAULT_CERTIFICATE_ID }}" | |
| --verbosity information | |
| - name: Upload Signed Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NuGet-Signed | |
| path: .\artifacts | |
| # Publish dev packages to uno feed and nuget.org | |
| publish_dev: | |
| name: Publish Dev | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| runs-on: ubuntu-latest | |
| needs: sign | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: "Uno Feed Publish" | |
| uses: ./.github/actions/nuget-uno-publish | |
| with: | |
| token: ${{ secrets.UNO_NUGET_FEED_API_KEY }} | |
| - name: "nuget.org Publish" | |
| uses: ./.github/actions/nuget-org-publish | |
| with: | |
| token: ${{ secrets.NUGET_ORG_API_KEY }} | |
| # Publish release packages to uno feed | |
| publish_release_uno: | |
| name: Publish Internal Feed | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/') }} | |
| runs-on: ubuntu-latest | |
| environment: Stable | |
| needs: sign | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: "Uno Feed Publish" | |
| uses: ./.github/actions/nuget-uno-publish | |
| with: | |
| token: ${{ secrets.UNO_NUGET_FEED_API_KEY }} | |
| # Publish release packages to nuget.org | |
| publish_release_nuget_org: | |
| name: Publish Production | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/') }} | |
| runs-on: ubuntu-latest | |
| environment: Stable | |
| needs: publish_release_uno | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: "Uno Feed Publish" | |
| uses: ./.github/actions/nuget-uno-publish | |
| with: | |
| token: ${{ secrets.NUGET_ORG_API_KEY }} | |
| - name: "Tag Release" | |
| uses: ./.github/actions/tag-release |