Skip to content

Commit f951cd1

Browse files
committed
feat: initial CI improvment
1 parent a126d96 commit f951cd1

File tree

3 files changed

+80
-1
lines changed

3 files changed

+80
-1
lines changed

.github/workflows/CD.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: CD
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
upload-asset:
10+
runs-on: windows-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
- uses: actions/setup-dotnet@v4
15+
with:
16+
dotnet-version: '8'
17+
- uses: nuget/setup-nuget@v2
18+
with:
19+
nuget-api-key: ${{ secrets.NuGetAPIKey }}
20+
- name: Restore
21+
run: |
22+
dotnet restore
23+
- name: Build
24+
run: |
25+
dotnet build -c Release
26+
- name: Package
27+
run: |
28+
dotnet tool install -g tcli
29+
tcli build
30+
nuget pack
31+
- name: Upload mod file to release
32+
uses: svenstaro/upload-release-action@v2
33+
with:
34+
repo_token: '${{ secrets.GITHUB_TOKEN }}'
35+
file: build/*.*
36+
tag: '${{ github.ref }}'
37+
overwrite: true
38+
- name: Upload mod file to Thunderstore
39+
env:
40+
TCLI_AUTH_TOKEN: '${{ secrets.TCLI_AUTH_TOKEN }}'
41+
run: |
42+
tcli publish
43+
- name: Upload mod file to NuGet
44+
run: |
45+
nuget push *.nupkg

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
- uses: actions/setup-dotnet@v4
2626
with:
2727
dotnet-version: "8"
28+
- uses: nuget/setup-nuget@v2
29+
if: matrix.os == 'windows-latest'
2830
- name: Restore
2931
run: |
3032
dotnet restore
@@ -35,8 +37,13 @@ jobs:
3537
run: |
3638
dotnet tool install -g tcli
3739
tcli build
40+
- name: Package NuGet
41+
if: matrix.os == 'windows-latest'
42+
run: nuget pack
3843
- name: Upload Artifacts
3944
uses: actions/upload-artifact@v4
4045
with:
41-
path: "build/*.*"
46+
path: |
47+
"build/*.*"
48+
"*.nupkg"
4249
name: ${{ matrix.os }}

COTL_API.nuspec

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
3+
<metadata>
4+
<id>COTL_API</id>
5+
<version>0.2.8</version>
6+
<title>Cult of the Lamb Modding API</title>
7+
<icon>images\icon.png</icon>
8+
<authors>xhayper</authors>
9+
<license type="file">LICENSE</license>
10+
<licenseUrl>https://aka.ms/deprecateLicenseUrl</licenseUrl>
11+
<readme>README.md</readme>
12+
<projectUrl>https://github.com/xhayper/COTL_API</projectUrl>
13+
<description>A modding API for Cult of the Lamb</description>
14+
<repository type="git" url="https://github.com/xhayper/COTL_API" commit="a126d964c23d8c2deaf21102f301f51548777052" />
15+
<dependencies>
16+
<group targetFramework=".NETFramework4.7.2">
17+
<dependency id="BepInEx.Core" version="5.4.21" exclude="Build,Analyzers" />
18+
<dependency id="BepInEx.PluginInfoProps" version="2.1.0" exclude="Build,Analyzers" />
19+
<dependency id="CultOfTheLamb.GameLibs" version="1.4.6.596-r.0" exclude="Build,Analyzers" />
20+
<dependency id="UnityEngine.Modules" version="2021.3.16" exclude="Runtime,Build,Native,Analyzers,BuildTransitive" />
21+
</group>
22+
</dependencies>
23+
</metadata>
24+
<files>
25+
<file src=".\icon.png" target="images\" />
26+
</files>
27+
</package>

0 commit comments

Comments
 (0)