From 8bdd3927403c1463ca670b452e51d5f4b0d35449 Mon Sep 17 00:00:00 2001 From: Marcin Badurowicz Date: Tue, 12 Nov 2024 23:11:44 +0100 Subject: [PATCH] Update GH Actions --- .github/workflows/ci.yml | 5 ++--- .github/workflows/tag.yml | 20 +++++++++++++++++++- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8a91025..ebe8081 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: CI build +name: Build and Test on: push: @@ -8,8 +8,7 @@ on: jobs: build: - runs-on: ubuntu-latest - name: CI Build + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index a3285f9..8a710f9 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -40,10 +40,28 @@ jobs: with: dotnet-version: '9.0.x' + # Use GitVersion + - name: Install GitVersion + uses: gittools/actions/gitversion/setup@v3.0.0 + with: + versionSpec: '6.x' + + - name: Determine Version + id: gitversion + uses: gittools/actions/gitversion/execute@v3.0.0 + - name: Publish NuGet Package run: | dotnet nuget add source --name "nuget.org" --source "https://api.nuget.org/v3/index.json" dotnet pack --configuration Release --no-build --output ./nupkg/ dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source "nuget.org" env: - NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} \ No newline at end of file + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + + - name: Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.gitversion.outputs.semVer }} + name: v${{ steps.gitversion.outputs.semVer }} + files: | + ./nupkg/*.nupkg \ No newline at end of file