-
-
Notifications
You must be signed in to change notification settings - Fork 42
104 lines (102 loc) · 3.37 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Compile Mod
on:
release:
types:
- created
push:
pull_request:
permissions:
contents: write
id-token: write
pages: write
packages: write
jobs:
lint-and-compile:
strategy:
matrix:
configuration: [Debug, Release]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2.1.0
with:
dotnet-version: "7.0.x"
- run: dotnet restore ${{ github.event.repository.name }}.sln
- uses: justalemon/VersionPatcher@v0.7.1
with:
version: 1.10.0.${{ github.run_number }}
use-tag: true
csproj-files: "**/*.csproj"
- run: dotnet build ${{ github.event.repository.name }}.sln -c ${{ matrix.configuration }}
working-directory: ${{ env.GITHUB_WORKSPACE }}
- uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}.${{ matrix.configuration }}
path: bin/${{ matrix.configuration }}
docs:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
needs:
- lint-and-compile
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2.1.0
with:
dotnet-version: "7.0.x"
- uses: actions/download-artifact@v4.1.7
with:
name: ${{ github.event.repository.name }}.Release
path: bin/Release
- run: ls -R
working-directory: bin/Release
- run: dotnet tool update -g docfx
- run: docfx docs/docfx.json
- uses: actions/upload-pages-artifact@v2.0.0
with:
path: "docs/_site"
- uses: actions/deploy-pages@v3.0.1
github-package-registry:
runs-on: ubuntu-22.04
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- lint-and-compile
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2.1.0
with:
dotnet-version: "7.0.x"
- uses: actions/download-artifact@v4.1.7
with:
name: ${{ github.event.repository.name }}.Release
path: bin/Release
- run: ls -R
working-directory: bin/Release
- run: 7z a ${{ github.event.repository.name }}.zip ${{ github.workspace }}/bin/Release/*
- run: dotnet nuget push "**/*.nupkg" -s 'https://nuget.pkg.github.com/${{ github.event.repository.owner.name }}/index.json' -k ${{ secrets.GITHUB_TOKEN }}
deploy:
runs-on: ubuntu-22.04
if: ${{ github.event_name == 'release' }}
needs:
- lint-and-compile
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2.1.0
with:
dotnet-version: "7.0.x"
- uses: actions/download-artifact@v4.1.7
with:
name: ${{ github.event.repository.name }}.Release
path: bin/Release
- run: ls -R
working-directory: bin/Release
- run: 7z a ${{ github.event.repository.name }}.zip ${{ github.workspace }}/bin/Release/*
- run: dotnet nuget push "**/*.nupkg" -s 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGET }}
- uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: ${{ github.event.repository.name }}.zip
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitNameDuringUpdate: true
omitPrereleaseDuringUpdate: true