Skip to content

Commit 12f9e99

Browse files
committed
Add github actions
1 parent 7d61d91 commit 12f9e99

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 2
15+
16+
- name: Setup .NET
17+
uses: actions/setup-dotnet@v3
18+
with:
19+
dotnet-version: 9.0.x
20+
21+
- name: Restore
22+
run: dotnet restore
23+
24+
- name: Build
25+
run: dotnet build -c Release --no-restore
26+
27+
- name: Pack
28+
run: dotnet pack -c Release -o ./nuget --no-build
29+
30+
- name: Publish
31+
run: dotnet nuget push ./nuget/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --skip-duplicate -s https://api.nuget.org/v3/index.json

.github/workflows/test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Build & Test
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
build-and-test:
9+
10+
name: build-and-test-${{ matrix.os }}
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 2
20+
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v3
23+
with:
24+
dotnet-version: 9.0.x
25+
26+
- name: Restore dependencies
27+
run: dotnet restore
28+
29+
- name: Build
30+
run: dotnet build -c Release --no-restore
31+
32+
- name: Test
33+
run: dotnet test --no-restore --verbosity normal

0 commit comments

Comments
 (0)