CI #2096
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/** | |
| schedule: | |
| - cron: '0 0 * * *' # every day at midnight | |
| concurrency: | |
| group: ${{github.workflow}} - ${{github.ref}} | |
| cancel-in-progress: true | |
| jobs: | |
| build_tool: | |
| name: Build | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET Core v6 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: '8.0.100' | |
| - uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2 | |
| id: nbgv | |
| with: | |
| toolVersion: 3.6.139 | |
| setAllVars: true | |
| - 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 UnoCheck\UnoCheck.csproj | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: .\artifacts | |
| - name: Add NuGet Summary | |
| shell: pwsh | |
| run: | | |
| echo "### NuGet Package Summary" >> $env:GITHUB_STEP_SUMMARY | |
| echo "Package version: ${{ steps.nbgv.outputs.SemVer2 }}" >> $env:GITHUB_STEP_SUMMARY | |
| run_tests: | |
| name: Run Unit Tests | |
| needs: build_tool | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: '8.0.100' | |
| - name: Run Tests | |
| run: | | |
| dotnet test UnoCheck.Tests/UnoCheck.Tests.csproj --configuration Release --verbosity normal | |
| testwin: | |
| name: Validate Tool - Windows - ${{ matrix.manifest_name }} | |
| needs: build_tool | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - manifest: 'manifests\uno.ui.manifest.json' | |
| manifest_name: Stable | |
| tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32' | |
| - manifest: 'manifests\uno.ui-preview.manifest.json' | |
| manifest_name: Preview | |
| tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32' | |
| - manifest: 'manifests\uno.ui-preview-major.manifest.json' | |
| manifest_name: Preview Major | |
| tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32' | |
| - manifest: 'manifests\uno.ui.manifest.json' | |
| manifest_name: Stable Upgrade | |
| previous_tool_version: 1.4.2 | |
| previous_tool_params: '' | |
| tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32' | |
| - manifest: 'manifests\uno.ui-preview.manifest.json' | |
| manifest_name: Preview Upgrade | |
| previous_tool_version: 1.4.2 | |
| previous_tool_params: '--pre' | |
| tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32' | |
| - manifest: 'manifests\uno.ui-preview-major.manifest.json' | |
| manifest_name: Preview Upgrade Major | |
| previous_tool_version: 1.4.2 | |
| previous_tool_params: '--pre' | |
| tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32' | |
| - manifest: 'manifests\uno.ui.manifest.json' | |
| manifest_name: Test default Uno template TFMs | |
| tool_params: '--tfm net9.0-android --tfm net9.0-ios --tfm net9.0-maccatalyst --tfm net9.0-windows10.0.19041 --tfm net9.0-browserwasm --tfm net9.0-desktop' | |
| - manifest: 'manifests\uno.ui.manifest.json' | |
| manifest_name: Test net9.0-android\ios TFMs | |
| tool_params: '--tfm net9.0-android --tfm net9.0-ios' | |
| - manifest: 'manifests\uno.ui.manifest.json' | |
| manifest_name: Test net9.0-browserwasm TFM | |
| tool_params: '--tfm net9.0-browserwasm' | |
| - manifest: 'manifests\uno.ui.manifest.json' | |
| manifest_name: Test unoSdkVersion | |
| tool_params: '--unoSdkVersion 5.6.19' | |
| - manifest: 'manifests\uno.ui-preview.manifest.json' | |
| manifest_name: Test default Uno template TFMs with net9 | |
| tool_params: '--tfm net9.0-android --tfm net9.0-ios --tfm net9.0-maccatalyst --tfm net9.0-windows10.0.19041 --tfm net9.0-browserwasm --tfm net9.0-desktop' | |
| - manifest: 'manifests\uno.ui-preview.manifest.json' | |
| manifest_name: Test net9.0-android\ios TFMs | |
| tool_params: '--tfm net9.0-android --tfm net9.0-ios' | |
| - manifest: 'manifests\uno.ui-preview.manifest.json' | |
| manifest_name: Test net9.0-browserwasm TFM | |
| tool_params: '--tfm net9.0-browserwasm' | |
| - manifest: 'manifests\uno.ui-preview.manifest.json' | |
| manifest_name: Test net9.0-tvos TFM | |
| tool_params: '--tfm net9.0-tvos' | |
| - manifest: 'manifests\uno.ui-preview-major.manifest.json' | |
| manifest_name: Test default Uno template TFMs with net10 | |
| tool_params: '--tfm net10.0-android --tfm net10.0-ios --tfm net10.0-maccatalyst --tfm net10.0-windows10.0.19041 --tfm net10.0-browserwasm --tfm net10.0-desktop' | |
| - manifest: 'manifests\uno.ui-preview-major.manifest.json' | |
| manifest_name: Test net10.0-android\ios TFMs | |
| tool_params: '--tfm net10.0-android --tfm net10.0-ios' | |
| - manifest: 'manifests\uno.ui-preview-major.manifest.json' | |
| manifest_name: Test net10.0-browserwasm TFM | |
| tool_params: '--tfm net10.0-browserwasm' | |
| - manifest: 'manifests\uno.ui-preview-major.manifest.json' | |
| manifest_name: Test net10.0-tvos TFM | |
| tool_params: '--tfm net10.0-tvos' | |
| env: | |
| DOTNET_INSTALL_DIR: '${{ github.workspace }}\.dotnet' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: ${{ github.workspace }}\NuGet | |
| - name: Install base .NET SDK | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 8.0.100 | |
| - uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2 | |
| id: nbgv | |
| with: | |
| toolVersion: 3.6.139 | |
| setAllVars: true | |
| - name: Install and Run Previous Tool | |
| if: ${{ contains(matrix.previous_tool_version, '.') }} | |
| shell: pwsh | |
| run: | | |
| Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}" | |
| $ProgressPreference = 'SilentlyContinue' | |
| & dotnet --list-sdks | |
| & dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check | |
| & uno-check --ci --fix --non-interactive --verbose --target webassembly --target ios --target android --target macos --target linux --target win32 --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }} | |
| & dotnet tool uninstall --global uno.check | |
| - name: Install and Run Tool | |
| shell: pwsh | |
| run: | | |
| Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}" | |
| $ProgressPreference = 'SilentlyContinue' | |
| & dotnet --list-sdks | |
| & dotnet tool install --global --version ${{ steps.nbgv.outputs.SemVer2 }} --add-source NuGet\ uno.check | |
| & uno-check --ci --fix --non-interactive --verbose --manifest ${{ matrix.manifest }} --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.tool_params }} | |
| testmac: | |
| name: Validate Tool - macOS - ${{ matrix.manifest_name }}/${{ matrix.os }} | |
| needs: build_tool | |
| strategy: | |
| matrix: | |
| include: | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Stable | |
| os: macos-14 | |
| dotnet_version: 8.0.300 | |
| - manifest: 'manifests/uno.ui-preview.manifest.json' | |
| manifest_name: Preview | |
| previous_tool_version: '' | |
| previous_tool_params: '' | |
| os: macos-14 | |
| dotnet_version: 8.0.300 | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Stable Upgrade | |
| previous_tool_version: 1.17.0 | |
| previous_tool_params: '' | |
| os: macos-14 | |
| dotnet_version: 8.0.300 | |
| - manifest: 'manifests/uno.ui-preview.manifest.json' | |
| manifest_name: Preview Upgrade | |
| previous_tool_version: 1.17.0 | |
| previous_tool_params: '--pre' | |
| os: macos-14 | |
| dotnet_version: 8.0.300 | |
| - manifest: 'manifests/uno.ui-preview-major.manifest.json' | |
| manifest_name: Preview Major Upgrade | |
| previous_tool_version: 1.17.0 | |
| os: macos-14 | |
| dotnet_version: 8.0.300 | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test default Uno template TFMs | |
| os: macos-14 | |
| dotnet_version: 8.0.300 | |
| tool_params: '--tfm net8.0-android --tfm net8.0-ios --tfm net8.0-maccatalyst --tfm net8.0-windows10.0.19041 --tfm net8.0-browserwasm --tfm net8.0-desktop' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test net8.0-android\ios TFMs | |
| os: macos-14 | |
| dotnet_version: 8.0.300 | |
| tool_params: '--tfm net8.0-android --tfm net8.0-ios' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test net8.0-browserwasm TFM | |
| os: macos-14 | |
| dotnet_version: 8.0.300 | |
| tool_params: '--tfm net8.0-browserwasm' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Stable | |
| os: macos-15 | |
| dotnet_version: 8.0.300 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: ${{ github.workspace }}/NuGet | |
| # Preinstall .NET as it may fail on some build agents | |
| - name: Setup .NET Core ${{ matrix.dotnet_version }} | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: '${{ matrix.dotnet_version }}' | |
| # - name: MANUAL WORKLOAD INSTALL | |
| # shell: pwsh | |
| # run: | | |
| # dotnet workload install android ios maccatalyst maui tvos macos --source https://api.nuget.org/v3/index.json | |
| - uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2 | |
| id: nbgv | |
| with: | |
| toolVersion: 3.6.139 | |
| setAllVars: true | |
| - name: Install and Run Previous Tool | |
| if: ${{ contains(matrix.previous_tool_version, '.') }} | |
| shell: pwsh | |
| run: | | |
| Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}" | |
| $ProgressPreference = 'SilentlyContinue' | |
| & dotnet --list-sdks | |
| & dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check | |
| & uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }} | |
| & dotnet tool uninstall --global uno.check | |
| - name: Install and Run Tool | |
| shell: pwsh | |
| run: | | |
| Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}" | |
| $ProgressPreference = 'SilentlyContinue' | |
| & dotnet --list-sdks | |
| & dotnet tool install --global --version ${{ steps.nbgv.outputs.SemVer2 }} --add-source NuGet/ uno.check | |
| & uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 --manifest ${{ matrix.manifest }} ${{ matrix.tool_params }} | |
| testlinux: | |
| name: Validate Tool - Linux - ${{ matrix.manifest_name }} | |
| needs: build_tool | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Stable | |
| - manifest: 'manifests/uno.ui-preview.manifest.json' | |
| manifest_name: Preview | |
| - manifest: 'manifests/uno.ui-preview-major.manifest.json' | |
| manifest_name: Preview Major | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Stable Upgrade | |
| previous_tool_version: 1.4.2 | |
| previous_tool_params: '' | |
| - manifest: 'manifests/uno.ui-preview.manifest.json' | |
| manifest_name: Preview Upgrade | |
| previous_tool_version: 1.4.2 | |
| previous_tool_params: '--pre' | |
| - manifest: 'manifests/uno.ui-preview-major.manifest.json' | |
| manifest_name: Preview Upgrade Major | |
| previous_tool_version: 1.4.2 | |
| previous_tool_params: '--pre' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test default Uno template TFMs | |
| tool_params: '--tfm net8.0-android --tfm net8.0-ios --tfm net8.0-maccatalyst --tfm net8.0-windows10.0.19041 --tfm net8.0-browserwasm --tfm net8.0-desktop' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test net8.0-android\ios TFMs | |
| tool_params: '--tfm net8.0-android --tfm net8.0-ios' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test net8.0-browserwasm TFM | |
| tool_params: '--tfm net8.0-browserwasm' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test default Uno template TFMs with net9 | |
| tool_params: '--tfm net9.0-android --tfm net9.0-ios --tfm net9.0-maccatalyst --tfm net9.0-windows10.0.19041 --tfm net9.0-browserwasm --tfm net9.0-desktop' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test net9.0-android\ios TFMs | |
| tool_params: '--tfm net9.0-android --tfm net9.0-ios' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test net9.0-browserwasm TFM | |
| tool_params: '--tfm net9.0-browserwasm' | |
| - manifest: 'manifests/uno.ui.manifest.json' | |
| manifest_name: Test net9.0-tvos TFM | |
| tool_params: '--tfm net9.0-tvos' | |
| # preview major | |
| - manifest: 'manifests/uno.ui-preview-major.manifest.json' | |
| manifest_name: Test default Uno template TFMs with net10 | |
| tool_params: '--tfm net10.0-android --tfm net10.0-ios --tfm net10.0-maccatalyst --tfm net10.0-windows10.0.19041 --tfm net10.0-browserwasm --tfm net10.0-desktop' | |
| - manifest: 'manifests/uno.ui-preview-major.manifest.json' | |
| manifest_name: Test net10.0-android\ios TFMs | |
| tool_params: '--tfm net10.0-android --tfm net10.0-ios' | |
| - manifest: 'manifests/uno.ui-preview-major.manifest.json' | |
| manifest_name: Test net10.0-browserwasm TFM | |
| tool_params: '--tfm net10.0-browserwasm' | |
| - manifest: 'manifests/uno.ui-preview-major.manifest.json' | |
| manifest_name: Test net10.0-tvos TFM | |
| tool_params: '--tfm net10.0-tvos' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: ${{ github.workspace }}/NuGet | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: '8.0.100' | |
| - uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2 | |
| id: nbgv | |
| with: | |
| toolVersion: 3.6.139 | |
| setAllVars: true | |
| - uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'microsoft' # See 'Supported distributions' for available options | |
| java-version: '21' | |
| - name: Install and Run Previous Tool | |
| if: ${{ contains(matrix.previous_tool_version, '.') }} | |
| shell: pwsh | |
| run: | | |
| Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}" | |
| $ProgressPreference = 'SilentlyContinue' | |
| & dotnet --list-sdks | |
| & dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check | |
| & uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }} | |
| & dotnet tool uninstall --global uno.check | |
| - name: Install and Run Tool | |
| shell: pwsh | |
| run: | | |
| Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}" | |
| $ProgressPreference = 'SilentlyContinue' | |
| & dotnet tool install --global --version ${{ steps.nbgv.outputs.SemVer2 }} --add-source NuGet/ uno.check | |
| & uno-check --ci --fix --verbose --non-interactive --verbose --manifest ${{ matrix.manifest }} --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.tool_params }} | |
| sign: | |
| name: Sign Package | |
| 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 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet | |
| path: artifacts\NuGet | |
| - name: Setup .NET SDK | |
| uses: actions/setup-dotnet@v1 | |
| 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 agaist 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\NuGet\*.nupkg | |
| --publisher-name "Uno.Check" | |
| --description "Uno.Check" | |
| --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\NuGet | |
| publish_dev: | |
| name: Publish Dev | |
| if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| runs-on: windows-latest | |
| needs: | |
| - sign | |
| steps: | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet-Signed | |
| path: artifacts | |
| - name: NuGet Push | |
| shell: pwsh | |
| run: | | |
| dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k "${{ secrets.NUGET_ORG_API_KEY }}" | |
| publish_prod: | |
| name: Publish Production | |
| if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/') }} | |
| runs-on: windows-latest | |
| environment: Production | |
| needs: | |
| - sign | |
| permissions: | |
| contents: write # allow pushing tags | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: NuGet-Signed | |
| path: artifacts | |
| - name: NuGet Push | |
| shell: pwsh | |
| run: | | |
| dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k "${{ secrets.NUGET_ORG_API_KEY }}" | |
| - name: Tag Release | |
| uses: ./.github/workflows/actions/tag-release |