chore: update version to 1.5.0 #104
Workflow file for this run
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: Build, Test and Publish NuGet Package | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*.*.*' | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| dotnet-version: ['8.0.x', '9.0.x', '10.0.x'] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET ${{ matrix.dotnet-version }} | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ matrix.dotnet-version }} | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Run unit tests | |
| run: dotnet test --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./coverage | |
| - name: Upload coverage reports | |
| uses: actions/upload-artifact@v4 | |
| if: matrix.dotnet-version == '9.0.x' | |
| with: | |
| name: coverage-report | |
| path: ./coverage/**/coverage.cobertura.xml | |
| package: | |
| runs-on: ubuntu-latest | |
| needs: build-and-test | |
| outputs: | |
| version: ${{ steps.get_version.outputs.VERSION }} | |
| is_release: ${{ steps.get_version.outputs.IS_RELEASE }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Extract version from tag | |
| id: get_version | |
| run: | | |
| if [[ $GITHUB_REF == refs/tags/v* ]]; then | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "IS_RELEASE=true" >> $GITHUB_OUTPUT | |
| else | |
| VERSION="1.5.0-preview.${{ github.run_number }}" | |
| echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
| echo "IS_RELEASE=false" >> $GITHUB_OUTPUT | |
| fi | |
| echo "📦 Package version: $VERSION" | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| 10.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Create NuGet package | |
| run: dotnet pack ./Maskify.Core/Maskify.Core.csproj --configuration Release --no-build -o ./nupkg /p:PackageVersion=${{ steps.get_version.outputs.VERSION }} | |
| - name: Upload NuGet package artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nuget-package-${{ steps.get_version.outputs.VERSION }} | |
| path: ./nupkg/*.nupkg | |
| publish-nuget: | |
| runs-on: ubuntu-latest | |
| needs: package | |
| if: needs.package.outputs.is_release == 'true' | |
| steps: | |
| - name: Download NuGet package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nuget-package-${{ needs.package.outputs.version }} | |
| path: ./nupkg | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 9.0.x | |
| - name: Publish to NuGet.org | |
| env: | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
| run: | | |
| echo "🚀 Publishing version ${{ needs.package.outputs.version }} to NuGet.org" | |
| dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| create-release: | |
| runs-on: ubuntu-latest | |
| needs: [package, publish-nuget] | |
| if: needs.package.outputs.is_release == 'true' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download NuGet package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nuget-package-${{ needs.package.outputs.version }} | |
| path: ./nupkg | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: v${{ needs.package.outputs.version }} | |
| tag_name: ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: ./nupkg/*.nupkg | |
| body: | | |
| ## 📦 Maskify.Core v${{ needs.package.outputs.version }} | |
| ### Installation | |
| ```bash | |
| dotnet add package Maskify.Core --version ${{ needs.package.outputs.version }} | |
| ``` | |
| ### What's New | |
| - ✅ Full support for alphanumeric CNPJ (Brazilian law compliance) | |
| - ⚡ High-performance single-pass processing | |
| - 🎯 Zero heap allocations in hot paths | |
| See [CHANGELOG.md](CHANGELOG.md) for full details. | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |