-
Notifications
You must be signed in to change notification settings - Fork 113
224 lines (185 loc) · 6.44 KB
/
release.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
default: '1.0.0.0'
version_postifx:
description: 'Version Postfix'
required: true
default: '-preview'
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: ./intermediate/vs2022/ds3os.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
# Version number being build.
VERSION_NUMBER_POSTFIX: ${{ github.event.inputs.version_postifx }}
# Version number being build.
VERSION_NUMBER: ${{ github.event.inputs.version }}
jobs:
build-windows:
name: Build Windows
runs-on: windows-2022
steps:
- name: Checkout respository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Generate Solution
shell: cmd
working-directory: ${{github.workspace}}/Tools
run: ${{github.workspace}}/Tools/generate_vs2022.bat
- name: Restore Dependencies
working-directory: ${{github.workspace}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /t:Restore
- name: Package DotNet
run: dotnet publish ./Source/Loader/Loader.csproj -r win-x64 -c Release --output ${{github.workspace}}/Bin/Loader/Package/ /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:Version=${{env.VERSION_NUMBER}}${{env.VERSION_NUMBER_POSTFIX}} /p:FileVersion=${{env.VERSION_NUMBER}} /p:AssemblyVersion=${{env.VERSION_NUMBER}}
- name: Build
working-directory: ${{github.workspace}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} /t:Build
- name: Package Release
shell: cmd
working-directory: ${{github.workspace}}
run: ${{github.workspace}}/Tools/generate_package_windows.bat
- name: Zip Release
uses: vimtor/action-zip@v1
with:
files: DS3OS/
dest: windows.zip
- name: Upload Artifact
id: upload-artifact
uses: actions/upload-artifact@master
with:
path: ./windows.zip
name: windows
build-linux:
name: Build Linux
runs-on: ubuntu-20.04
steps:
- name: Checkout respository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Generate Solution
shell: bash
working-directory: ${{github.workspace}}/Tools
run: ${{github.workspace}}/Tools/generate_make_release.sh
- name: Build
working-directory: ${{github.workspace}}/intermediate/make
run: make
- name: Package Release
shell: bash
working-directory: ${{github.workspace}}
run: ${{github.workspace}}/Tools/generate_package_linux.sh
- name: Zip Release
uses: vimtor/action-zip@v1
with:
files: DS3OS/
dest: linux.zip
- name: Upload Artifact
id: upload-artifact
uses: actions/upload-artifact@master
with:
path: ./linux.zip
name: linux
build-docker:
name: Build Docker
runs-on: ubuntu-20.04
steps:
- name: Checkout respository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Generate Solution
shell: bash
working-directory: ${{github.workspace}}/Tools
run: ${{github.workspace}}/Tools/generate_make_release.sh
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push master-server docker
uses: docker/build-push-action@v2
with:
context: ./Source/MasterServer/
file: ./Source/MasterServer/Dockerfile
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ds3os-master:latest
- name: Build and push server docker
uses: docker/build-push-action@v2
with:
context: .
file: ./DarkSouls3.Dockerfile
push: true
no-cache: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ds3os:latest
- name: Build and push server docker
uses: docker/build-push-action@v2
with:
context: .
file: ./DarkSouls2.Dockerfile
push: true
no-cache: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/ds2os:latest
make-release:
name: Make Release
needs: [ build-windows, build-linux, build-docker ]
runs-on: ubuntu-20.04
steps:
- name: Download windows artifact
id: download-windows-artifact
uses: actions/download-artifact@master
with:
name: windows
- name: Download linux artifact
id: download-linux-artifact
uses: actions/download-artifact@master
with:
name: linux
- name: Display artifacts
run: ls -R
- name: Make Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{env.VERSION_NUMBER}}${{env.VERSION_NUMBER_POSTFIX}}
release_name: Release v${{env.VERSION_NUMBER}}${{env.VERSION_NUMBER_POSTFIX}}
body: Preview build, not officially supported yet.
draft: false
prerelease: true
- name: Upload Windows Release Asset
id: upload-windows-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows.zip
asset_name: windows.zip
asset_content_type: application/zip
- name: Upload Linux Release Asset
id: upload-linux-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./linux.zip
asset_name: linux.zip
asset_content_type: application/zip