Skip to content

Commit fb46179

Browse files
committed
Add github actions
1 parent 20b8453 commit fb46179

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup .NET Core
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 5.0.301
19+
- name: Setup dotnet tools
20+
run: dotnet tool restore
21+
- name: Install dependencies
22+
run: dotnet restore
23+
- name: Check formatting
24+
run: dotnet fantomas . -r --check
25+
- name: Build
26+
run: dotnet build --configuration Release --no-restore
27+
- name: Test
28+
run: dotnet run RunTests

.github/workflows/publish.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
on:
2+
push:
3+
tags:
4+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
5+
6+
name: Publish Release
7+
jobs:
8+
build:
9+
name: Create Release
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v1
15+
16+
- name: Setup .NET Core
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 5.0.301
20+
21+
- name: Setup tools
22+
run: dotnet tool restore
23+
- name: Dotnet Pack
24+
run: dotnet pack -c release -p:PackageVersion=${GITHUB_REF##*/v} -p:FileVersion=${GITHUB_REF##*/v} -p:InformationalVersion=${GITHUB_REF##*/v}
25+
26+
- name: Push Nuget
27+
run: dotnet nuget push src/bin/Release/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
28+
continue-on-error: false
29+
30+
- name: Create Release
31+
uses: actions/create-release@master
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
tag_name: ${{ github.ref }}
36+
release_name: Release ${{ github.ref }}
37+
draft: false

0 commit comments

Comments
 (0)