-
Notifications
You must be signed in to change notification settings - Fork 1
113 lines (93 loc) · 2.95 KB
/
release.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
105
106
107
108
109
110
111
112
113
name: Publish
on:
release:
types: [released, prereleased]
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.tag_name }}
fetch-depth: 0
filter: tree:0
- name: Setup .NET Env
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.100"
- name: Restore Solution
run: |
dotnet restore
dotnet tool restore
- name: Pack Solution
run: |
dotnet pack --configuration Release
- name: Build Debug
run: |
dotnet build --configuration Debug
- name: Upload Thunderstore Artifact
uses: actions/upload-artifact@v4
with:
name: thunderstore-build
path: dist/*.zip
- name: Upload NuPkg Artifact
uses: actions/upload-artifact@v4
with:
name: nupkg-build
path: LethalNetworkAPI/bin/Release/*.nupkg
- name: Upload Debug Dll
uses: actions/upload-artifact@v4
with:
name: debug-build
path: LethalNetworkAPI/bin/Debug/netstandard2.1/LethalNetworkAPI.dll
upload-release-artifacts:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download all Artifacts
uses: actions/download-artifact@v4
- name: Upload artifacts to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ github.event.release.tag_name }} thunderstore-build/*.zip nupkg-build/*.nupkg debug-build/*.dll
deploy-nuget:
name: Deploy to NuGet
needs: build
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4
- name: Download nupkg artifact
uses: actions/download-artifact@v4
with:
name: nupkg-build
path: ./LethalNetworkAPI/bin/Release
- name: Setup .NET environment
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.100"
- name: Publish to NuGet.org
run: |
dotnet nuget push ./LethalNetworkAPI/bin/Release/*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
deploy-thunderstore:
if: ${{ github.event.release.prerelease == false }}
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download Thunderstore Artifact
uses: actions/download-artifact@v4
with:
name: thunderstore-build
path: ./dist
- name: Restore Tools
run: |
dotnet tool restore
- name: Publishing to Thunderstore
env:
TCLI_AUTH_TOKEN: ${{ secrets.THUNDERSTORE_TOKEN }}
run: |
dotnet tcli publish --config-path assets/thunderstore.toml --file dist/*.zip