File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : “Publish Single-File Binaries”
2
+
3
+ # run on pushes to main or manually
4
+ on :
5
+ push :
6
+ branches : [ main ]
7
+ workflow_dispatch :
8
+
9
+ jobs :
10
+ publish :
11
+ # matrix: build on Ubuntu and Windows
12
+ runs-on : ${{ matrix.os }}
13
+ strategy :
14
+ matrix :
15
+ include :
16
+ - os : ubuntu-latest
17
+ rid : linux-x64
18
+ - os : windows-latest
19
+ rid : win-x64
20
+
21
+ steps :
22
+ - name : Checkout repo
23
+ uses : actions/checkout@v3
24
+
25
+ - name : Setup .NET SDK
26
+ uses : actions/setup-dotnet@v3
27
+ with :
28
+ dotnet-version : ' 8.0.x' # or your target SDK
29
+
30
+ - name : Restore dependencies
31
+ run : dotnet restore
32
+
33
+ - name : Publish single-file executable
34
+ run : |
35
+ dotnet publish SlipperyPete.sln \
36
+ --configuration Release \
37
+ --runtime ${{ matrix.rid }} \
38
+ --self-contained true \
39
+ /p:PublishSingleFile=true \
40
+ /p:PublishTrimmed=true \
41
+ --output artifacts/${{ matrix.rid }}
42
+
43
+ - name : Upload build artifact
44
+ uses : actions/upload-artifact@v3
45
+ with :
46
+ name : app-${{ matrix.rid }}
47
+ path : artifacts/${{ matrix.rid }}
You can’t perform that action at this time.
0 commit comments