Skip to content

Commit ee90f67

Browse files
Mousakaemilklasson
andcommitted
Github Action Workflows.
Co-authored-by: Emil Klasson <[email protected]>
1 parent d9ae011 commit ee90f67

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build:
12+
name: Build and test
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Setup .NET Core
18+
uses: actions/setup-dotnet@v1
19+
with:
20+
dotnet-version: 3.1.101
21+
- name: Install dependencies
22+
run: dotnet restore
23+
- name: Build
24+
run: dotnet build --configuration Release --no-restore
25+
- name: Test
26+
run: dotnet test --no-restore --verbosity normal
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish to nuget
2+
3+
on:
4+
release:
5+
types: [created, edited]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install dependencies
14+
run: dotnet restore
15+
- name: Build
16+
run: dotnet build --configuration Release --no-restore
17+
- name: Test
18+
run: dotnet test --no-restore --verbosity normal
19+
- name: Create the package
20+
run: dotnet pack --configuration Release -o Release -p:PackageVersion=${GITHUB_REF/refs\/tags\/v/''} --include-source
21+
- name: Publish the package to NuGet
22+
env:
23+
NUGET_AUTH_TOKEN: ${{secrets.NUGET_AUTH_TOKEN}}
24+
run: dotnet nuget push Release/*.nupkg --skip-duplicate --no-symbols true --source https://api.nuget.org/v3/index.json -k ${NUGET_AUTH_TOKEN}

0 commit comments

Comments
 (0)