Skip to content

Updated the ci/cd to try to do a nuget push #20

Updated the ci/cd to try to do a nuget push

Updated the ci/cd to try to do a nuget push #20

Workflow file for this run

name: Publish
on:
push:
branches:
- master
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
env:
Configuration: Release
ProjectDir: src\SourceGenerator.Foundations\
ProjectName: SourceGenerator.Foundations.csproj
SolutionPath: src\SourceGenerator.Foundations.sln
jobs:
publish:
name: build, bundle & publish
runs-on: windows-latest
steps:
# CheckOut
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }} # checkout the correct branch name
fetch-depth: 0 # fetch the whole repo history
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- run: dotnet tool restore
- run: dotnet gitversion /output buildserver
- run: dotnet build ${{env.SolutionPath}} -t:build -p:Version=${{env.GitVersion_AssemblySemVer}} --configuration ${{env.Configuration}}
- run: dotnet test ${{env.SolutionPath}}
- run: dotnet build ${{env.SolutionPath}} -t:pack -p:PackageVersion=${{env.GitVersion_SemVer}} --configuration ${{env.Configuration}}
- run: dotnet nuget push ${{env.ProjectDir}}bin${{env.Configuration}}\*.nupkg --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json