-
-
Notifications
You must be signed in to change notification settings - Fork 33
76 lines (62 loc) · 2.4 KB
/
build-debug.yaml
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
name: Build Debug
on:
push:
branches: ["dev"]
pull_request:
branches: ["dev"]
jobs:
build:
runs-on: ubuntu-latest
env:
DOTNET_INSTALL_DIR: ~/.dotnet
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Set up variables
id: vars
run: |
# Extract package version from project
version=$(grep -oP '<Version>\K[^<]+' LCVR.csproj)
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0"
- name: Restore NuGet packages
run: dotnet restore
- name: Build app
run: dotnet build
- name: Configure GPG Key
run: |
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: Prepare and bundle package
run: |
# Set up template
mkdir package
git --work-tree=./package checkout origin/thunderstore ./
# Copy and sign debug binaries
cp bin/Debug/netstandard2.1/LCVR.dll ./package/BepInEx/plugins/LCVR/
cp bin/Debug/netstandard2.1/LCVR.Preload.dll ./package/BepInEx/patchers/LCVR/
gpg --output ./package/BepInEx/plugins/LCVR/LCVR.dll.sig --detach-sig ./package/BepInEx/plugins/LCVR/LCVR.dll
gpg --output ./package/BepInEx/patchers/LCVR/LCVR.Preload.dll.sig --detach-sig ./package/BepInEx/patchers/LCVR/LCVR.Preload.dll
# Move assets
mv ./package/lethalcompanyvr ./package/BepInEx/plugins/LCVR/lethalcompanyvr
# Copy docs and license
cp CHANGELOG.md ./package/CHANGELOG.md
cp Docs/Thunderstore/README.md ./package/README.md
cp LICENSE ./package/LICENSE
# Update Thunderstore manifest
jq '.version_number = "${{ steps.vars.outputs.version }}"' ./package/manifest.json > ./package/manifest_new.json
mv ./package/manifest_new.json ./package/manifest.json
- name: Upload build artifacts
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: LCVR-${{ steps.vars.outputs.version }}-dev-${{ steps.vars.outputs.sha_short }}
path: ./package