-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.23 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
name: Publish
on:
release:
types: [published]
jobs:
release:
name: Release
strategy:
matrix:
kind: ['windows']
include:
- kind: windows
os: windows-latest
target: win-x64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Build
shell: bash
run: |
tag=$(git describe --tags --abbrev=0)
release_name="ServiceMonitor-$tag-${{ matrix.target }}"
dotnet publish src/ServiceMonitor/ServiceMonitor.csproj --framework net8.0 --runtime "${{ matrix.target }}" --no-self-contained -p:PublishSingleFile=true -c Release -o "$release_name"
if [ "${{ matrix.target }}" == "win-x64" ]; then
7z a -tzip "${release_name}.zip" "./${release_name}/*"
else
tar czvf "${release_name}.tar.gz" "$release_name"
fi
rm -r "$release_name"
- name: Publish
uses: softprops/action-gh-release@v2
with:
files: "ServiceMonitor-*"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}