Skip to content

Commit 738e922

Browse files
authored
Create main.yml
1 parent ffec0d9 commit 738e922

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
release:
5+
types:
6+
- created
7+
8+
jobs:
9+
build:
10+
11+
env:
12+
BUILD_CONFIG: 'Release'
13+
SOLUTION: 'AutoRefreshTokenHttpMessageHandler.sln'
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v3
22+
with:
23+
dotnet-version: 8.0.x
24+
25+
- name: Setup NuGet
26+
uses: NuGet/setup-nuget@v1
27+
28+
- name: Restore dependencies
29+
run: dotnet restore $SOLUTION
30+
31+
- name: Build
32+
run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore /p:Version="${{ github.event.release.tag_name }}"
33+
34+
- name: Run tests
35+
run: dotnet test --configuration $BUILD_CONFIG --no-restore --no-build --verbosity normal
36+
37+
- name: Publish
38+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}

0 commit comments

Comments
 (0)