6
6
- main # Trigger on pushes to main branch
7
7
8
8
jobs :
9
- build :
9
+ # Windows Build Job
10
+ windows-build :
10
11
runs-on : ubuntu-latest
11
12
12
13
steps :
13
14
# Step 1: Checkout the code
14
15
- name : Checkout code
15
16
uses : actions/checkout@v3
16
17
17
- # Step 2: Set up .NET
18
+ # Step 2: Set up .NET for Windows
18
19
- name : Set up .NET
19
20
uses : actions/setup-dotnet@v3
20
21
with :
@@ -24,14 +25,14 @@ jobs:
24
25
- name : Restore dependencies
25
26
run : dotnet restore
26
27
27
- # Step 4: Publish the project
28
- - name : Publish the application
28
+ # Step 4: Publish the project as a single file for Windows 64-bit
29
+ - name : Publish the application (Windows)
29
30
run : dotnet publish -c Release -r win-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true -o ./publish
30
31
31
- # Step 5: Zip the publish folder
32
- - name : Zip the publish folder
33
- run : zip -r ./publish/published_app .zip ./publish
34
-
32
+ # Step 5: Zip the Windows publish folder
33
+ - name : Zip the Windows publish folder
34
+ run : zip -r ./publish/win64 .zip ./publish
35
+
35
36
# Step 6: Delete existing nightly release and tag if it exists
36
37
- name : Delete existing nightly release and tag
37
38
env :
@@ -54,13 +55,55 @@ jobs:
54
55
draft : false
55
56
prerelease : true # Mark as prerelease if you want to differentiate
56
57
57
- # Step 8: Upload published files to release
58
- - name : Upload .NET Publish Artifacts
58
+ # Step 8: Upload Windows build to release
59
+ - name : Upload Windows Build Artifact
59
60
uses : actions/upload-release-asset@v1
60
61
env :
61
62
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
62
63
with :
63
64
upload_url : ${{ steps.create_release.outputs.upload_url }}
64
- asset_path : ./publish/published_app .zip
65
+ asset_path : ./publish/win64 .zip
65
66
asset_name : win64.zip
66
67
asset_content_type : application/zip
68
+
69
+ # Linux Build Job
70
+ linux-build :
71
+ runs-on : ubuntu-latest
72
+
73
+ steps :
74
+ # Step 1: Checkout the code
75
+ - name : Checkout code
76
+ uses : actions/checkout@v3
77
+
78
+ # Step 2: Set up .NET for Linux
79
+ - name : Set up .NET
80
+ uses : actions/setup-dotnet@v3
81
+ with :
82
+ dotnet-version : ' 6.0.x' # Specify your .NET version
83
+
84
+ # Step 3: Restore dependencies
85
+ - name : Restore dependencies
86
+ run : dotnet restore
87
+
88
+ # Step 4: Publish the project as a single file for Linux 64-bit
89
+ - name : Publish the application (Linux)
90
+ run : dotnet publish -c Release -r linux-x64 -p:PublishSingleFile=true -p:PublishTrimmed=true -o ./publish
91
+
92
+ # Step 5: Copy the native library
93
+ - name : Copy libsteam_api.so to publish folder
94
+ run : cp ./NativeLibraries/linux64/libsteam_api.so ./publish/
95
+
96
+ # Step 6: Zip the Linux publish folder
97
+ - name : Zip the Linux publish folder
98
+ run : zip -r ./publish/linux64.zip ./publish
99
+
100
+ # Step 7: Upload Linux build to release
101
+ - name : Upload Linux Build Artifact
102
+ uses : actions/upload-release-asset@v1
103
+ env :
104
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
105
+ with :
106
+ upload_url : ${{ steps.windows-build.outputs.create_release.outputs.upload_url }}
107
+ asset_path : ./publish/linux64.zip
108
+ asset_name : linux64.zip
109
+ asset_content_type : application/zip
0 commit comments