Skip to content

Bump Microsoft.AspNetCore.Components from 6.0.12 to 6.0.25 in /src/Meziantou.AspNetCore.Components #1704

Bump Microsoft.AspNetCore.Components from 6.0.12 to 6.0.25 in /src/Meziantou.AspNetCore.Components

Bump Microsoft.AspNetCore.Components from 6.0.12 to 6.0.25 in /src/Meziantou.AspNetCore.Components #1704

Workflow file for this run

name: publish
on:
workflow_dispatch:
push:
branches:
- 'main'
pull_request:
branches:
- '*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NuGetDirectory: ${{ github.workspace}}/nuget
NuGetSource: "https://api.nuget.org/v3/index.json"
defaults:
run:
shell: pwsh
jobs:
validate_readme:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core (global.json)
uses: actions/setup-dotnet@v3
- name: Validate Readme
run: .\eng\update-readme.ps1
- name: Validate Tool Readme
run: .\eng\update-tool-readme.ps1
validate_test_projects:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Validate
run: .\eng\validate-testprojects-configuration.ps1
create_nuget:
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core (global.json)
uses: actions/setup-dotnet@v3
- run: dotnet build eng/build.proj --configuration Release /p:IsOfficialBuild=true /bl:build.binlog
- run: dotnet publish src/Meziantou.Framework.InlineSnapshotTesting.Prompt.TaskDialog --configuration Release /p:IsOfficialBuild=true /bl:publish-taskdialog.binlog
- run: dotnet publish src/Meziantou.Framework.InlineSnapshotTesting.Prompt.NotificationTray --configuration Release /p:IsOfficialBuild=true /bl:publish-notificationtray.binlog
- run: dotnet pack eng/build.proj --configuration Release /p:IsOfficialBuild=true --output ${{ env.NuGetDirectory }} /p:RepositoryBranch="${{github.ref}}" /bl:pack.binlog
- uses: actions/upload-artifact@v3
if: always()
with:
name: nuget
if-no-files-found: error
retention-days: 3
path: ${{ env.NuGetDirectory }}/**/*
- uses: actions/upload-artifact@v3
if: always()
with:
name: binlog
if-no-files-found: error
retention-days: 3
path: '**/*.binlog'
validate_nuget:
runs-on: ubuntu-22.04
needs: [ create_nuget ]
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core (global.json)
uses: actions/setup-dotnet@v3
- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.NuGetDirectory }}
- name: Run dotnet validate
run: |
dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global --no-cache --add-source "${{ env.NuGetDirectory }}"
$files = Get-ChildItem "${{ env.NuGetDirectory }}/*" -Include *.nupkg
$Errors = $false
foreach ($file in $files) {
& meziantou.validate-nuget-package "$file" --excluded-rules "ReadmeMustBeSet,TagsMustBeSet" --github-token=${{ secrets.GITHUB_TOKEN }}
if ($LASTEXITCODE -ne 0) {
$Errors = $true
}
}
if ($Errors) {
exit 1
}
build_and_test_x64:
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 30
env:
TestResultsDirectory: ${{ github.workspace}}/TestResults
strategy:
matrix:
runs-on: [ windows-2019, windows-2022, ubuntu-20.04, ubuntu-22.04, macos-11, macos-12, macos-13 ]
configuration: [ Debug, Release ]
additionalArguments: [ "", "/p:InvariantGlobalization=true" ]
architecture: [ x64 ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- run: git config --global protocol.file.allow always
- name: Setup .NET Core (global.json)
uses: actions/setup-dotnet@v3
- name: Setup .NET Core (additional versions)
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
7.0.x
6.0.x
- name: Build
run: dotnet build eng/build.proj --configuration ${{ matrix.configuration }} /bl ${{ matrix.additionalArguments }}
- name: Run tests
run: dotnet test eng/build.proj --configuration ${{ matrix.configuration }} --no-build --logger trx --results-directory "${{ env.TestResultsDirectory }}" --collect:"XPlat Code Coverage" --blame-hang --blame-hang-timeout 5min ${{ matrix.additionalArguments }}
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results-${{ matrix.runs-on }}-${{ matrix.configuration }}-${{ matrix.architecture }}
if-no-files-found: error
retention-days: 3
path: ${{ env.TestResultsDirectory }}/**/*
build_and_test_windows_x86:
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 30
env:
TestResultsDirectory: ${{github.workspace}}/TestResults
Architecture: ${{ matrix.architecture }}
strategy:
matrix:
configuration: [ Debug, Release ]
additionalArguments: [ "", "/p:InvariantGlobalization=true" ]
include:
- runs-on: windows-2019
architecture: x86
- runs-on: windows-2022
architecture: x86
fail-fast: false
steps:
- uses: actions/checkout@v3
- run: git config --global protocol.file.allow always
- name: Build and Run Tests
run: |
echo "::group::Install .NET"
echo "Downloading dotnet-install.ps1 script"
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
echo "Installing .NET 6.0"
./dotnet-install.ps1 -Channel 6.0 -Architecture ${{ matrix.architecture }} -InstallDir ~/dotnet -NoPath
echo "Installing .NET 7.0"
./dotnet-install.ps1 -Channel 7.0 -Architecture ${{ matrix.architecture }} -InstallDir ~/dotnet -NoPath
echo "Installing .NET (global.json)"
./dotnet-install.ps1 -JSonFile ${{github.workspace}}/global.json -Architecture ${{ matrix.architecture }} -InstallDir ~/dotnet
Get-Command dotnet
dotnet --info
echo "::endgroup::"
echo "::group::Build"
dotnet build eng/build.proj --configuration ${{ matrix.configuration }} /bl ${{ matrix.additionalArguments }}
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
echo "::endgroup::"
echo "::group::Run tests"
dotnet test eng/build.proj --configuration "${{ matrix.configuration }}" --no-build --logger trx --results-directory "${{ env.TestResultsDirectory }}" --collect:"XPlat Code Coverage" --blame-hang --blame-hang-timeout 5min ${{ matrix.additionalArguments }}
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
echo "::endgroup::"
- uses: actions/upload-artifact@v3
if: always()
with:
name: test-results-${{ matrix.runs-on }}-${{ matrix.configuration }}-${{ matrix.architecture }}
if-no-files-found: error
retention-days: 3
path: ${{ env.TestResultsDirectory }}/**/*
test_trimming:
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
matrix:
# https://docs.microsoft.com/en-us/dotnet/core/rid-catalog
runtime: [ "win-x64", "win-x86", "linux-x64", "osx-x64" ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core (global.json)
uses: actions/setup-dotnet@v3
- run: dotnet publish --configuration Release --runtime ${{ matrix.runtime }} --self-contained Samples/Trimmable/Trimmable.csproj
test_trimming_wpf:
runs-on: windows-2022
timeout-minutes: 30
strategy:
matrix:
runtime: [ "win-x64", "win-x86" ]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Setup .NET Core (global.json)
uses: actions/setup-dotnet@v3
- run: dotnet publish --configuration Release --runtime ${{ matrix.runtime }} --self-contained Samples/Trimmable.Wpf/Trimmable.Wpf.csproj
deploy:
runs-on: ubuntu-22.04
needs: [ validate_readme, validate_test_projects, validate_nuget, build_and_test_x64, build_and_test_windows_x86, test_trimming, test_trimming_wpf ]
steps:
- uses: actions/download-artifact@v3
with:
name: nuget
path: ${{ env.NuGetDirectory }}
- name: Setup .NET Core (global.json)
uses: actions/setup-dotnet@v3
- run: |
Write-Host "Current ref: $env:GITHUB_REF"
Write-Host "Searching nupkg in folder: ${{ env.NuGetDirectory }}"
$files = Get-ChildItem "${{ env.NuGetDirectory }}/*" -Include *.nupkg
foreach($file in $files) {
Write-Host "Pushing NuGet package: $($file.FullName)"
if ($env:GITHUB_REF -eq 'refs/heads/main')
{
& dotnet nuget push "$($file.FullName)" --api-key "$env:NUGETAPIKEY" --source ${{ env.NuGetSource }} --force-english-output --skip-duplicate
}
else
{
& dotnet nuget push "$($file.FullName)" --api-key "$env:FEEDZ_APIKEY" --source "https://f.feedz.io/meziantou/meziantou-framework/nuget/index.json" --force-english-output --skip-duplicate
}
}
name: Publish NuGet packages
if: always()
env:
NUGETAPIKEY: ${{ secrets.NUGETAPIKEY }}
FEEDZ_APIKEY: ${{ secrets.FEEDZ_APIKEY }}