1
+ name : Build for Release
2
+
3
+ on :
4
+ release :
5
+ types : [published]
6
+
7
+ jobs :
8
+ build :
9
+ runs-on : ubuntu-latest
10
+ permissions :
11
+ contents : write
12
+
13
+ strategy :
14
+ matrix :
15
+ runtime : [win-x64, linux-x64, osx-x64]
16
+ include :
17
+ - runtime : win-x64
18
+ artifact_path : ./bin/Wpf/Release/net48/win-x64
19
+ self_contained : " --no-self-contained"
20
+ framework : net48
21
+ nt_file : nexttrace_windows_amd64.exe
22
+ - runtime : linux-x64
23
+ artifact_path : ./bin/Gtk/Release/net6.0/linux-x64
24
+ self_contained : " --self-contained"
25
+ framework : net6.0
26
+ nt_file : nexttrace_linux_amd64
27
+ - runtime : osx-x64
28
+ artifact_path : ./bin/Mac64/Release/net6.0/osx-x64
29
+ self_contained : " --self-contained"
30
+ framework : net6.0
31
+ nt_file : nexttrace_darwin_amd64
32
+
33
+ steps :
34
+ - name : Checkout
35
+ uses : actions/checkout@v2
36
+ with :
37
+ fetch-depth : 0
38
+
39
+ - name : Setup .NET
40
+ uses : actions/setup-dotnet@v3
41
+ with :
42
+ dotnet-version : 6
43
+
44
+ - name : Build
45
+ run : dotnet build OpenTrace.csproj --runtime ${{ matrix.runtime }} --configuration Release ${{ matrix.self_contained }} -f ${{ matrix.framework }}
46
+
47
+ - name : Fetch Nexttrace Version
48
+ run : |
49
+ release="${{ github.event.release.body }} "
50
+ echo "ntver=$(echo $release | grep -E -o nexttrace_version:.\*? | cut -d':' -f2)" >> $GITHUB_ENV
51
+
52
+ - name : Download Nexttrace
53
+
54
+ with :
55
+ repository : nxtrace/NTrace-V1
56
+ fileName : ${{ matrix.nt_file }}
57
+ latest : ${{ env.ntver == '' && true || false }}
58
+ tag : ${{ env.ntver }}
59
+ token : ${{ secrets.GITHUB_TOKEN }}
60
+ out-file-path : ${{ matrix.artifact_path }}
61
+
62
+ - name : Package
63
+ run : |
64
+ cd ${{ matrix.artifact_path }}
65
+ mv ./nexttrace_* ./nexttrace
66
+ chmod +x ./nexttrace
67
+ tar -cvzf ../../../../../${{ matrix.runtime }}.tar.gz .
68
+
69
+ - name : Edit release for ${{ matrix.runtime }}
70
+ uses : svenstaro/upload-release-action@v2
71
+ with :
72
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
73
+ file : ${{ matrix.runtime }}.tar.gz
74
+ asset_name : ${{ matrix.runtime }}.tar.gz
75
+ tag : ${{ github.ref }}
0 commit comments