Фикс порций под другие моды #2545
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Build server' | |
on: | |
push: | |
branches: | |
- '**' | |
paths: | |
- '.github/workflows/**' | |
- 'gamedata/**' | |
- 'sdk/**' | |
- 'src/**' | |
- '**/CMakeLists.txt' | |
- '**/*.ltx' | |
- '**/*.json' | |
pull_request: | |
branches: | |
- '**' | |
paths: | |
- '.github/workflows/**' | |
- 'gamedata/**' | |
- 'sdk/**' | |
- 'src/**' | |
- '**/CMakeLists.txt' | |
- '**/*.ltx' | |
- '**/*.json' | |
defaults: | |
run: | |
shell: pwsh | |
jobs: | |
build-server: | |
name: 'Build server' | |
strategy: | |
matrix: | |
system: | |
- windows-2022 | |
preset: | |
- Server | |
platform: | |
- x64 | |
config: | |
- Debug | |
- RelWithDebInfo | |
- Release | |
runs-on: ${{ matrix.system }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache packages | |
uses: actions/cache@v4 | |
with: | |
key: ${{ matrix.preset }}-NuGet-${{ hashFiles('**/Packages.config') }} | |
restore-keys: | | |
${{ matrix.preset }}-NuGet-${{ hashFiles('**/Packages.config') }} | |
${{ matrix.preset }}-NuGet- | |
path: | | |
~/.nuget/packages | |
- name: Configure server | |
run: | | |
cmake ` | |
--preset ${{ matrix.preset }}-${{ matrix.platform }}-${{ runner.os }} | |
- name: Build server | |
run: | | |
cmake ` | |
--build ` | |
--preset ${{ matrix.preset }}-${{ matrix.platform }}-${{ runner.os }}-${{ matrix.config }} | |
- name: Upload binaries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server-binaries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }} | |
path: | | |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.exe | |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.dll | |
- name: Upload symbols | |
uses: actions/upload-artifact@v4 | |
if: ${{ matrix.config != 'Release' }} | |
with: | |
name: server-symbols-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }} | |
path: | | |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.pdb | |
- name: Upload libraries | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server-libraries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }} | |
path: | | |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/lib/${{ matrix.config }}/ | |
- name: Upload packages | |
uses: actions/upload-artifact@v4 | |
if: ${{ (matrix.config == 'Debug' && matrix.platform == 'x64') }} | |
with: | |
name: server-packages-${{ matrix.system }}-${{ github.sha }} | |
path: | | |
build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/packages/ | |
pack-assets: | |
name: 'Pack assets' | |
needs: | |
- build-server | |
strategy: | |
matrix: | |
system: | |
- windows-2022 | |
runs-on: ${{ matrix.system }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup compressor | |
uses: ixray-team/[email protected] | |
with: | |
codebase: '1.6-stcop' | |
- name: Generate patch | |
run: | | |
${{ github.workspace }}/util/generate-patch.bat ` | |
xrCompress.exe | |
type ` | |
*.log | |
move ` | |
${{ github.workspace }}/gamedata ` | |
${{ github.workspace }}/gamedata_full | |
move ` | |
${{ github.workspace }}/patch ` | |
${{ github.workspace }}/gamedata | |
- name: Upload assets | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server-assets-${{ github.sha }} | |
path: | | |
gamedata/ | |
patches/xpatch_03.db | |
.xrignore | |
fsgame.ltx | |
include-hidden-files: true | |
publish-server: | |
name: 'Publish server' | |
needs: | |
- pack-assets | |
strategy: | |
matrix: | |
system: | |
- windows-2022 | |
platform: | |
- x64 | |
preset: | |
- Server | |
config: | |
- RelWithDebInfo | |
runs-on: ${{ matrix.system }} | |
steps: | |
- name: Get server | |
uses: actions/download-artifact@v4 | |
with: | |
name: server-binaries-${{ matrix.system }}-${{ matrix.platform }}-${{ matrix.config }}-${{ github.sha }} | |
path: build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/ | |
- name: Get assets | |
uses: actions/download-artifact@v4 | |
with: | |
name: server-assets-${{ github.sha }} | |
path: ./ | |
- name: Move files | |
run: | | |
mkdir ` | |
${{ github.workspace }}/bin | |
move ` | |
${{ github.workspace }}/build/${{ matrix.platform }}/${{ matrix.preset }}-${{ runner.os }}/bin/${{ matrix.config }}/*.* ` | |
${{ github.workspace }}/bin | |
- name: Upload server | |
uses: actions/upload-artifact@v4 | |
with: | |
name: server-publish-${{ matrix.system }}-${{ matrix.platform }}-${{ github.sha }} | |
path: | | |
bin/ | |
gamedata/ | |
patches/xpatch_03.db | |
.xrignore | |
fsgame.ltx | |
include-hidden-files: true |