File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish
2+
3+ on :
4+ workflow_dispatch :
5+
6+ jobs :
7+ build :
8+ strategy :
9+ matrix :
10+ os : [ubuntu-latest, windows-latest]
11+ include :
12+ - os : ubuntu-latest
13+ rid : linux-x64
14+ ext : " "
15+ - os : windows-latest
16+ rid : win-x64
17+ ext : " .exe"
18+ runs-on : ${{ matrix.os }}
19+ steps :
20+ - uses : actions/checkout@v4
21+
22+ - name : Setup .NET
23+ uses : actions/setup-dotnet@v4
24+ with :
25+ dotnet-version : 10.0.x
26+
27+ - name : Publish
28+ run : >
29+ dotnet publish src/GeneralUpdate.Tools.csproj
30+ -c Release
31+ -r ${{ matrix.rid }}
32+ -p:PublishSingleFile=true
33+ -p:PublishTrimmed=true
34+ --self-contained
35+ -o publish/${{ matrix.rid }}
36+
37+ - name : Get timestamp
38+ id : ts
39+ shell : bash
40+ run : echo "timestamp=$(date -u '+%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
41+
42+ - name : Package (Windows)
43+ if : matrix.os == 'windows-latest'
44+ shell : pwsh
45+ run : |
46+ Compress-Archive -Path publish/${{ matrix.rid }}/GeneralUpdate.Tools.exe -DestinationPath GeneralUpdate.Tools_${{ steps.ts.outputs.timestamp }}_win-x64.zip
47+
48+ - name : Package (Linux)
49+ if : matrix.os == 'ubuntu-latest'
50+ run : |
51+ cd publish/${{ matrix.rid }}
52+ zip ../../GeneralUpdate.Tools_${{ steps.ts.outputs.timestamp }}_linux-x64.zip GeneralUpdate.Tools
53+
54+ - name : Upload artifact
55+ uses : actions/upload-artifact@v4
56+ with :
57+ name : GeneralUpdate.Tools_${{ steps.ts.outputs.timestamp }}_${{ matrix.rid }}
58+ path : GeneralUpdate.Tools_${{ steps.ts.outputs.timestamp }}_${{ matrix.rid }}.zip
You can’t perform that action at this time.
0 commit comments