Skip to content

Commit 9a25ab2

Browse files
authored
Merge pull request #48 from nojaf/release
Add Release Action
2 parents e510a8c + a6b4028 commit 9a25ab2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
10+
DOTNET_CLI_TELEMETRY_OPTOUT: true
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
23+
- name: Extract version from tag
24+
id: extract_version
25+
run: echo "version=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT"
26+
27+
- name: Restore dependencies
28+
run: dotnet restore
29+
30+
- name: Build solution
31+
run: dotnet build --configuration Release --no-restore
32+
33+
- name: Package
34+
run: dotnet pack ./Serilog.Sinks.Network/Serilog.Sinks.Network.csproj -c Release -o ./artifacts /p:Version=${{ steps.extract_version.outputs.version }}
35+
36+
- name: Publish To NuGet
37+
env:
38+
NUGET_KEY: ${{ secrets.NUGET_KEY }}
39+
run: dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{ secrets.NUGET_KEY }}

0 commit comments

Comments
 (0)