diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml new file mode 100644 index 0000000..8de0080 --- /dev/null +++ b/.github/workflows/ci-main.yml @@ -0,0 +1,92 @@ +name: Build & Test Main + +on: + push: + branches: [ main ] + release: + types: [ published ] + +env: + NETCORE_VERSION: '3.1.301' + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + PROJECT_NAME: Blazored.FluentValidation + GITHUB_FEED: https://nuget.pkg.github.com/Blazored/ + GITHUB_USER: chrissainty + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NUGET_FEED: https://api.nuget.org/v3/index.json + NUGET_KEY: ${{ secrets.NUGET_KEY }} + +jobs: + build: + name: Build, test and pack + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup .NET Core ${{ env.NETCORE_VERSION }} + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.NETCORE_VERSION }} + env: + NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Restore + run: dotnet restore + + - name: Build + run: dotnet build -c Release --no-restore src/$PROJECT_NAME/$PROJECT_NAME.csproj + + - name: Test + run: dotnet test -c Release + + - name: Pack + run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:PackageVersion=$GITHUB_RUN_ID src/$PROJECT_NAME/$PROJECT_NAME.*proj + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: nupkg + path: ./src/${{ env.PROJECT_NAME }}/bin/Release/*.nupkg + prerelease: + needs: build + if: github.event_name != 'release' + runs-on: ubuntu-latest + steps: + - name: Download Artifact + uses: actions/download-artifact@v1 + with: + name: nupkg + - name: Push to GitHub Feed + run: | + for f in ./nupkg/*.nupkg + do + curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED + done + deploy: + needs: build + if: github.event_name == 'release' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup .NET Core + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.NETCORE_VERSION }} + - name: Create Release NuGet package + run: | + arrTag=(${GITHUB_REF//\// }) + VERSION="${arrTag[2]}" + echo Version: $VERSION + VERSION="${VERSION//v}" + echo Clean Version: $VERSION + dotnet pack -v normal -c Release --include-symbols --include-source -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME.*proj + - name: Push to GitHub Feed + run: | + for f in ./nupkg/*.nupkg + do + curl -vX PUT -u "$GITHUB_USER:$GITHUB_TOKEN" -F package=@$f $GITHUB_FEED + done + - name: Push to NuGet Feed + run: dotnet nuget push ./nupkg/*.nupkg --source $NUGET_FEED --skip-duplicate --api-key $NUGET_KEY diff --git a/.github/workflows/ci-pr.yml b/.github/workflows/ci-pr.yml new file mode 100644 index 0000000..d8dadbf --- /dev/null +++ b/.github/workflows/ci-pr.yml @@ -0,0 +1,30 @@ +name: Build & Test PR + +on: + pull_request: + branches: [ main ] + +env: + PROJECT_NAME: Blazored.FluentValidation + NETCORE_VERSION: '3.1.301' + +jobs: + build: + name: Build and test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setting up .NET Core SDK ${{ env.NETCORE_VERSION }}... + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ env.NETCORE_VERSION }} + + - name: Restoring packages... + run: dotnet restore + + - name: Building project... + run: dotnet build --configuration Release --no-restore src/$PROJECT_NAME/$PROJECT_NAME.csproj + + - name: Testing... + run: dotnet test --no-restore --verbosity normal \ No newline at end of file diff --git a/README.md b/README.md index 42886aa..37e51cf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # FluentValidation A library for using FluentValidation with Blazor -[![Build Status](https://dev.azure.com/blazored/FluentValidation/_apis/build/status/Blazored.FluentValidation?branchName=master)](https://dev.azure.com/blazored/FluentValidation/_build/latest?definitionId=11&branchName=master) +![Build & Test Main](https://github.com/Blazored/FluentValidation/workflows/Build%20&%20Test%20Main/badge.svg) ![Nuget](https://img.shields.io/nuget/v/blazored.fluentvalidation.svg) diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index ca81bf8..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,36 +0,0 @@ -trigger: -- master - -pool: - vmImage: 'windows-latest' - -variables: - buildConfiguration: 'Release' - -steps: -- task: UseDotNet@2 - displayName: 'Use .NET Core sdk' - inputs: - packageType: sdk - version: 3.1.201 - installationPath: $(Agent.ToolsDirectory)/dotnet - -- task: NuGetToolInstaller@0 - displayName: 'Installing Nuget Tools...' - inputs: - versionSpec: '4.9.2' - -- script: dotnet build --configuration $(buildConfiguration) src/Blazored.FluentValidation/Blazored.FluentValidation.csproj - displayName: 'Building $(buildConfiguration)...' - -- task: DotNetCoreCLI@2 - displayName: 'Generating Nuget Package... ' - inputs: - command: pack - - arguments: --no-build - packagesToPack: src/Blazored.FluentValidation/Blazored.FluentValidation.csproj - configuration: $(buildConfiguration) - -- task: PublishBuildArtifacts@1 - displayName: 'Publishing Build Artifacts...' diff --git a/src/Blazored.FluentValidation/Blazored.FluentValidation.csproj b/src/Blazored.FluentValidation/Blazored.FluentValidation.csproj index b2dd07c..3e49621 100644 --- a/src/Blazored.FluentValidation/Blazored.FluentValidation.csproj +++ b/src/Blazored.FluentValidation/Blazored.FluentValidation.csproj @@ -1,27 +1,39 @@  - - netstandard2.0 - 3.0 - Blazored.FluentValidation - - Blazored.FluentValidation - 1.3.0 - Chris Sainty - A library for using FluentValidation with Blazor - Copyright 2019 (c) Chris Sainty. All rights reserved. - MIT - https://github.com/blazored/FluentValidation - https://avatars1.githubusercontent.com/u/39194025 - https://github.com/blazored/FluentValidation - Blazor FluentValidation Blazored Components Fluent Validation - - - - - - - - + + netstandard2.1 + 3.0 + + Chris Sainty + + Copyright 2020 (c) Chris Sainty. All rights reserved. + + A library for using FluentValidation with Blazor + true + snupkg + + + Blazored.FluentValidation + Blazor;FluentValidation;Fluent Validation;Blazored;Components;ASP.NET Core;CSharp;Web + MIT + https://github.com/Blazored/FluentValidation + icon.png + git + https://github.com/Blazored/FluentValidation + + + true + true + + + + + + + + + + + diff --git a/src/Blazored.FluentValidation/icon.png b/src/Blazored.FluentValidation/icon.png new file mode 100644 index 0000000..78f2680 Binary files /dev/null and b/src/Blazored.FluentValidation/icon.png differ