Deploy to NuGet #55
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: Deploy to NuGet | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v3.1.1 | |
| with: | |
| versionSpec: '6.0.x' | |
| - name: Determine Version | |
| id: version_step # step id used as reference for output values | |
| uses: gittools/actions/gitversion/execute@v3.1.1 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '9.x' | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build project | |
| run: dotnet build --configuration Release /p:AssemplyVersion=${{ steps.version_step.outputs.MajorMinorPatch }} /p:FileVersion=${{ steps.version_step.outputs.MajorMinorPatch }} | |
| - name: Publish TnTComponents to NuGet | |
| env: | |
| NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
| run: | | |
| dotnet pack TnTComponents/TnTComponents.csproj --configuration Release --output ./nupkg /p:PackageVersion=${{ steps.version_step.outputs.MajorMinorPatch }} | |
| dotnet pack TnTComponents.AspNetCore/TnTComponents.AspNetCore.csproj --configuration Release --output ./nupkg /p:PackageVersion=${{ steps.version_step.outputs.MajorMinorPatch }} | |
| dotnet pack TnTComponents.Extensions/TnTComponents.Extensions.csproj --configuration Release --output ./nupkg /p:PackageVersion=${{ steps.version_step.outputs.MajorMinorPatch }} | |
| - run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
| - name: Bump version and push tag | |
| uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token | |
| WITH_V: false | |
| CUSTOM_TAG: 'v${{ steps.version_step.outputs.MajorMinorPatch }}' |