-
-
Notifications
You must be signed in to change notification settings - Fork 420
43 lines (42 loc) · 1.33 KB
/
dotnet.yml
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
name: .NET Build
on:
push:
pull_request:
branches:
- master
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup msbuild
uses: microsoft/[email protected]
- name: Install dependencies
run: msbuild -t:restore
- name: Build project
run: msbuild ModAssistant/ModAssistant.csproj /t:Build /p:Configuration=Release
- name: Cleanup release
shell: bash
run: |
find "ModAssistant/bin/Release" -type f ! -name "ModAssistant.exe" -delete
cp "LICENSE" "ModAssistant/bin/Release/LICENSE.ModAssistant.txt"
- name: Upload Build
if: startsWith(github.ref, 'refs/tags/') == false
uses: actions/upload-artifact@v3
with:
name: ModAssistant-${{ github.sha }}
path: ./ModAssistant/bin/Release/
- name: Extract Release Version
if: startsWith(github.ref, 'refs/tags/')
id: get_version
shell: bash
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Mod Assistant v${{ steps.get_version.outputs.version }}
files: ./ModAssistant/bin/Release/ModAssistant.exe