-
Notifications
You must be signed in to change notification settings - Fork 4
89 lines (74 loc) · 2.29 KB
/
ci.yml
File metadata and controls
89 lines (74 loc) · 2.29 KB
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
name: NewMod CI
on:
push:
branches: [main, dev]
tags:
- 'v*'
pull_request:
branches: [main, dev]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
BuildingInsideCI: true
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: true
- name: Cache Dependencies
uses: actions/cache@v4
with:
path: |
~/.nuget/packages
~/.cache/bepinex
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore NuGet Packages
run: dotnet restore NewMod/NewMod.csproj
- name: Build NewMod (Release)
run: dotnet build NewMod/NewMod.csproj --configuration Release --no-restore
- name: Build NewMod (Debug)
run: dotnet build NewMod/NewMod.csproj --configuration Debug --no-restore
- name: Build NewMod Android (Debug)
run: dotnet build NewMod/NewMod.csproj --configuration ANDROID --no-restore
- name: Upload NewMod DLL (Release)
uses: actions/upload-artifact@v4
with:
name: NewMod
path: NewMod/bin/Release/net6.0/NewMod.dll
- name: Upload NewMod DLL (Debug)
uses: actions/upload-artifact@v4
with:
name: NewMod-Debug
path: NewMod/bin/Debug/net6.0/NewMod.dll
- name: Upload NewMod DLL (Android)
uses: actions/upload-artifact@v4
with:
name: NewMod-Android
path: NewMod/bin/ANDROID/net6.0/NewMod.dll
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch'
permissions:
contents: write
steps:
- name: Download Release DLL
uses: actions/download-artifact@v4
with:
name: NewMod
path: ./release_artifacts
- name: Publish GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
files: ./release_artifacts/**/NewMod.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}