forked from Thundermaker300/RoundReports
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (61 loc) · 2.21 KB
/
Copy pathdev-build.yml
File metadata and controls
75 lines (61 loc) · 2.21 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
name: Build and DEV Release
on:
push:
branches:
- dev
workflow_dispatch:
env:
REFERENCES_URL: https://exslmod-team.github.io/SL-References/Dev.zip
REFERENCES_PATH: ${{ github.workspace }}/References
EXILED_REFERENCES: ${{ github.workspace }}/References
jobs:
build:
name: 🛠️ Build Project
runs-on: windows-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🔧 Restore NuGet packages
run: nuget restore
- name: 📦 Download dependencies
shell: pwsh
run: |
Invoke-WebRequest -Uri $env:REFERENCES_URL -OutFile "$env:GITHUB_WORKSPACE/Dev.zip" -ErrorAction Stop
Expand-Archive -Path "$env:GITHUB_WORKSPACE/Dev.zip" -DestinationPath $env:REFERENCES_PATH
- name: 🧱 Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: 🏗️ Build the DLL
run: |
msbuild RoundReports\RoundReports.csproj -t:rebuild -property:Configuration=Release -property:ReferencePath="${{ env.REFERENCES_PATH }}"
- name: 📤 Upload built DLL
uses: actions/upload-artifact@v4
with:
name: RoundReports
path: RoundReports/bin/Release/net4.8.1/RoundReports.dll
release:
name: 🚀 Create DEV Release
needs: build
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: 🏷️ Extract version from MainPlugin.cs
id: get_version
run: |
VERSION=$(grep -Po 'Version\s*=>\s*new\s*\(\K[0-9]+,[ ]*[0-9]+,[ ]*[0-9]+' RoundReports/MainPlugin.cs | head -n1 | tr -d ' ' | tr ',' '.')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: 📦 Download build artifact
uses: actions/download-artifact@v4
with:
name: RoundReports
path: artifact
- name: 🚀 Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ steps.get_version.outputs.version }}-dev
name: v${{ steps.get_version.outputs.version }}
draft: false
prerelease: true
files: artifact/RoundReports.dll
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}