Skip to content

Commit b9d5040

Browse files
committed
Test workflow
1 parent 91b8d1f commit b9d5040

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/nuget.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: CI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
env:
10+
BUILD_CONFIG: 'Release'
11+
SOLUTION: 'BoringTunSharp.sln'
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Write release version
18+
run: |
19+
VERSION=${GITHUB_REF_NAME#v}
20+
echo Version: $VERSION
21+
echo "VERSION=$VERSION" >> $GITHUB_ENV
22+
23+
- name: Setup NuGet
24+
uses: NuGet/[email protected]
25+
26+
- name: Restore dependencies
27+
run: nuget restore $SOLUTION
28+
29+
- name: Setup .NET
30+
uses: actions/setup-dotnet@v3
31+
with:
32+
dotnet-version: 7.0.x
33+
34+
- name: Build
35+
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG -p:Version=${VERSION} --no-restore
36+
37+
- name: Publish
38+
if: startsWith(github.ref, 'refs/heads/release')
39+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}

0 commit comments

Comments
 (0)