Skip to content

Commit 1e52247

Browse files
committed
Test
1 parent 9e17711 commit 1e52247

2 files changed

Lines changed: 78 additions & 51 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This script build Exiled and LabAPI version of HSM and release both DLLs with release note.
2+
name: Build and Release
3+
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-and-release:
9+
runs-on: windows-latest
10+
11+
steps:
12+
- name: Checkout source
13+
uses: actions/checkout@v4
14+
15+
- name: Setup MSBuild
16+
uses: microsoft/setup-msbuild@v2
17+
18+
- name: Restore NuGet packages
19+
run: nuget restore HintServiceMeow.sln
20+
21+
# Build for LabAPI
22+
- name: Build with LabAPI
23+
run: msbuild HintServiceMeow/HintServiceMeow.csproj /p:Platform=x64 /p:Configuration=Release /p:OutputPath=bin/Release/LabAPI/
24+
25+
# Build for Exiled
26+
- name: Build with Exiled
27+
run: msbuild HintServiceMeow/HintServiceMeow.csproj /p:Platform=x64 /p:Configuration=Release /p:DefineConstants=EXILED /p:OutputPath=bin/Release/Exiled/
28+
29+
# Rename output DLLs
30+
- name: Rename output DLLs
31+
run: |
32+
mv HintServiceMeow/bin/Release/LabAPI/HintServiceMeow.dll HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
33+
mv HintServiceMeow/bin/Release/Exiled/HintServiceMeow.dll HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
34+
35+
# Backup build result
36+
- name: Upload build artifacts
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: DLLs
40+
path: |
41+
HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
42+
HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
43+
44+
# Get Tag name
45+
- name: Get tag name
46+
id: get_tag
47+
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
48+
49+
# Get commit message
50+
- name: Get commit message
51+
id: get_commit_msg
52+
run: |
53+
echo "commit_msg<<EOF" >> $GITHUB_OUTPUT
54+
git log -1 --pretty=%B >> $GITHUB_OUTPUT
55+
echo "EOF" >> $GITHUB_OUTPUT
56+
57+
#Generate release
58+
- name: Create Release and Upload DLLs
59+
uses: softprops/action-gh-release@v2
60+
with:
61+
files: |
62+
HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
63+
HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
64+
body: |
65+
### ${{ steps.get_tag.outputs.tag }}
66+
${{ steps.get_commit_msg.outputs.commit_msg }}
67+
68+
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).
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,31 @@
11
# This script build Exiled and LabAPI version of HSM and release both DLLs with release note.
2-
name: Build and Release
2+
name: Test
33

44
on:
55
push:
66
tags:
77
- 'v*'
88
- 'V*'
9-
workflow_dispatch:
109

1110
jobs:
12-
build-and-release:
11+
Test:
1312
runs-on: windows-latest
1413

1514
steps:
16-
- name: Checkout source
17-
uses: actions/checkout@v4
18-
19-
- name: Setup MSBuild
20-
uses: microsoft/setup-msbuild@v2
21-
22-
- name: Restore NuGet packages
23-
run: nuget restore HintServiceMeow.sln
24-
25-
# Build for LabAPI
26-
- name: Build with LabAPI
27-
run: msbuild HintServiceMeow/HintServiceMeow.csproj /p:Platform=x64 /p:Configuration=Release /p:OutputPath=bin/Release/LabAPI/
28-
29-
# Build for Exiled
30-
- name: Build with Exiled
31-
run: msbuild HintServiceMeow/HintServiceMeow.csproj /p:Platform=x64 /p:Configuration=Release /p:DefineConstants=EXILED /p:OutputPath=bin/Release/Exiled/
32-
33-
# Rename output DLLs
34-
- name: Rename output DLLs
35-
run: |
36-
mv HintServiceMeow/bin/Release/LabAPI/HintServiceMeow.dll HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
37-
mv HintServiceMeow/bin/Release/Exiled/HintServiceMeow.dll HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
38-
39-
# Backup build result
40-
- name: Upload build artifacts
41-
uses: actions/upload-artifact@v4
42-
with:
43-
name: DLLs
44-
path: |
45-
HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
46-
HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
47-
48-
# Get Tag name
4915
- name: Get tag name
5016
id: get_tag
17+
shell: bash
5118
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
5219

53-
# Get commit message
5420
- name: Get commit message
5521
id: get_commit_msg
22+
shell: bash
5623
run: |
5724
echo "commit_msg<<EOF" >> $GITHUB_OUTPUT
5825
git log -1 --pretty=%B >> $GITHUB_OUTPUT
5926
echo "EOF" >> $GITHUB_OUTPUT
60-
61-
#Generate release
62-
- name: Create Release and Upload DLLs
63-
uses: softprops/action-gh-release@v2
64-
with:
65-
files: |
66-
HintServiceMeow/bin/Release/HintServiceMeow-LabAPI.dll
67-
HintServiceMeow/bin/Release/HintServiceMeow-Exiled.dll
68-
body: |
69-
### ${{ steps.get_tag.outputs.tag }}
70-
${{ steps.get_commit_msg.outputs.commit_msg }}
7127
72-
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).
73-
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Debug tag
29+
run: echo "${{ steps.get_tag.outputs.tag }}"
30+
- name: Debug commit msg
31+
run: echo "${{ steps.get_commit_msg.outputs.commit_msg }}"

0 commit comments

Comments
 (0)