diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9139465..d73d760 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,18 +10,29 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "9.0.x" + - name: Verify commit exists in origin/main run: | git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* git branch --remote --contains | grep origin/main + - name: Set VERSION variable from tag run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Build run: dotnet build --configuration Release /p:Version=${VERSION} + - name: Test run: dotnet test --configuration Release /p:Version=${VERSION} --no-build + - name: Pack run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output . + - name: Push run: dotnet nuget push Relewise.Client.Extensions.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} env: