-
Notifications
You must be signed in to change notification settings - Fork 15
81 lines (68 loc) · 2.7 KB
/
test.yml
File metadata and controls
81 lines (68 loc) · 2.7 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
# This script build Exiled and LabAPI version of HSM and release both DLLs with release note.
name: Build and Release
on:
push:
tags:
- 'v*'
- 'V*'
workflow_dispatch:
jobs:
build-and-release:
runs-on: windows-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Restore NuGet packages
run: nuget restore HintServiceMeow.sln
# Build for LabAPI
- name: Build with LabAPI
run: msbuild HintServiceMeow/HintServiceMeow.csproj /p:Platform=x64 /p:Configuration=Release /p:OutputPath=bin/Release/LabAPI/
# Build for Exiled
- name: Build with Exiled
run: msbuild HintServiceMeow/HintServiceMeow.csproj /p:Platform=x64 /p:Configuration=Release /p:DefineConstants=EXILED /p:OutputPath=bin/Release/Exiled/
# Rename output DLLs
- name: Rename output DLLs
run: |
mv HintServiceMeow/bin/Release/LabAPI/HintServiceMeow.dll HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
mv HintServiceMeow/bin/Release/Exiled/HintServiceMeow.dll HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
# Backup build result
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: DLLs
path: |
HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
# Get Tag name
- name: Get tag name
id: get_tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
# Get commit message
- name: Get commit message
id: get_commit_msg
run: |
echo "commit_msg<<EOF" >> $GITHUB_OUTPUT
git log -1 --pretty=%B >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Generate Release Note
- name: Set release body
id: set_body
run: |
echo "body<<EOF" >> $GITHUB_OUTPUT
echo "### ${{ steps.get_tag.outputs.tag }}" >> $GITHUB_OUTPUT
echo "${{ steps.get_commit_msg.outputs.commit_msg }}" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "Please back up your older version before updating to the new version! If you have any issues, please let me know on the Discord server (and if applicable, pull up an issue on GitHub)." >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Release both DLLs
- name: Create Release and Upload DLLs
uses: softprops/action-gh-release@v2
with:
files: |
HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
body: ${{ steps.set_body.outputs.body }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}