Skip to content

Commit

Permalink
Update GH Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ktos committed Nov 12, 2024
1 parent cb7f2c8 commit df9d38f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI build
name: Build and Test

on:
push:
Expand All @@ -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
Expand Down
31 changes: 25 additions & 6 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v5
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

Expand All @@ -25,7 +25,7 @@ jobs:
run: dotnet build --configuration Release --no-restore

- name: Test
run: dotnet test --no-build --verbosity normal
run: dotnet test --verbosity normal

publish-nuget:
needs: build-and-test
Expand All @@ -34,16 +34,35 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.

- name: Setup .NET
uses: actions/setup-dotnet@v5
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'

# Use GitVersion
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.x'

- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]

- name: Publish NuGet Package
run: |
dotnet nuget add source --name "nuget.org" --source "https://api.nuget.org/v3/index.json"
run: |
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 }}
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

0 comments on commit df9d38f

Please sign in to comment.