640 lines
26 KiB
YAML
640 lines
26 KiB
YAML
name: SPT-Server Build Nightly
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '30 2 * * *'
|
|
push:
|
|
paths:
|
|
- '.github/workflows/build-nightly-cron.yaml'
|
|
|
|
env:
|
|
SERVER_URL: https://github.com
|
|
REPOSITORY_SPT_SERVER: sp-tarkov/server
|
|
REPOSITORY_SPT_SERVER_AIRRYCO: AirryCo/spt-server
|
|
NIGHTLY_BRANCH: 3.10.0-DEV
|
|
NIGHTLY_BRANCH_FIKA: spt-3.10
|
|
|
|
jobs:
|
|
prepare:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
PROCEED: ${{ steps.compare-hash.outputs.PROCEED }}
|
|
PROCEED_FIKA: ${{ steps.compare-fika.outputs.PROCEED }}
|
|
BUILT_HASH: ${{ steps.compare-hash.outputs.BUILT_HASH }}
|
|
BUILT_HASH_FIKA: ${{ steps.compare-fika.outputs.BUILT_HASH }}
|
|
SPT_VERSION: ${{ steps.versions.outputs.SPT_VERSION }}
|
|
EFT_VERSION: ${{ steps.versions.outputs.EFT_VERSION }}
|
|
SPT_SERVER_COMMIT: ${{ steps.versions.outputs.SPT_SERVER_COMMIT }}
|
|
FIKA_SERVER_COMMIT: ${{ steps.compare-fika.outputs.FIKA_SERVER_COMMIT }}
|
|
BUILD_DATE_TIME: ${{ steps.versions.outputs.DATE_TIME }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Get Latest Commit From SPT
|
|
id: get-latest-commit
|
|
run: |
|
|
SPT_SERVER_LATEST_COMMIT_HASH=$(git ls-remote ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git refs/heads/${{ env.NIGHTLY_BRANCH }} | awk '{print $1}')
|
|
SPT_SERVER_LATEST_COMMIT_HASH=${SPT_SERVER_LATEST_COMMIT_HASH:0:8}
|
|
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
|
|
- name: Compare Hashes
|
|
id: compare-hash
|
|
run: |
|
|
source trigger.nightly
|
|
server_last_built_hash=${server:0:8}
|
|
server_latest_commit_hash=${{ steps.get-latest-commit.outputs.SPT_SERVER_LATEST_COMMIT_HASH }}
|
|
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 "PROCEED=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "PROCEED=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
echo "BUILT_HASH=$server_last_built_hash" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
- name: Compare Fika Hashes
|
|
id: compare-fika
|
|
run: |
|
|
source trigger.fika
|
|
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}')
|
|
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
|
|
id: versions
|
|
if: steps.compare-hash.outputs.PROCEED == 'true' || steps.compare-fika.outputs.PROCEED == 'true'
|
|
run: |
|
|
SPT_SERVER_COMMIT=${{ steps.get-latest-commit.outputs.SPT_SERVER_LATEST_COMMIT_HASH }}
|
|
|
|
# Extract versions from core.json
|
|
wget https://raw.githubusercontent.com/${{ env.REPOSITORY_SPT_SERVER }}/refs/heads/${{ env.NIGHTLY_BRANCH }}/project/assets/configs/core.json
|
|
SPT_VERSION=$(jq -r '.sptVersion' core.json)
|
|
EFT_VERSION=$(jq -r '.compatibleTarkovVersion' core.json)
|
|
|
|
echo "👽 SPT_VERSION = $SPT_VERSION"
|
|
echo "👽 EFT_VERSION = $EFT_VERSION"
|
|
echo "👽 SPT_SERVER_COMMIT = $SPT_SERVER_COMMIT"
|
|
echo "SPT_VERSION=$SPT_VERSION" >> $GITHUB_OUTPUT
|
|
echo "EFT_VERSION=$EFT_VERSION" >> $GITHUB_OUTPUT
|
|
echo "SPT_SERVER_COMMIT=$SPT_SERVER_COMMIT" >> $GITHUB_OUTPUT
|
|
echo "DATE_TIME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
|
|
build-fika-server:
|
|
needs: prepare
|
|
if: needs.prepare.outputs.PROCEED == 'true' || needs.prepare.outputs.PROCEED_FIKA == 'true'
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
SOURCECODE_DIR: ${{ github.workspace }}/fika-server
|
|
|
|
outputs:
|
|
FIKA_ARTIFACT: ${{ steps.filename.outputs.FIKA_ARTIFACT }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Clone Fika Server Code
|
|
run: |
|
|
git clone -b ${{ env.NIGHTLY_BRANCH_FIKA }} https://github.com/project-fika/Fika-Server.git ${{ env.SOURCECODE_DIR }}
|
|
shell: bash
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.11.1
|
|
|
|
- name: Cache NPM Dependencies
|
|
id: cache-npm-dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
${{ env.SOURCECODE_DIR }}/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: |
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
npm install
|
|
shell: pwsh
|
|
|
|
- name: Build Fika Server
|
|
id: build-server
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
npm run build
|
|
mkdir output
|
|
cd output
|
|
unzip ../dist/fika-server.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: ${{ env.SOURCECODE_DIR }}/output
|
|
overwrite: true
|
|
|
|
build-server-windows:
|
|
needs: prepare
|
|
if: needs.prepare.outputs.PROCEED == 'true' || needs.prepare.outputs.PROCEED_FIKA == 'true'
|
|
runs-on: windows-latest
|
|
env:
|
|
OUTPUT_DIR: spt-server
|
|
SOURCECODE_DIR: c:/snapshot
|
|
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:
|
|
fetch-depth: 0
|
|
- name: Setup Git Config
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "bot@github.com"
|
|
|
|
- name: Clone AirryCo's Windows Server Code
|
|
run: |
|
|
git clone -b ${{ env.NIGHTLY_BRANCH }}_Win ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }} ${{ env.SOURCECODE_DIR }}
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
git lfs pull
|
|
shell: bash
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.11.1
|
|
|
|
- name: Merge Server Code From SPT
|
|
id: merge
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
git pull
|
|
git fetch -u ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git ${{ env.NIGHTLY_BRANCH }}: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
|
|
id: debug-info
|
|
run: |
|
|
cp -v ${{ env.SOURCECODE_DIR }}/project/package.json .
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
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: |
|
|
${{ env.SOURCECODE_DIR }}/project/node_modules
|
|
key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('package.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-npm-dependencies-
|
|
|
|
- name: Install NPM Dependencies
|
|
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}/project
|
|
npm install --legacy-peer-deps
|
|
shell: pwsh
|
|
|
|
- name: Build Windows Server
|
|
id: build-server
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}/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: ${{ env.SOURCECODE_DIR }}/project/${{ env.OUTPUT_DIR }}
|
|
overwrite: true
|
|
|
|
- name: Push Windows Server Code
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
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 push
|
|
shell: bash
|
|
|
|
build-server-linux:
|
|
needs: [prepare, build-fika-server]
|
|
if: needs.prepare.outputs.PROCEED == 'true' || needs.prepare.outputs.PROCEED_FIKA == 'true'
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
OUTPUT_DIR: spt-server
|
|
SOURCECODE_DIR: ${{ github.workspace }}/code
|
|
|
|
DOCKERHUB_USER: stblog
|
|
DOCKERHUB_REPOSITORY: spt-server
|
|
GHCR_USER: airryco
|
|
GHCR_REPOSITORY: spt-server
|
|
|
|
outputs:
|
|
SPT_SERVER_COMMIT_TIME: ${{ steps.merge.outputs.SPT_SERVER_COMMIT_TIME }}
|
|
LINUX_COMMIT_ID: ${{ steps.debug-info.outputs.COMMIT_ID }}
|
|
LINUX_ARTIFACT: ${{ steps.filename.outputs.LINUX_ARTIFACT }}
|
|
LINUX_RELEASE_FILE: ${{ steps.filename.outputs.LINUX_RELEASE }}
|
|
LINUX_RELEASE_FIKA_FILE: ${{ steps.filename.outputs.LINUX_RELEASE_FIKA }}
|
|
DOCKER_DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
|
DOCKER_IMAGEID: ${{ steps.build-and-push.outputs.imageid }}
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Git Config
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "bot@github.com"
|
|
|
|
- name: Clone AirryCo's Linux Server Code
|
|
run: |
|
|
git clone -b ${{ env.NIGHTLY_BRANCH }} ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }} ${{ env.SOURCECODE_DIR }}
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
git lfs pull
|
|
shell: bash
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.11.1
|
|
|
|
- name: Merge Server Code From SPT
|
|
id: merge
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
git pull
|
|
git fetch -u ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git ${{ env.NIGHTLY_BRANCH }}: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
|
|
id: debug-info
|
|
run: |
|
|
cp -v ${{ env.SOURCECODE_DIR }}/project/package.json .
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
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
|
|
echo "COMMIT_ID_WHOLE=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
|
|
- name: Cache NPM Dependencies
|
|
id: cache-npm-dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
${{ env.SOURCECODE_DIR }}/project/node_modules
|
|
key: ${{ runner.os }}-npm-dependencies-${{ hashFiles('package.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-npm-dependencies-
|
|
|
|
- name: Install NPM Dependencies
|
|
if: steps.cache-npm-dependencies.outputs.cache-hit != 'true'
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}/project
|
|
npm install --legacy-peer-deps
|
|
shell: bash
|
|
|
|
- name: Build Linux Server
|
|
id: build-server
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}/project
|
|
npm run build:release
|
|
ls -l build
|
|
mv build ${{ env.OUTPUT_DIR }}
|
|
shell: bash
|
|
|
|
- name: Generate Linux File Name
|
|
id: filename
|
|
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
|
|
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 }}
|
|
echo "LINUX_ARTIFACT=$artifact_name" >> $GITHUB_OUTPUT
|
|
echo "LINUX_RELEASE=$release_name.zip" >> $GITHUB_OUTPUT
|
|
echo "LINUX_RELEASE_FIKA=$release_name-fika.zip" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
|
|
- name: Artifact Linux Server
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ steps.filename.outputs.LINUX_ARTIFACT }}
|
|
path: ${{ env.SOURCECODE_DIR }}/project/${{ env.OUTPUT_DIR }}
|
|
overwrite: true
|
|
retention-days: 1
|
|
|
|
# docker
|
|
- name: Compress spt-server to docker dir
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}/project
|
|
tar -czf ../docker/spt-server.tgz ${{ env.OUTPUT_DIR }}
|
|
ls -l ../docker
|
|
shell: bash
|
|
|
|
- name: Download Fika Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: ${{ needs.build-fika-server.outputs.FIKA_ARTIFACT }}
|
|
path: fika
|
|
|
|
- name: Compress fika-server to docker dir
|
|
run: |
|
|
cd fika
|
|
tar -czf ${{ env.SOURCECODE_DIR }}/docker/fika-server.tgz .
|
|
ls -l ${{ env.SOURCECODE_DIR }}/docker
|
|
shell: bash
|
|
|
|
- name: Extract metadata for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.DOCKERHUB_USER }}/${{ env.DOCKERHUB_REPOSITORY }}
|
|
ghcr.io/${{ env.GHCR_USER }}/${{ env.GHCR_REPOSITORY }}
|
|
registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server
|
|
tags: |
|
|
type=raw,value=nightly
|
|
- name: Extract metadata for Docker with Fika-Server
|
|
id: meta-fika
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: |
|
|
${{ env.DOCKERHUB_USER }}/${{ env.DOCKERHUB_REPOSITORY }}
|
|
ghcr.io/${{ env.GHCR_USER }}/${{ env.GHCR_REPOSITORY }}
|
|
registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server
|
|
tags: |
|
|
type=raw,value=nightly-fika
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
# DockerHub
|
|
- name: Login to Dockerhub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ env.DOCKERHUB_USER }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
# GitHub Container Registry
|
|
- name: Login to Github Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ env.GHCR_USER }}
|
|
password: ${{ secrets.GHCR_TOKEN }}
|
|
# Aliyun Registry
|
|
- name: Login to Aliyun Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: registry.cn-shenzhen.aliyuncs.com
|
|
username: ${{ secrets.ALIYUN_REGISTRY_USER }}
|
|
password: ${{ secrets.ALIYUN_REGISTRY_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
id: build-and-push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ${{ env.SOURCECODE_DIR }}/docker
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: |
|
|
${{ steps.meta.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=${{ steps.debug-info.outputs.COMMIT_ID_WHOLE }}
|
|
platforms: linux/amd64,linux/arm64
|
|
- name: Build and Push with Fika Server
|
|
id: build-and-push-with-fika
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: ${{ env.SOURCECODE_DIR }}/docker
|
|
file: ${{ env.SOURCECODE_DIR }}/docker/Dockerfile-fika
|
|
push: true
|
|
tags: ${{ steps.meta-fika.outputs.tags }}
|
|
labels: |
|
|
${{ steps.meta.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=${{ steps.debug-info.outputs.COMMIT_ID_WHOLE }}
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
- name: Push Linux Server Code
|
|
run: |
|
|
cd ${{ env.SOURCECODE_DIR }}
|
|
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 push
|
|
shell: bash
|
|
|
|
update-trigger-and-push:
|
|
needs: [prepare, build-server-windows, build-server-linux]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Update trigger and Push to GitHub
|
|
run: |
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "bot@stblog.com.cn"
|
|
git pull
|
|
rm trigger.nightly
|
|
server=${{ needs.prepare.outputs.SPT_SERVER_COMMIT }}
|
|
echo "server=$server" > trigger.nightly
|
|
rm trigger.fika
|
|
fika=${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }}
|
|
echo "fika=$fika" > trigger.fika
|
|
git add trigger.nightly trigger.fika
|
|
git commit -m "🤖 up to spt-server: \`$server\`, fika-server:\`${fika:0:8}\`."
|
|
git push
|
|
shell: bash
|
|
|
|
assemble-and-publish:
|
|
needs: [prepare, build-server-windows, build-server-linux, build-fika-server, update-trigger-and-push]
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Download Windows Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: ${{ needs.build-server-windows.outputs.WIN_ARTIFACT }}
|
|
path: windows
|
|
|
|
- name: Download Linux Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: ${{ needs.build-server-linux.outputs.LINUX_ARTIFACT }}
|
|
path: linux
|
|
|
|
- name: Download Fika Artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: ${{ needs.build-fika-server.outputs.FIKA_ARTIFACT }}
|
|
path: fika
|
|
|
|
- name: List Release Contents
|
|
run: |
|
|
ls -R windows
|
|
echo "========================="
|
|
ls -R linux
|
|
shell: bash
|
|
|
|
- name: Compress Releases
|
|
id: compress-release
|
|
run: |
|
|
cd windows
|
|
zip -r ../${{ needs.build-server-windows.outputs.WIN_RELEASE_FILE }} *
|
|
cd ../linux
|
|
zip -r ../${{ needs.build-server-linux.outputs.LINUX_RELEASE_FILE }} *
|
|
ls -R ..
|
|
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: Short Hash
|
|
id: short-hash
|
|
run: |
|
|
fika_hash=${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }}
|
|
echo "FIKA_HASH=${fika_hash:0:8}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create Github Pre-release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: ${{ needs.prepare.outputs.BUILD_DATE_TIME }}
|
|
tag_name: ${{ needs.prepare.outputs.BUILD_DATE_TIME }}
|
|
prerelease: true
|
|
body: |
|
|
SPT: ***${{ needs.prepare.outputs.SPT_VERSION }}***
|
|
|
|
Tarkov: ***${{ needs.prepare.outputs.EFT_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 }}/src/commit/${{ needs.prepare.outputs.SPT_SERVER_COMMIT }}), commit time: **${{ needs.build-server-linux.outputs.SPT_SERVER_COMMIT_TIME }}**
|
|
|
|
[medusa/spt-server](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}) commit:
|
|
- linux: [${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}/src/commit/${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID }})
|
|
- windows: [${{ needs.build-server-windows.outputs.WIN_COMMIT_ID }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}/src/commit/${{ needs.build-server-windows.outputs.WIN_COMMIT_ID }})
|
|
|
|
Fika-Server: [${{ steps.short-hash.outputs.FIKA_HASH }}](https://github.com/project-fika/Fika-Server/tree/${{ needs.prepare.outputs.FIKA_SERVER_COMMIT }})
|
|
|
|
Build time: ***${{ needs.prepare.outputs.BUILD_DATE_TIME }}***
|
|
|
|
**Docker Supported For linux/amd64 and linux/arm64**:
|
|
|
|
image id: `${{ needs.build-server-linux.outputs.DOCKER_IMAGEID }}`
|
|
|
|
digest: `${{ needs.build-server-linux.outputs.DOCKER_DIGEST }}`
|
|
|
|
```bash
|
|
docker pull stblog/spt-server:nightly
|
|
docker pull ghcr.io/airryco/spt-server:nightly
|
|
docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:nightly
|
|
```
|
|
|
|
Fika-Server built-in:
|
|
|
|
```bash
|
|
docker pull stblog/spt-server:nightly-fika
|
|
docker pull ghcr.io/airryco/spt-server:nightly-fika
|
|
docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:nightly-fika
|
|
```
|
|
|
|
> [!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.
|
|
|
|
Full Changelog:
|
|
- linux: [${{ 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 }})
|
|
- windows: [${{ needs.prepare.outputs.BUILT_HASH }}...${{ needs.build-server-windows.outputs.WIN_COMMIT_ID }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}/compare/${{ needs.prepare.outputs.BUILT_HASH }}...${{ needs.build-server-windows.outputs.WIN_COMMIT_ID }})
|
|
- fika-server: [${{ needs.prepare.outputs.BUILT_HASH_FIKA }}...${{ steps.short-hash.outputs.FIKA_HASH }}](https://github.com/project-fika/Fika-Server/compare/${{ needs.prepare.outputs.BUILT_HASH_FIKA }}...${{ steps.short-hash.outputs.FIKA_HASH }})
|
|
|
|
files: |
|
|
${{ needs.build-server-windows.outputs.WIN_RELEASE_FILE }}
|
|
${{ needs.build-server-linux.outputs.LINUX_RELEASE_FILE }}
|
|
${{ needs.build-server-windows.outputs.WIN_RELEASE_FIKA_FILE }}
|
|
${{ needs.build-server-linux.outputs.LINUX_RELEASE_FIKA_FILE }}
|