Skip to content

Commit a233b2d

Browse files
committed
Fork for Resonite modding with ResonitePlugin support
1 parent 41c84c4 commit a233b2d

13 files changed

Lines changed: 316 additions & 143 deletions

.config/dotnet-tools.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"cake.tool": {
6+
"version": "5.1.0",
7+
"commands": [
8+
"dotnet-cake"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.github/workflows/build.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
submodules: true
15+
fetch-depth: 0
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: 9.x
21+
22+
- name: Run the Cake script
23+
uses: cake-build/cake-action@v1
24+
with:
25+
verbosity: Diagnostic
26+
27+
- uses: actions/upload-artifact@v3
28+
with:
29+
name: BepInEx.AutoPlugin
30+
path: |
31+
artifacts/package/release/*.nupkg
32+
artifacts/bin/BepInEx.AutoPlugin/release/BepInEx.AutoPlugin.dll

.github/workflows/main.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
inputs:
9+
create_release:
10+
description: 'Create a GitHub release'
11+
required: false
12+
default: 'true'
13+
type: choice
14+
options:
15+
- 'true'
16+
- 'false'
17+
18+
jobs:
19+
release:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
submodules: true
26+
fetch-depth: 0
27+
28+
- name: Set short sha
29+
id: info
30+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
31+
32+
- uses: kzrnm/get-net-sdk-project-versions-action@v2
33+
id: get-version
34+
with:
35+
proj-path: BepInEx.AutoPlugin/BepInEx.AutoPlugin.csproj
36+
37+
- name: Setup .NET
38+
uses: actions/setup-dotnet@v4
39+
with:
40+
dotnet-version: 9.x
41+
42+
- name: Run the Cake script
43+
uses: cake-build/cake-action@v1
44+
with:
45+
verbosity: Diagnostic
46+
47+
- uses: actions/upload-artifact@v4
48+
with:
49+
name: BepInEx.AutoPlugin-${{ steps.get-version.outputs.version }}-${{ steps.info.outputs.sha_short }}
50+
path: |
51+
artifacts/package/release/*.nupkg
52+
artifacts/bin/BepInEx.AutoPlugin/release/BepInEx.AutoPlugin.dll
53+
54+
- name: Create Git Tag (if needed)
55+
if: ${{ github.event_name == 'workflow_dispatch' }}
56+
run: |
57+
TAG_NAME="${{ steps.get-version.outputs.version }}"
58+
# Check if tag already exists
59+
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
60+
echo "Tag $TAG_NAME already exists"
61+
else
62+
echo "Creating tag $TAG_NAME"
63+
git config user.name github-actions
64+
git config user.email github-actions@github.com
65+
git tag -a "$TAG_NAME" -m "Release $TAG_NAME"
66+
git push origin "$TAG_NAME"
67+
fi
68+
69+
- name: Push NuGet package
70+
run: |
71+
dotnet nuget push artifacts/package/release/*.nupkg --source ${{ secrets.NUGET_SOURCE }} --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate
72+
73+
- name: Create GitHub Release
74+
if: ${{ (github.ref_type == 'tag') || (github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true') }}
75+
uses: softprops/action-gh-release@v2
76+
with:
77+
draft: true
78+
prerelease: false
79+
generate_release_notes: false
80+
name: ${{ steps.get-version.outputs.version }}
81+
tag_name: ${{ steps.get-version.outputs.version }}
82+
target_commitish: ${{ github.sha }}
83+
files: |
84+
./artifacts/package/release/*.nupkg
85+
./artifacts/bin/BepInEx.AutoPlugin/release/BepInEx.AutoPlugin.dll
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)