spt4.0.0(eft0.16.6.0.36679)

This commit is contained in:
AirryCo
2025-05-29 18:21:26 +08:00
parent 5c6c8fa1a4
commit 0460721bdf
5 changed files with 196 additions and 373 deletions

View File

@@ -9,10 +9,9 @@ on:
env: env:
SERVER_URL: https://github.com SERVER_URL: https://github.com
REPOSITORY_SPT_SERVER: sp-tarkov/server REPOSITORY_SPT_SERVER: sp-tarkov/server-csharp
REPOSITORY_SPT_SERVER_AIRRYCO: AirryCo/spt-server REPOSITORY_SPT_SERVER_AIRRYCO: AirryCo/spt-server
NIGHTLY_BRANCH: 3.11.x-DEV NIGHTLY_BRANCH: develop
NIGHTLY_BRANCH_FIKA: main
jobs: jobs:
prepare: prepare:
@@ -20,14 +19,13 @@ jobs:
outputs: outputs:
PROCEED: ${{ steps.compare-hash.outputs.PROCEED }} PROCEED: ${{ steps.compare-hash.outputs.PROCEED }}
PROCEED_FIKA: ${{ steps.compare-fika.outputs.PROCEED }} PROCEED_FIKA: ${{ steps.compare-fika.outputs.PROCEED }}
NIGHTLY_BRANCH_SPT: ${{ steps.get-latest-commit.outputs.NIGHTLY_BRANCH_SPT }}
BUILT_HASH: ${{ steps.compare-hash.outputs.BUILT_HASH }} BUILT_HASH: ${{ steps.compare-hash.outputs.BUILT_HASH }}
BUILT_HASH_FIKA: ${{ steps.compare-fika.outputs.BUILT_HASH }} CLIENT_VERSION: ${{ steps.versions.outputs.CLIENT_VERSION }}
SPT_VERSION: ${{ steps.versions.outputs.SPT_VERSION }} SPT_VERSION: ${{ steps.versions.outputs.SPT_VERSION }}
EFT_VERSION: ${{ steps.versions.outputs.EFT_VERSION }} SPT_COMMIT_ID: ${{ steps.versions.outputs.SPT_COMMIT_ID }}
SPT_SERVER_COMMIT: ${{ steps.versions.outputs.SPT_SERVER_COMMIT }}
FIKA_SERVER_COMMIT: ${{ steps.compare-fika.outputs.FIKA_SERVER_COMMIT }} FIKA_SERVER_COMMIT: ${{ steps.compare-fika.outputs.FIKA_SERVER_COMMIT }}
BUILD_DATE_TIME: ${{ steps.versions.outputs.DATE_TIME }} BUILD_DATE_TIME: ${{ steps.versions.outputs.DATE_TIME }}
BUILD_TYPE: BLEEDING_EDGE_MODS
steps: steps:
- name: Checkout - name: Checkout
@@ -35,13 +33,10 @@ jobs:
- name: Get Latest Commit From SPT - name: Get Latest Commit From SPT
id: get-latest-commit id: get-latest-commit
run: | run: |
branch_name=$(git ls-remote --heads https://github.com/sp-tarkov/server.git | grep -o 'refs/heads/3.11.x-dev' | sed 's|refs/heads/||' | head -n 1) SPT_COMMIT_ID=$(git ls-remote ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git refs/heads/${{ env.NIGHTLY_BRANCH }} | awk '{print $1}')
SPT_SERVER_LATEST_COMMIT_HASH=$(git ls-remote ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git refs/heads/$branch_name | awk '{print $1}') SPT_COMMIT_ID=${SPT_COMMIT_ID:0:8}
SPT_SERVER_LATEST_COMMIT_HASH=${SPT_SERVER_LATEST_COMMIT_HASH:0:8} echo "👽 SPT_COMMIT_ID = $SPT_COMMIT_ID"
echo "👽 NIGHTLY_BRANCH_SPT = $branch_name" echo "SPT_COMMIT_ID=$SPT_COMMIT_ID" >> $GITHUB_OUTPUT
echo "NIGHTLY_BRANCH_SPT=$branch_name" >> $GITHUB_OUTPUT
echo "👽 SPT_SERVER_LATEST_COMMIT_HASH = $SPT_SERVER_LATEST_COMMIT_HASH"
echo "SPT_SERVER_LATEST_COMMIT_HASH=$SPT_SERVER_LATEST_COMMIT_HASH" >> $GITHUB_OUTPUT
shell: bash shell: bash
- name: Compare Hashes - name: Compare Hashes
id: compare-hash id: compare-hash
@@ -49,7 +44,7 @@ jobs:
git pull git pull
source trigger.nightly source trigger.nightly
server_last_built_hash=${server:0:8} server_last_built_hash=${server:0:8}
server_latest_commit_hash=${{ steps.get-latest-commit.outputs.SPT_SERVER_LATEST_COMMIT_HASH }} server_latest_commit_hash=${{ steps.get-latest-commit.outputs.SPT_COMMIT_ID }}
if [ "$server_last_built_hash" != "$server_latest_commit_hash" ]; then if [ "$server_last_built_hash" != "$server_latest_commit_hash" ]; then
echo "✅ There is different between last-built-hash and lastest-commit-hash, continue to build." echo "✅ There is different between last-built-hash and lastest-commit-hash, continue to build."
echo "PROCEED=true" >> $GITHUB_OUTPUT echo "PROCEED=true" >> $GITHUB_OUTPUT
@@ -58,223 +53,132 @@ jobs:
fi fi
echo "BUILT_HASH=$server_last_built_hash" >> $GITHUB_OUTPUT echo "BUILT_HASH=$server_last_built_hash" >> $GITHUB_OUTPUT
shell: bash shell: bash
- name: Compare Fika Hashes
id: compare-fika
run: |
source trigger.nightly
fika_last_built_hash=${fika:0:8}
fika_latest_commit_hash=$(git ls-remote https://github.com/project-fika/Fika-Server.git refs/heads/${{ env.NIGHTLY_BRANCH_FIKA }} | awk '{print $1}')
fika_latest_commit_hash=${fika_latest_commit_hash:0:8};
if [ "$fika_last_built_hash" != "$fika_latest_commit_hash" ]; then
if [ ${{ steps.compare-hash.outputs.PROCEED }} == 'false' ]; then
echo "✅ There is different between fika-built-hash and fika-commit-hash, continue to build."
fi
echo "PROCEED=true" >> $GITHUB_OUTPUT
else
if [ ${{ steps.compare-hash.outputs.PROCEED }} == 'false' ]; then
echo "✋ last-built-hash and latest-commit-hash are the same, stop building."
fi
echo "PROCEED=false" >> $GITHUB_OUTPUT
fi
echo "BUILT_HASH=$fika_last_built_hash" >> $GITHUB_OUTPUT
echo "FIKA_SERVER_COMMIT=$fika_latest_commit_hash" >> $GITHUB_OUTPUT
- name: Extract versions - name: Extract versions
id: versions id: versions
if: steps.compare-hash.outputs.PROCEED == 'true' || steps.compare-fika.outputs.PROCEED == 'true' if: steps.compare-hash.outputs.PROCEED == 'true'
run: | run: |
SPT_SERVER_COMMIT=${{ steps.get-latest-commit.outputs.SPT_SERVER_LATEST_COMMIT_HASH }} SPT_COMMIT_ID=${{ steps.get-latest-commit.outputs.SPT_COMMIT_ID }}
# Extract versions from core.json # Extract versions from core.json
wget https://raw.githubusercontent.com/${{ env.REPOSITORY_SPT_SERVER }}/refs/heads/${{ steps.get-latest-commit.outputs.NIGHTLY_BRANCH_SPT }}/project/assets/configs/core.json wget https://raw.githubusercontent.com/${{ env.REPOSITORY_SPT_SERVER }}/refs/heads/${{ env.NIGHTLY_BRANCH }}/Libraries/SPTarkov.Server.Assets/Assets/configs/core.json
SPT_VERSION=$(jq -r '.sptVersion' core.json) SPT_VERSION=$(jq -r '.sptVersion' core.json)
EFT_VERSION=$(jq -r '.compatibleTarkovVersion' core.json) CLIENT_VERSION=$(jq -r '.compatibleTarkovVersion' core.json)
echo "👽 CLIENT_VERSION = $CLIENT_VERSION"
echo "👽 SPT_VERSION = $SPT_VERSION" echo "👽 SPT_VERSION = $SPT_VERSION"
echo "👽 EFT_VERSION = $EFT_VERSION" echo "👽 SPT_COMMIT_ID = $SPT_COMMIT_ID"
echo "👽 SPT_SERVER_COMMIT = $SPT_SERVER_COMMIT"
echo "CLIENT_VERSION=$CLIENT_VERSION" >> $GITHUB_OUTPUT
echo "SPT_VERSION=$SPT_VERSION" >> $GITHUB_OUTPUT echo "SPT_VERSION=$SPT_VERSION" >> $GITHUB_OUTPUT
echo "EFT_VERSION=$EFT_VERSION" >> $GITHUB_OUTPUT echo "SPT_COMMIT_ID=$SPT_COMMIT_ID" >> $GITHUB_OUTPUT
echo "SPT_SERVER_COMMIT=$SPT_SERVER_COMMIT" >> $GITHUB_OUTPUT echo "DATE_TIME=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
echo "DATE_TIME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
shell: bash shell: bash
build-fika-server: build-server-host:
needs: prepare needs: prepare
if: needs.prepare.outputs.PROCEED == 'true' if: needs.prepare.outputs.PROCEED == 'true'
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: refringe/spt-build-dotnet:2.0.2
outputs: outputs:
FIKA_ARTIFACT: ${{ steps.filename.outputs.FIKA_ARTIFACT }} COMMIT_ID_LONG: ${{ steps.debug-info.outputs.COMMIT_ID_LONG }}
COMMIT_ID_SHORT: ${{ steps.debug-info.outputs.COMMIT_ID_SHORT }}
steps: SPT_COMMIT_TIME: ${{ steps.debug-info.outputs.SPT_COMMIT_TIME }}
- name: Checkout WIN_ARTIFACT: ${{ steps.filename.outputs.WIN_ARTIFACT }}
uses: actions/checkout@v4 WIN_RELEASE_FILE: ${{ steps.filename.outputs.WIN_RELEASE }}
with:
repository: 'project-fika/Fika-Server'
ref: '${{ env.NIGHTLY_BRANCH_FIKA }}'
fetch-depth: '1'
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.12.0
- name: Cache NPM Dependencies
id: cache-npm-dependencies
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-npm-dependencies-fika-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-npm-dependencies-fika-
- name: Install NPM Dependencies
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
run: |
npm install
shell: pwsh
- name: Build Fika Server
id: build-server
run: |
npm run build
mkdir output
cd output
unzip ../dist/*.zip
shell: bash
- name: Generate Artifact File Name
id: filename
run: |
artifact_name=Fika-Server-nightly-${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }}-artifact
echo "FIKA_ARTIFACT=$artifact_name" >> $GITHUB_OUTPUT
shell: bash
- name: Artifact Fika Server
uses: actions/upload-artifact@v4
with:
name: ${{ steps.filename.outputs.FIKA_ARTIFACT }}
path: output
overwrite: true
build-server-linux:
needs: [prepare, build-fika-server]
if: needs.prepare.outputs.PROCEED == 'true'
runs-on: ubuntu-latest
env:
OUTPUT_DIR: spt-server
outputs:
SPT_SERVER_COMMIT_TIME: ${{ steps.merge.outputs.SPT_SERVER_COMMIT_TIME }}
LINUX_COMMIT_ID: ${{ steps.debug-info.outputs.COMMIT_ID }}
LINUX_COMMIT_ID_WHOLE: ${{ steps.debug-info.outputs.COMMIT_ID_WHOLE }}
LINUX_ARTIFACT: ${{ steps.filename.outputs.LINUX_ARTIFACT }} LINUX_ARTIFACT: ${{ steps.filename.outputs.LINUX_ARTIFACT }}
LINUX_RELEASE_FILE: ${{ steps.filename.outputs.LINUX_RELEASE }} LINUX_RELEASE_FILE: ${{ steps.filename.outputs.LINUX_RELEASE }}
LINUX_RELEASE_FIKA_FILE: ${{ steps.filename.outputs.LINUX_RELEASE_FIKA }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
repository: '${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}'
ref: '${{ env.NIGHTLY_BRANCH }}'
lfs: 'false'
fetch-depth: '0'
token: '${{ secrets.AIRRYCO_TOKEN }}'
- name: Setup Git Config - name: Clone Server
run: | run: |
git config --global user.name "github-actions[bot]" git clone -b ${{ env.NIGHTLY_BRANCH_NAME }} --depth=1 https://git.rui.he.cn:3000/SP-Tarkov/server-csharp.git /snapshot
git config --global user.email "bot@github.com" cd /snapshot
shell: bash
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.12.0
- name: Merge Server Code From SPT
id: merge
run: |
git config -f .lfsconfig lfs.url https://${{ secrets.GITEA_PUSH_TOKEN }}:@git.rui.he.cn:3000/henry/spt-server.git/info/lfs
git lfs pull git lfs pull
git fetch -u ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git ${{ needs.prepare.outputs.NIGHTLY_BRANCH_SPT }}:SPT-${{ env.NIGHTLY_BRANCH }}
git merge -m "🤖 Merge branch '${{ env.NIGHTLY_BRANCH }}' from SPT" --no-ff SPT-${{ env.NIGHTLY_BRANCH }}
SPT_SERVER_COMMIT_TIME=$(git log --pretty=format:"%ai" SPT-${{ env.NIGHTLY_BRANCH }} -1)
echo "👽 SPT_SERVER_COMMIT_TIME = $SPT_SERVER_COMMIT_TIME"
echo "SPT_SERVER_COMMIT_TIME=$SPT_SERVER_COMMIT_TIME" >> $GITHUB_OUTPUT
shell: bash
- name: Runner Debug Information - name: Runner Debug Information
id: debug-info id: debug-info
run: | run: |
cd /snapshot
echo "git version: $(git --version)" echo "git version: $(git --version)"
echo "git lfs version: $(git-lfs --version)" echo "git lfs version: $(git-lfs --version)"
echo "node.js version: $(node --version)"
echo "npm version: $(npm --version)"
echo "latest commit hash: $(git rev-parse HEAD)" echo "latest commit hash: $(git rev-parse HEAD)"
echo "last commit message:" && git log -1 --pretty=%B echo "last commit message:" && git log -1 --pretty=%B
echo "COMMIT_ID=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "COMMIT_ID_WHOLE=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT echo "COMMIT_ID_LONG=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "COMMIT_ID_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "SPT_COMMIT_TIME"=$(git log --pretty=format:"%ai" ${{ env.NIGHTLY_BRANCH_NAME }} -1) >> $GITHUB_OUTPUT
shell: bash shell: bash
- name: Cache NPM Dependencies - name: Replace Background Image
id: cache-npm-dependencies id: bg
uses: actions/cache@v4
with:
path: |
project/node_modules
key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('project/package.json') }}
restore-keys: |
${{ runner.os }}-npm-dependencies-
- name: Install NPM Dependencies
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
run: | run: |
cd project cp custom/bg.png /snapshot/Libraries/SPTarkov.Server.Assets/Assets/images/launcher/
npm install
shell: bash shell: bash
- name: Build Linux Server - name: Replace projectName For Windows
id: build-server
run: | run: |
cd project cd /snapshot/Libraries/SPTarkov.Server.Assets/Assets/configs
npm run build:release git checkout core.json
ls -l build sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Windows\",/g" core.json
mv build ${{ env.OUTPUT_DIR }}
shell: bash shell: bash
- name: Generate Linux File Name - name: Publish Windows Server
run: |
cd /snapshot
dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj -c Release -f net9.0 -r win-x64 -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true --self-contained false -p:SptBuildType=${{ needs.prepare.outputs.BUILD_TYPE }} -p:SptVersion=${{ needs.prepare.outputs.SPT_VERSION }} -p:SptBuildTime=$( date +%Y%m%d ) -p:SptCommit=${{ steps.debug-info.outputs.COMMIT_ID_SHORT }}
shell: bash
- name: Replace projectName For Linux
run: |
cd /snapshot/Libraries/SPTarkov.Server.Assets/Assets/configs
git checkout core.json
sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Linux\",/g" core.json
shell: bash
- name: Publish Linux Server
shell: bash
run: |
cd /snapshot
dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj -c Release -f net9.0 -r linux-x64 -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true --self-contained false -p:SptBuildType=${{ needs.prepare.outputs.BUILD_TYPE }} -p:SptVersion=${{ needs.prepare.outputs.SPT_VERSION }} -p:SptBuildTime=$( date +%Y%m%d ) -p:SptCommit=${{ steps.debug-info.outputs.COMMIT_ID_SHORT }}
- name: Generate File Name
id: filename id: filename
run: | run: |
artifact_name=${{ env.OUTPUT_DIR }}-${{ needs.prepare.outputs.SPT_VERSION }}-linux-nightly-${{ steps.debug-info.outputs.COMMIT_ID }}-EFT${{ needs.prepare.outputs.EFT_VERSION }}-${{ needs.prepare.outputs.BUILD_DATE_TIME }}-artifact win_artifact_name=spt-server-${{ needs.prepare.outputs.SPT_VERSION }}-win-nightly-${{ steps.debug-info.outputs.COMMIT_ID_SHORT }}-EFT${{ needs.prepare.outputs.CLIENT_VERSION }}-${{ needs.prepare.outputs.BUILD_DATE_TIME }}-artifact
release_name=${{ env.OUTPUT_DIR }}-${{ needs.prepare.outputs.SPT_VERSION }}-linux-nightly-${{ steps.debug-info.outputs.COMMIT_ID }}-EFT${{ needs.prepare.outputs.EFT_VERSION }}-${{ needs.prepare.outputs.BUILD_DATE_TIME }} win_release_name=spt-server-${{ needs.prepare.outputs.SPT_VERSION }}-win-nightly-${{ steps.debug-info.outputs.COMMIT_ID_SHORT }}-EFT${{ needs.prepare.outputs.CLIENT_VERSION }}-${{ needs.prepare.outputs.BUILD_DATE_TIME }}.zip
echo "LINUX_ARTIFACT=$artifact_name" >> $GITHUB_OUTPUT echo "WIN_ARTIFACT=$win_artifact_name" >> $GITHUB_OUTPUT
echo "LINUX_RELEASE=$release_name.zip" >> $GITHUB_OUTPUT echo "WIN_RELEASE=$win_release_name" >> $GITHUB_OUTPUT
echo "LINUX_RELEASE_FIKA=$release_name-fika.zip" >> $GITHUB_OUTPUT
linux_artifact_name=spt-server-${{ needs.prepare.outputs.SPT_VERSION }}-linux-nightly-${{ steps.debug-info.outputs.COMMIT_ID_SHORT }}-EFT${{ needs.prepare.outputs.CLIENT_VERSION }}-${{ needs.prepare.outputs.BUILD_DATE_TIME }}-artifact
linux_release_name=spt-server-${{ needs.prepare.outputs.SPT_VERSION }}-linux-nightly-${{ steps.debug-info.outputs.COMMIT_ID_SHORT }}-EFT${{ needs.prepare.outputs.CLIENT_VERSION }}-${{ needs.prepare.outputs.BUILD_DATE_TIME }}.zip
echo "LINUX_ARTIFACT=$linux_artifact_name" >> $GITHUB_OUTPUT
echo "LINUX_RELEASE=$linux_release_name" >> $GITHUB_OUTPUT
shell: bash shell: bash
- name: Artifact Windows Server
uses: actions/upload-artifact@v4
with:
name: ${{ steps.filename.outputs.WIN_ARTIFACT }}
path: |
/snapshot/SPTarkov.Server/bin/Release/net9.0/win-x64/publish/
!/snapshot/SPTarkov.Server/bin/Release/net9.0/win-x64/publish/**/*.pdb
overwrite: true
- name: Artifact Linux Server - name: Artifact Linux Server
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ steps.filename.outputs.LINUX_ARTIFACT }} name: ${{ steps.filename.outputs.LINUX_ARTIFACT }}
path: project/${{ env.OUTPUT_DIR }} path: |
/snapshot/SPTarkov.Server/bin/Release/net9.0/linux-x64/publish/
!/snapshot/SPTarkov.Server/bin/Release/net9.0/linux-x64/publish/**/*.pdb
overwrite: true overwrite: true
retention-days: 1
- name: Push Linux Server Code
run: |
git pull
REMOTE_URL="https://AirryCo:${{ secrets.AIRRYCO_TOKEN }}@github.com/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}.git"
git remote set-url origin "$REMOTE_URL"
git config -f .lfsconfig lfs.url https://${{ secrets.GITEA_PUSH_TOKEN }}:@git.rui.he.cn:3000/henry/spt-server.git/info/lfs
git push -u origin ${{ env.NIGHTLY_BRANCH }}
shell: bash
build-docker-image-multi-arch: build-docker-image-multi-arch:
needs: [prepare, build-server-linux] needs: [prepare, build-server-host]
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
DOCKERHUB_USER: stblog DOCKERHUB_USER: stblog
@@ -283,18 +187,19 @@ jobs:
GHCR_REPOSITORY: spt-server GHCR_REPOSITORY: spt-server
outputs: outputs:
DOCKER_DIGEST: ${{ steps.build-and-push.outputs.digest }} DOCKER_DIGEST_AMD64: ${{ steps.build-and-push-amd64.outputs.digest }}
DOCKER_IMAGEID: ${{ steps.build-and-push.outputs.imageid }} DOCKER_IMAGEID_AMD64: ${{ steps.build-and-push-amd64.outputs.imageid }}
DOCKER_DIGEST_ARM64: ${{ steps.build-and-push-arm64.outputs.digest }}
DOCKER_IMAGEID_ARM64: ${{ steps.build-and-push-arm64.outputs.imageid }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Git pull - name: Pull Files
run: | run: git pull
git pull
# docker # docker
- name: Extract metadata for Docker - name: Extract metadata for AMD64
id: meta id: meta
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
@@ -304,8 +209,8 @@ jobs:
registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server
tags: | tags: |
type=raw,value=nightly type=raw,value=nightly
- name: Extract metadata for Docker with Fika-Server - name: Extract metadata for Arm64
id: meta-fika id: meta-arm64
uses: docker/metadata-action@v5 uses: docker/metadata-action@v5
with: with:
images: | images: |
@@ -313,7 +218,7 @@ jobs:
ghcr.io/${{ env.GHCR_USER }}/${{ env.GHCR_REPOSITORY }} ghcr.io/${{ env.GHCR_USER }}/${{ env.GHCR_REPOSITORY }}
registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server
tags: | tags: |
type=raw,value=nightly-fika type=raw,value=nightly-arm64
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
@@ -341,22 +246,8 @@ jobs:
username: ${{ secrets.ALIYUN_REGISTRY_USER }} username: ${{ secrets.ALIYUN_REGISTRY_USER }}
password: ${{ secrets.ALIYUN_REGISTRY_TOKEN }} password: ${{ secrets.ALIYUN_REGISTRY_TOKEN }}
- name: Build and Push with Fika Server - name: Build and Push For AMD64
id: build-and-push-with-fika id: build-and-push-amd64
uses: docker/build-push-action@v6
with:
context: ./docker
file: ./docker/Dockerfile-nightly-fika
push: true
tags: ${{ steps.meta-fika.outputs.tags }}
labels: |
${{ steps.meta-fika.outputs.labels }}
org.opencontainers.image.source=https://github.com/AirryCo/spt-server
org.opencontainers.image.url=https://github.com/AirryCo/spt-server
org.opencontainers.image.revision=${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID_WHOLE }}
platforms: linux/amd64,linux/arm64
- name: Build and Push
id: build-and-push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: ./docker context: ./docker
@@ -365,111 +256,32 @@ jobs:
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: | labels: |
${{ steps.meta.outputs.labels }} ${{ steps.meta.outputs.labels }}
org.opencontainers.image.source=https://github.com/AirryCo/spt-server org.opencontainers.image.version=${{ env.NIGHTLY_BRANCH }}
org.opencontainers.image.url=https://github.com/AirryCo/spt-server org.opencontainers.image.revision=${{ needs.build-server-host.outputs.COMMIT_ID_LONG }}
org.opencontainers.image.revision=${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID_WHOLE }} platforms: linux/amd64
platforms: linux/amd64,linux/arm64 build-args: |
SPT_BUILD_TYPE=${{ needs.prepare.outputs.BUILD_TYPE }}
SPT_VERSION=${{ needs.prepare.outputs.SPT_VERSION }}
build-server-windows: - name: Build and Push For ARM64
needs: [prepare, build-server-linux] id: build-and-push-arm64
runs-on: windows-latest uses: docker/build-push-action@v6
env:
OUTPUT_DIR: spt-server
outputs:
SPT_SERVER_COMMIT_TIME: ${{ steps.merge.outputs.SPT_SERVER_COMMIT_TIME }}
WIN_COMMIT_ID: ${{ steps.debug-info.outputs.COMMIT_ID }}
WIN_ARTIFACT: ${{ steps.filename.outputs.WIN_ARTIFACT }}
WIN_RELEASE_FILE: ${{ steps.filename.outputs.WIN_RELEASE }}
WIN_RELEASE_FIKA_FILE: ${{ steps.filename.outputs.WIN_RELEASE_FIKA }}
steps:
- name: Checkout
uses: actions/checkout@v4
with: with:
repository: '${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}' context: ./docker
ref: '${{ env.NIGHTLY_BRANCH }}' file: ./docker/Dockerfile-nightly-arm64
lfs: 'false' push: true
fetch-depth: '1' tags: ${{ steps.meta-arm64.outputs.tags }}
token: '${{ secrets.AIRRYCO_TOKEN }}' labels: |
${{ steps.meta-arm64.outputs.labels }}
# Modify the JSON file with PowerShell org.opencontainers.image.version=${{ env.NIGHTLY_BRANCH }}
- name: Modify JSON file with PowerShell org.opencontainers.image.revision=${{ needs.build-server-host.outputs.COMMIT_ID_LONG }}
run: | platforms: linux/arm64
cd project/assets/configs build-args: |
$json = Get-Content -Path "core.json" | ConvertFrom-Json SPT_BUILD_TYPE=${{ needs.prepare.outputs.BUILD_TYPE }}
$json.projectName = "AirryCo's SPT Windows" SPT_VERSION=${{ needs.prepare.outputs.SPT_VERSION }}
$json | ConvertTo-Json -Depth 10 | Set-Content -Path "core.json"
shell: pwsh
- name: Replace serverExeName
run: |
cd project
sed -i 's/SPT.Server/SPT.Server.exe/g' gulpfile.mjs
shell: bash
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.12.0
- name: Runner Debug Information
id: debug-info
run: |
echo "git version: $(git --version)"
echo "git lfs version: $(git-lfs --version)"
echo "node.js version: $(node --version)"
echo "npm version: $(npm --version)"
echo "latest commit hash: $(git rev-parse HEAD)"
echo "last commit message:" && git log -1 --pretty=%B
echo "COMMIT_ID=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
shell: bash
- name: Cache NPM Dependencies
id: cache-npm-dependencies
uses: actions/cache@v4
with:
path: |
project/node_modules
key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('project/package.json') }}
restore-keys: |
${{ runner.os }}-npm-dependencies-
- name: Install NPM Dependencies
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
run: |
cd project
npm install
shell: pwsh
- name: Build Windows Server
id: build-server
run: |
git config -f .lfsconfig lfs.url https://${{ secrets.GITEA_PUSH_TOKEN }}:@git.rui.he.cn:3000/henry/spt-server.git/info/lfs
git lfs pull
cd project
npm run build:release
ls -l build
mv build ${{ env.OUTPUT_DIR }}
shell: bash
- name: Generate Windows File Name
id: filename
run: |
artifact_name=${{ env.OUTPUT_DIR }}-${{ needs.prepare.outputs.SPT_VERSION }}-win-nightly-${{ steps.debug-info.outputs.COMMIT_ID }}-EFT${{ needs.prepare.outputs.EFT_VERSION }}-${{ needs.prepare.outputs.BUILD_DATE_TIME }}-artifact
release_name=${{ env.OUTPUT_DIR }}-${{ needs.prepare.outputs.SPT_VERSION }}-win-nightly-${{ steps.debug-info.outputs.COMMIT_ID }}-EFT${{ needs.prepare.outputs.EFT_VERSION }}-${{ needs.prepare.outputs.BUILD_DATE_TIME }}
echo "WIN_ARTIFACT=$artifact_name" >> $GITHUB_OUTPUT
echo "WIN_RELEASE=$release_name.zip" >> $GITHUB_OUTPUT
echo "WIN_RELEASE_FIKA=$release_name-fika.zip" >> $GITHUB_OUTPUT
shell: bash
- name: Artifact Winodws Server
uses: actions/upload-artifact@v4
with:
name: ${{ steps.filename.outputs.WIN_ARTIFACT }}
path: project/${{ env.OUTPUT_DIR }}
overwrite: true
update-trigger-and-push: update-trigger-and-push:
needs: [prepare, build-server-windows, build-docker-image-multi-arch] needs: [prepare, build-server-host, build-docker-image-multi-arch]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
@@ -480,20 +292,18 @@ jobs:
git config user.email "bot@stblog.com.cn" git config user.email "bot@stblog.com.cn"
git pull git pull
rm trigger.nightly rm trigger.nightly
server=${{ needs.prepare.outputs.SPT_SERVER_COMMIT }} server=${{ needs.prepare.outputs.SPT_COMMIT_ID }}
echo "server=$server" > trigger.nightly echo "server=$server" > trigger.nightly
fika=${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }}
echo "fika=$fika" >> trigger.nightly
changes=$(git status --porcelain) changes=$(git status --porcelain)
if [ -n "$changes" ]; then if [ -n "$changes" ]; then
git add trigger.nightly git add trigger.nightly
git commit -m "🤖 auto built spt-server: \`$server\`, fika-server:\`${fika:0:8}\`." git commit -m "🤖 auto built spt-server: \`$server\`."
git push git push
fi fi
shell: bash shell: bash
assemble-and-publish: assemble-and-publish:
needs: [prepare, build-fika-server, build-server-windows, build-server-linux, build-docker-image-multi-arch, update-trigger-and-push] needs: [prepare, build-server-host, build-docker-image-multi-arch, update-trigger-and-push]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@@ -503,42 +313,25 @@ jobs:
- name: Download Windows Artifact - name: Download Windows Artifact
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: ${{ needs.build-server-windows.outputs.WIN_ARTIFACT }} name: ${{ needs.build-server-host.outputs.WIN_ARTIFACT }}
path: windows path: windows
- name: Download Linux Artifact - name: Download Linux Artifact
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: ${{ needs.build-server-linux.outputs.LINUX_ARTIFACT }} name: ${{ needs.build-server-host.outputs.LINUX_ARTIFACT }}
path: linux path: linux
- name: Download Fika Artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build-fika-server.outputs.FIKA_ARTIFACT }}
path: fika
- name: Compress Releases - name: Compress Releases
id: compress-release id: compress-release
run: | run: |
cd windows cd windows
zip -r ../${{ needs.build-server-windows.outputs.WIN_RELEASE_FILE }} * zip -r ../${{ needs.build-server-host.outputs.WIN_RELEASE_FILE }} *
cd ../linux cd ../linux
zip -r ../${{ needs.build-server-linux.outputs.LINUX_RELEASE_FILE }} * zip -r ../${{ needs.build-server-host.outputs.LINUX_RELEASE_FILE }} *
ls -R .. ls -R ..
shell: bash shell: bash
- name: Compress Releases With Fika
id: compress-release-fika
run: |
cd windows
cp -rf ../fika/* .
zip -r ../${{ needs.build-server-windows.outputs.WIN_RELEASE_FIKA_FILE }} *
cd ../linux
cp -rf ../fika/* .
zip -r ../${{ needs.build-server-linux.outputs.LINUX_RELEASE_FIKA_FILE }} *
ls -R ..
- name: Create Github Pre-release - name: Create Github Pre-release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
@@ -548,21 +341,19 @@ jobs:
body: | body: |
SPT: ***${{ needs.prepare.outputs.SPT_VERSION }}*** SPT: ***${{ needs.prepare.outputs.SPT_VERSION }}***
Tarkov: ***${{ needs.prepare.outputs.EFT_VERSION }}*** Tarkov: ***${{ needs.prepare.outputs.CLIENT_VERSION }}***
[SPT/Server](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}) commit hash: [${{ needs.prepare.outputs.SPT_SERVER_COMMIT }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}/tree/${{ needs.prepare.outputs.SPT_SERVER_COMMIT }}), commit time: **${{ needs.build-server-linux.outputs.SPT_SERVER_COMMIT_TIME }}** [SPT/Server](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}) commit hash: [${{ needs.prepare.outputs.SPT_COMMIT_ID }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}/tree/${{ needs.prepare.outputs.SPT_COMMIT_ID }}), commit time: **${{ needs.build-server-host.outputs.SPT_COMMIT_TIME }}**
[AirryCo/spt-server](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}) commit: [${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}/tree/${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID }})
Fika-Server: [${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }}](https://github.com/project-fika/Fika-Server/tree/${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }})
Build time: ***${{ needs.prepare.outputs.BUILD_DATE_TIME }}*** Build time: ***${{ needs.prepare.outputs.BUILD_DATE_TIME }}***
**Docker Supported For linux/amd64 and linux/arm64**: **Docker Supported For linux/amd64 and linux/arm64**:
image id: `${{ needs.build-docker-image-multi-arch.outputs.DOCKER_IMAGEID }}` For liunx/amd64:
digest: `${{ needs.build-docker-image-multi-arch.outputs.DOCKER_DIGEST }}` image id: `${{ needs.build-docker-image-multi-arch.outputs.DOCKER_IMAGEID_AMD64 }}`
digest: `${{ needs.build-docker-image-multi-arch.outputs.DOCKER_DIGEST_AMD64 }}`
```bash ```bash
docker pull stblog/spt-server:nightly docker pull stblog/spt-server:nightly
@@ -570,23 +361,23 @@ jobs:
docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:nightly docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:nightly
``` ```
Fika-Server built-in: For linux/arm64:
image id: `${{ needs.build-docker-image-multi-arch.outputs.DOCKER_IMAGEID_ARM64 }}`
digest: `${{ needs.build-docker-image-multi-arch.outputs.DOCKER_DIGEST_ARM64 }}`
```bash ```bash
docker pull stblog/spt-server:nightly-fika docker pull stblog/spt-server:nightly-arm64
docker pull ghcr.io/airryco/spt-server:nightly-fika docker pull ghcr.io/airryco/spt-server:nightly-arm64
docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:nightly-fika docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:nightly-arm64
``` ```
> [!WARNING] > [!WARNING]
> After downloading, please use extraction software like WinRAR or [7-Zip](https://www.7-zip.org/) to unzip the files, then copy them to the Tarkov root directory. Do not use Windows File Explorer to directly open and copy the files. > After downloading, please use extraction software like WinRAR or [7-Zip](https://www.7-zip.org/) to unzip the files, then copy them to the Tarkov root directory. Do not use Windows File Explorer to directly open and copy the files.
Full Changelog: Full Changelog: [${{ needs.prepare.outputs.BUILT_HASH }}...${{ needs.prepare.outputs.SPT_COMMIT_ID }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}/compare/${{ needs.prepare.outputs.BUILT_HASH }}...${{ needs.prepare.outputs.SPT_COMMIT_ID }})
- spt-server: [${{ needs.prepare.outputs.BUILT_HASH }}...${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}/compare/${{ needs.prepare.outputs.BUILT_HASH }}...${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID }})
- fika-server: [${{ needs.prepare.outputs.BUILT_HASH_FIKA }}...${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }}](https://github.com/project-fika/Fika-Server/compare/${{ needs.prepare.outputs.BUILT_HASH_FIKA }}...${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }})
files: | files: |
${{ needs.build-server-windows.outputs.WIN_RELEASE_FILE }} ${{ needs.build-server-host.outputs.WIN_RELEASE_FILE }}
${{ needs.build-server-linux.outputs.LINUX_RELEASE_FILE }} ${{ needs.build-server-host.outputs.LINUX_RELEASE_FILE }}
${{ needs.build-server-windows.outputs.WIN_RELEASE_FIKA_FILE }}
${{ needs.build-server-linux.outputs.LINUX_RELEASE_FIKA_FILE }}

BIN
custom/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 MiB

View File

@@ -1,19 +1,23 @@
FROM node:22.12.0-bullseye AS server-builder FROM mcr.microsoft.com/dotnet/sdk:9.0 AS server-builder
RUN apt update && apt install -y git git-lfs p7zip-full && \ ARG SPT_VERSION
git clone -b 3.11.x-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ ARG SPT_BUILD_TYPE
RUN apt update && apt install -y git git-lfs wget && \
git clone -b develop --depth=1 https://git.rui.he.cn:3000/SP-Tarkov/server-csharp.git /snapshot && \
cd /snapshot && git lfs pull && \ cd /snapshot && git lfs pull && \
cd project && \ cd Libraries/SPTarkov.Server.Assets/Assets/configs && sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Linux\",/g" core.json && \
npm install && npm run build:release && \ cd /snapshot/Libraries/SPTarkov.Server.Assets/Assets/images/launcher && rm bg.png && wget https://raw.githubusercontent.com/AirryCo/spt-server-ci/refs/heads/main/custom/bg.png && \
cd /snapshot && \
dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj -c Release -f net9.0 -r linux-x64 -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true --self-contained false -p:SptBuildType=$SPT_BUILD_TYPE -p:SptVersion=$SPT_VERSION -p:SptBuildTime=$( date +%Y%m%d ) -p:SptCommit=$(git rev-parse --short HEAD) && \
rm SPTarkov.Server/bin/Release/net9.0/linux-x64/publish/*.pdb && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
FROM debian:bookworm-slim FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim
LABEL author="AirryCo <henry@stblog.com.cn>" LABEL author="AirryCo <henry@stblog.com.cn>"
ENV TZ=Asia/Shanghai ENV TZ=Asia/Shanghai
COPY --from=server-builder /snapshot/project/build/ /app/spt-server/ COPY --from=server-builder /snapshot/SPTarkov.Server/bin/Release/net9.0/linux-x64/publish/ /app/spt-server/
VOLUME /opt/spt-server VOLUME /opt/spt-server
WORKDIR /opt/spt-server WORKDIR /opt/spt-server
EXPOSE 6969 EXPOSE 6969
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,23 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0-bookworm-slim-arm64v8 AS server-builder
ARG SPT_VERSION
ARG SPT_BUILD_TYPE
RUN apt update && apt install -y git git-lfs wget && \
git clone -b develop --depth=1 https://git.rui.he.cn:3000/SP-Tarkov/server-csharp.git /snapshot && \
cd /snapshot && git lfs pull && \
cd Libraries/SPTarkov.Server.Assets/Assets/configs && sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Linux\",/g" core.json && \
cd /snapshot/Libraries/SPTarkov.Server.Assets/Assets/images/launcher && rm bg.png && wget https://raw.githubusercontent.com/AirryCo/spt-server-ci/refs/heads/main/custom/bg.png && \
cd /snapshot && \
dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj -c Release -f net9.0 -r linux-arm64 -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true --self-contained false -p:SptBuildType=$SPT_BUILD_TYPE -p:SptVersion=$SPT_VERSION -p:SptBuildTime=$( date +%Y%m%d ) -p:SptCommit=$(git rev-parse --short HEAD) && \
rm SPTarkov.Server/bin/Release/net9.0/linux-arm64/publish/*.pdb && \
rm -rf /var/lib/apt/lists/*
FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim-arm64v8
LABEL author="AirryCo <henry@stblog.com.cn>"
ENV TZ=Asia/Shanghai
COPY --from=server-builder /snapshot/SPTarkov.Server/bin/Release/net9.0/linux-arm64/publish/ /app/spt-server/
VOLUME /opt/spt-server
WORKDIR /opt/spt-server
EXPOSE 6969
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
if [ -f /opt/spt-server/SPT.Server ]; then if [ -f /opt/spt-server/SPTarkov.Server ]; then
appHash=$(md5sum /app/spt-server/SPT.Server | awk '{ print $1 }') appHash=$(md5sum /app/spt-server/SPTarkov.Server | awk '{ print $1 }')
exeHash=$(md5sum /opt/spt-server/SPT.Server | awk '{ print $1 }') exeHash=$(md5sum /opt/spt-server/SPTarkov.Server | awk '{ print $1 }')
if [ "$appHash" = "$exeHash" ]; then if [ "$appHash" = "$exeHash" ]; then
echo "MD5 verification successful!" echo "MD5 verification successful!"
else else
@@ -18,10 +18,16 @@ fi
cd /opt/spt-server cd /opt/spt-server
if [ -z "$backendIp" ]; then if [ -z "$ip" ]; then
IP=$(hostname -I | awk '{print $1}') IP="0.0.0.0"
else else
IP=$backendIp IP=$ip
fi
if [ -z "$backendIp" ]; then
BACKEND_IP=$(hostname -I | awk '{print $1}')
else
BACKEND_IP=$backendIp
fi fi
if [ -z "$backendPort" ]; then if [ -z "$backendPort" ]; then
@@ -36,11 +42,10 @@ else
PINGDELAYMS=$webSocketPingDelayMs PINGDELAYMS=$webSocketPingDelayMs
fi fi
sed -Ei "s/\"ip\": \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",/\"ip\": \"0.0.0.0\",/g" SPT_Data/Server/configs/http.json sed -Ei "s/\"ip\": \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",/\"ip\": \"${IP}\",/g" Assets/configs/http.json
sed -Ei "s/\"port\": ([0-9]|[1-9][1-9]{1,3}|[1-5][0-9]{4}|6[1-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]),/\"port\": ${PORT},/g" SPT_Data/Server/configs/http.json sed -Ei "s/\"port\": ([0-9]|[1-9][1-9]{1,3}|[1-5][0-9]{4}|6[1-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]),/\"port\": ${PORT},/g" Assets/configs/http.json
sed -Ei "s/\"backendIp\": \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",/\"backendIp\": \"${IP}\",/g" SPT_Data/Server/configs/http.json sed -Ei "s/\"backendIp\": \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\",/\"backendIp\": \"${BACKEND_IP}\",/g" Assets/configs/http.json
sed -Ei "s/\"backendPort\": ([0-9]|[1-9][1-9]{1,3}|[1-5][0-9]{4}|6[1-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]),/\"backendPort\": ${PORT},/g" SPT_Data/Server/configs/http.json sed -Ei "s/\"backendPort\": ([0-9]|[1-9][1-9]{1,3}|[1-5][0-9]{4}|6[1-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5]),/\"backendPort\": ${PORT},/g" Assets/configs/http.json
sed -Ei "s/\"webSocketPingDelayMs\": ([0-9]{1,}),/\"webSocketPingDelayMs\": ${PINGDELAYMS},/g" SPT_Data/Server/configs/http.json sed -Ei "s/\"webSocketPingDelayMs\": ([0-9]{1,}),/\"webSocketPingDelayMs\": ${PINGDELAYMS},/g" Assets/configs/http.json
chmod +x SPT.Server && ./SPT.Server
chmod +x SPTarkov.Server && ./SPTarkov.Server