Skip to content

Commit 56fdd68

Browse files
committed
continues integration, semantic versioning and nuget
1 parent 6944787 commit 56fdd68

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

.github/workflows/cd.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: CD
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
with:
24+
dotnet-version: 10.0.x
25+
- name: Install GitVersioning
26+
run: dotnet tool install --global nbgv
27+
- name: Set version
28+
id: version
29+
run: echo "::set-output name=VERSION::$(nbgv get-version -v AssemblyInformationalVersion)"
30+
- name: Restore dependencies
31+
run: dotnet restore
32+
- name: Build
33+
run: dotnet build --no-restore
34+
- name: Test
35+
run: dotnet test --no-build --verbosity normal
36+
- name: Pack
37+
run: dotnet pack --configuration Release --output ./nupkg /p:PackageVersion=${{ steps.version.outputs.VERSION }}
38+
- name: Publish to NuGet
39+
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
40+
- name: Publish to GitHub Packages
41+
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.PUSH_GITHUB_PACKAGES }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json

0 commit comments

Comments
 (0)