-
-
Notifications
You must be signed in to change notification settings - Fork 14
73 lines (66 loc) · 2.38 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
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
name: .NET 6
on:
push:
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'
jobs:
build:
outputs:
product_version: ${{ steps.get_release_name.outputs.PRODUCT }}
runs-on: windows-latest
env:
DOTNET_CLI_TELEMETRY_OPTOUT : true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # avoid shallow clone so nbgv can do its work.
- name: setup-msbuild
uses: microsoft/setup-msbuild@v2
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Enable developer command prompt
uses: ilammy/msvc-dev-cmd@v1
- name: Build native binaries (ToolHooks)
run: msbuild ToolkitLauncher.sln -target:H2ToolHooks -property:Configuration=Release -maxCpuCount
- name: Build native binaries (GetProcAddrHelper)
run: msbuild ToolkitLauncher.sln -target:GetProcAddrHelper -property:Configuration=Release -maxCpuCount
- name: Build
run: dotnet build .\Launcher\ToolkitLauncher.csproj --configuration Release --no-restore
- name: Test
run: dotnet test .\Launcher\ToolkitLauncher.csproj --no-restore --verbosity normal
- name: Publish
run: dotnet publish .\Launcher\ToolkitLauncher.csproj -c Release -r win-x64 -P:PublishSingleFile=true -p:PublishTrimmed=false --self-contained false
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: launcher
path: Launcher\bin\x64\Release\net6.0-windows\win-x64\publish\
- name: Get release name
shell: pwsh
id: get_release_name
run: echo "PRODUCT=$((Get-Item -Path 'Launcher\bin\x64\Release\net6.0-windows\win-x64\publish\Osoyoos.exe').VersionInfo.ProductVersion)" >> $env:GITHUB_OUTPUT
release:
if: |
github.event.action != 'pull_request' &&
(github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') &&
github.repository == 'num0005/Osoyoos-Launcher'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: launcher
path: Launcher_win64
- uses: ncipollo/release-action@v1
with:
prerelease: true
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: Launcher_win64/*
tag: ${{ needs.build.outputs.product_version }}