Skip to content

Commit d56e3fd

Browse files
authored
feat: add scaffolding and publishing (#13)
1 parent 846ca2c commit d56e3fd

27 files changed

+813
-0
lines changed

.github/workflows/dotnet-format.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: dotnet format
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- '**.cs'
8+
- '.editorconfig'
9+
pull_request:
10+
branches: [ main ]
11+
paths:
12+
- '**.cs'
13+
- '.editorconfig'
14+
15+
jobs:
16+
check-format:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Check out code
21+
uses: actions/checkout@v3
22+
23+
- name: Setup .NET Core 6.0
24+
uses: actions/setup-dotnet@v3
25+
with:
26+
dotnet-version: 6.0.x
27+
28+
- name: Install format tool
29+
run: dotnet tool install -g dotnet-format
30+
31+
- name: dotnet format
32+
run: dotnet-format --folder --check

.github/workflows/lint-pr.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Lint PR'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v4
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/linux-ci.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Linux
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- '**.md'
8+
pull_request:
9+
branches: [ main ]
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
build-test:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
version: [net6.0]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Install dependencies
27+
run: dotnet restore
28+
29+
- name: Build
30+
run: dotnet build --configuration Release --no-restore
31+
32+
- name: Test ${{ matrix.version }}
33+
run: dotnet test --configuration Release --no-build --logger:"console;verbosity=detailed"

.github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Run Release Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release-package:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- uses: google-github-actions/release-please-action@v3
14+
id: release
15+
with:
16+
command: manifest
17+
token: ${{secrets.GITHUB_TOKEN}}
18+
default-branch: main
19+
20+
- uses: actions/checkout@v3
21+
if: ${{ steps.release.outputs.releases_created }}
22+
with:
23+
fetch-depth: 0
24+
25+
- name: Install dependencies
26+
if: ${{ steps.release.outputs.releases_created }}
27+
run: dotnet restore
28+
29+
- name: Build
30+
if: ${{ steps.release.outputs.releases_created }}
31+
run: |
32+
dotnet build --configuration Release --no-restore -p:Deterministic=true
33+
34+
- name: Pack
35+
if: ${{ steps.release.outputs.releases_created }}
36+
run: |
37+
dotnet pack --configuration Release --no-build
38+
39+
- name: Publish to Nuget
40+
if: ${{ steps.release.outputs.releases_created }}
41+
run: |
42+
dotnet nuget push --skip-duplicate "**/*.nupkg" --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_TOKEN}}

.github/workflows/windows-ci.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Windows
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- '**.md'
8+
pull_request:
9+
branches: [ main ]
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
build-test:
15+
runs-on: windows-latest
16+
17+
strategy:
18+
matrix:
19+
version: [net462,net6.0]
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Install dependencies
27+
run: dotnet restore
28+
29+
- name: Build
30+
run: dotnet build --configuration Release --no-restore
31+
32+
- name: Test ${{ matrix.version }}
33+
run: dotnet test --configuration Release --no-build --logger:"console;verbosity=detailed"

0 commit comments

Comments
 (0)