Merge branch 'master' of https://github.com/gpoon21/KeyColor #1
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: Publish NuGet Package | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # Triggers only on version tags like v1.0.0 | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore KeyColor/KeyColor.csproj | |
| - name: Build project | |
| run: dotnet build KeyColor/KeyColor.csproj --configuration Release --no-restore | |
| - name: Pack NuGet package | |
| run: dotnet pack KeyColor/KeyColor.csproj --configuration Release --no-build --output ./nupkg | |
| - name: Push package to NuGet | |
| run: dotnet nuget push "./nupkg/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |