-
-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (70 loc) · 2.07 KB
/
publish.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
name: Publish
on:
release:
types: [prereleased, released]
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
submodules: recursive
- name: Setup .NET environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
- name: Restore project
run: |
dotnet restore
dotnet tool restore
- name: Build solution
run: |
dotnet build -c Release
- name: Upload thunderstore artifact
uses: actions/upload-artifact@v4
with:
name: thunderstore-build
path: |
./*/assets/thunderstore.toml.user
./*/bin/Release/netstandard2.1/dist/*.zip
upload-release-artifacts:
name: Upload Release Artifacts
needs: build
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
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/*/bin/Release/netstandard2.1/dist/*.zip
deploy-thunderstore:
name: Deploy to Thunderstore
needs: build
runs-on: ubuntu-latest
steps:
- name: Fetch Sources
uses: actions/checkout@v4
- name: Download Thunderstore artifact
uses: actions/download-artifact@v4
with:
name: thunderstore-build
- name: Setup .NET environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
- name: Restore dotnet tools
run: |
dotnet tool restore
- name: Publish to Thunderstore
env:
TCLI_AUTH_TOKEN: ${{ secrets.THUNDERSTORE_API_TOKEN }}
run: |
dotnet build -c Release -f netstandard2.1 -target:ThunderstorePublish