-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (62 loc) · 2.27 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
name: Build and Release HsrGraphicsTool
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
architecture: [x86, x64]
self-contained: ['true', 'false']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x' # Specify your .NET version here
- name: Restore dependencies
run: dotnet restore HsrGraphicsTool/HsrGraphicsTool.csproj
- name: Build project
run: |
dotnet publish HsrGraphicsTool/HsrGraphicsTool.csproj -c Release -r win-${{ matrix.architecture }} `--self-contained ${{ matrix.self-contained }}
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: HsrGraphicsTool-${{ matrix.architecture }}${{ matrix.self-contained == 'false' && '-fd' || '' }}
path: |
HsrGraphicsTool/bin/windows/Release/net8.0-windows/win-${{ matrix.architecture }}/publish/*
release:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: HsrGraphicsTool-x*
merge-multiple: false
- name: Rename executables by architecture
run: |
mv HsrGraphicsTool-x86/HsrGraphicsTool.exe HsrGraphicsTool_x86.exe && \
mv HsrGraphicsTool-x64/HsrGraphicsTool.exe HsrGraphicsTool_x64.exe && \
mv HsrGraphicsTool-x86-fd/HsrGraphicsTool.exe HsrGraphicsTool_x86_fd.exe && \
mv HsrGraphicsTool-x64-fd/HsrGraphicsTool.exe HsrGraphicsTool_x64_fd.exe
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
draft: false
prerelease: false
body: |
This is an automated release direct from source using GitHub Actions.
The '_fd' versions have smaller exe, but require the .NET 8 runtime to be installed.
files: |
HsrGraphicsTool_x86.exe
HsrGraphicsTool_x64.exe
HsrGraphicsTool_x64_fd.exe
HsrGraphicsTool_x86_fd.exe