CD #8
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: CD | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.0' # Adjust to your .NET version | |
| - name: Restore dependencies | |
| working-directory: ./src | |
| run: dotnet restore | |
| - name: Build | |
| working-directory: ./src | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Pack | |
| working-directory: ./src | |
| run: dotnet pack --configuration Release --output artifacts | |
| - name: Push to NuGet | |
| working-directory: ./src | |
| run: dotnet nuget push artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_API_KEY }} |