diff --git a/.github/workflows/build-nightly-cron.yaml b/.github/workflows/build-nightly-cron.yaml deleted file mode 100644 index 6300f1c..0000000 --- a/.github/workflows/build-nightly-cron.yaml +++ /dev/null @@ -1,412 +0,0 @@ -name: SPT-Server 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-csharp - REPOSITORY_SPT_SERVER_AIRRYCO: AirryCo/spt-server - NIGHTLY_BRANCH: develop - -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 }} - CLIENT_VERSION: ${{ steps.versions.outputs.CLIENT_VERSION }} - SPT_VERSION: ${{ steps.versions.outputs.SPT_VERSION }} - SPT_COMMIT_ID: ${{ steps.versions.outputs.SPT_COMMIT_ID }} - FIKA_SERVER_COMMIT: ${{ steps.compare-fika.outputs.FIKA_SERVER_COMMIT }} - BUILD_DATE_TIME: ${{ steps.versions.outputs.DATE_TIME }} - BUILD_TYPE: BLEEDINGEDGEMODS # BLEEDINGEDGE BLEEDINGEDGEMODS Release - BUILD_CONFIG: Release # Debug Release - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Get Latest Commit From SPT - id: get-latest-commit - run: | - SPT_COMMIT_ID=$(git ls-remote ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git refs/heads/${{ env.NIGHTLY_BRANCH }} | awk '{print $1}') - SPT_COMMIT_ID=${SPT_COMMIT_ID:0:8} - echo "👽 SPT_COMMIT_ID = $SPT_COMMIT_ID" - echo "SPT_COMMIT_ID=$SPT_COMMIT_ID" >> $GITHUB_OUTPUT - shell: bash - - name: Compare Hashes - id: compare-hash - run: | - git pull - source trigger.nightly - server_last_built_hash=${server:0:8} - server_latest_commit_hash=${{ steps.get-latest-commit.outputs.SPT_COMMIT_ID }} - 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: Extract versions - id: versions - if: steps.compare-hash.outputs.PROCEED == 'true' - run: | - SPT_COMMIT_ID=${{ steps.get-latest-commit.outputs.SPT_COMMIT_ID }} - - latest_tag=$(git ls-remote --tags ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git | awk -F'/' '{print $NF}' | grep -v '\^{}' | sort -V | tail -1) - SPT_VERSION=$(echo $latest_tag | cut -d'-' -f1) - - # Extract versions from core.json - wget https://raw.githubusercontent.com/${{ env.REPOSITORY_SPT_SERVER }}/refs/heads/${{ env.NIGHTLY_BRANCH }}/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json - CLIENT_VERSION=$(jq -r '.compatibleTarkovVersion' core.json) - - echo "👽 CLIENT_VERSION = $CLIENT_VERSION" - echo "👽 SPT_VERSION = $SPT_VERSION" - echo "👽 SPT_COMMIT_ID = $SPT_COMMIT_ID" - - echo "CLIENT_VERSION=$CLIENT_VERSION" >> $GITHUB_OUTPUT - echo "SPT_VERSION=$SPT_VERSION" >> $GITHUB_OUTPUT - echo "SPT_COMMIT_ID=$SPT_COMMIT_ID" >> $GITHUB_OUTPUT - echo "DATE_TIME=$(date +%Y%m%d)" >> $GITHUB_OUTPUT - shell: bash - - build-server-host: - needs: prepare - if: needs.prepare.outputs.PROCEED == 'true' - runs-on: ubuntu-latest - container: - image: refringe/spt-build-dotnet:2.0.2 - outputs: - COMMIT_ID_LONG: ${{ steps.debug-info.outputs.COMMIT_ID_LONG }} - COMMIT_ID_SHORT: ${{ steps.debug-info.outputs.COMMIT_ID_SHORT }} - SPT_COMMIT_TIME: ${{ steps.debug-info.outputs.SPT_COMMIT_TIME }} - WIN_ARTIFACT: ${{ steps.filename.outputs.WIN_ARTIFACT }} - WIN_RELEASE_FILE: ${{ steps.filename.outputs.WIN_RELEASE }} - LINUX_ARTIFACT: ${{ steps.filename.outputs.LINUX_ARTIFACT }} - LINUX_RELEASE_FILE: ${{ steps.filename.outputs.LINUX_RELEASE }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Clone Server - run: | - git clone -b ${{ env.NIGHTLY_BRANCH }} --depth=1 ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git /snapshot - cd /snapshot - git lfs pull - - - name: Runner Debug Information - id: debug-info - run: | - cd /snapshot - echo "git version: $(git --version)" - echo "git lfs version: $(git-lfs --version)" - echo "latest commit hash: $(git rev-parse HEAD)" - echo "last commit message:" && git log -1 --pretty=%B - - 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 }} -1) >> $GITHUB_OUTPUT - shell: bash - - - name: Replace Background Image - id: bg - run: | - cp custom/bg.png /snapshot/Libraries/SPTarkov.Server.Assets/SPT_Data/images/launcher/ - shell: bash - - - name: Replace projectName For Windows - run: | - cd /snapshot/Libraries/SPTarkov.Server.Assets/SPT_Data/configs - git checkout core.json - sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Windows\",/g" core.json - shell: bash - - - name: Publish Windows Server - run: | - dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj \ - -c ${{ needs.prepare.outputs.BUILD_CONFIG }} \ - -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 }} \ - -p:IsPublish=true - shell: bash - working-directory: /snapshot - - - name: Replace projectName For Linux - run: | - cd /snapshot/Libraries/SPTarkov.Server.Assets/SPT_Data/configs - git checkout core.json - sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Linux\",/g" core.json - shell: bash - - - name: Publish Linux Server - run: | - dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj \ - -c ${{ needs.prepare.outputs.BUILD_CONFIG }} \ - -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 }} \ - -p:IsPublish=true - shell: bash - working-directory: /snapshot - - - name: Generate File Name - id: filename - run: | - 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 - 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 "WIN_ARTIFACT=$win_artifact_name" >> $GITHUB_OUTPUT - echo "WIN_RELEASE=$win_release_name" >> $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 - - - name: Artifact Windows Server - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.filename.outputs.WIN_ARTIFACT }} - path: | - /snapshot/SPTarkov.Server/bin/${{ needs.prepare.outputs.BUILD_CONFIG }}/net9.0/win-x64/publish/ - !/snapshot/SPTarkov.Server/bin/${{ needs.prepare.outputs.BUILD_CONFIG }}/net9.0/win-x64/publish/**/*.pdb - overwrite: true - if-no-files-found: error - - - name: Artifact Linux Server - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.filename.outputs.LINUX_ARTIFACT }} - path: | - /snapshot/SPTarkov.Server/bin/${{ needs.prepare.outputs.BUILD_CONFIG }}/net9.0/linux-x64/publish/ - !/snapshot/SPTarkov.Server/bin/${{ needs.prepare.outputs.BUILD_CONFIG }}/net9.0/linux-x64/publish/**/*.pdb - overwrite: true - if-no-files-found: error - - build-docker-image-multi-arch: - needs: [prepare, build-server-host] - runs-on: ubuntu-latest - env: - DOCKERHUB_USER: stblog - DOCKERHUB_REPOSITORY: spt-server - GHCR_USER: airryco - GHCR_REPOSITORY: spt-server - - outputs: - DOCKER_DIGEST_AMD64: ${{ steps.build-and-push-amd64.outputs.digest }} - 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: - - name: Checkout - uses: actions/checkout@v4 - - name: Pull Files - run: git pull - - # docker - - name: Extract metadata for AMD64 - 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 Arm64 - id: meta-arm64 - 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-arm64 - - - 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 For AMD64 - id: build-and-push-amd64 - uses: docker/build-push-action@v6 - with: - context: ./docker - file: ./docker/Dockerfile-nightly - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: | - ${{ steps.meta.outputs.labels }} - org.opencontainers.image.version=${{ env.NIGHTLY_BRANCH }} - org.opencontainers.image.revision=${{ needs.build-server-host.outputs.COMMIT_ID_LONG }} - platforms: linux/amd64 - build-args: | - SPT_BUILD_TYPE=${{ needs.prepare.outputs.BUILD_TYPE }} - SPT_BUILD_CONFIG=${{ needs.prepare.outputs.BUILD_CONFIG }} - SPT_VERSION=${{ needs.prepare.outputs.SPT_VERSION }} - - - name: Build and Push For ARM64 - id: build-and-push-arm64 - uses: docker/build-push-action@v6 - with: - context: ./docker - file: ./docker/Dockerfile-nightly-arm64 - push: true - tags: ${{ steps.meta-arm64.outputs.tags }} - labels: | - ${{ steps.meta-arm64.outputs.labels }} - org.opencontainers.image.version=${{ env.NIGHTLY_BRANCH }} - org.opencontainers.image.revision=${{ needs.build-server-host.outputs.COMMIT_ID_LONG }} - platforms: linux/arm64 - build-args: | - SPT_BUILD_TYPE=${{ needs.prepare.outputs.BUILD_TYPE }} - SPT_BUILD_CONFIG=${{ needs.prepare.outputs.BUILD_CONFIG }} - SPT_VERSION=${{ needs.prepare.outputs.SPT_VERSION }} - - update-trigger-and-push: - needs: [prepare, build-server-host, build-docker-image-multi-arch] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - 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_COMMIT_ID }} - echo "server=$server" > trigger.nightly - changes=$(git status --porcelain) - if [ -n "$changes" ]; then - git add trigger.nightly - git commit -m "🤖 auto built spt-server: \`$server\`." - git push - fi - shell: bash - - assemble-and-publish: - needs: [prepare, build-server-host, build-docker-image-multi-arch, update-trigger-and-push] - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Download Windows Artifact - uses: actions/download-artifact@v4 - with: - name: ${{ needs.build-server-host.outputs.WIN_ARTIFACT }} - path: windows - - - name: Download Linux Artifact - uses: actions/download-artifact@v4 - with: - name: ${{ needs.build-server-host.outputs.LINUX_ARTIFACT }} - path: linux - - - name: Compress Releases - id: compress-release - run: | - cd windows - zip -r ../${{ needs.build-server-host.outputs.WIN_RELEASE_FILE }} * - cd ../linux - zip -r ../${{ needs.build-server-host.outputs.LINUX_RELEASE_FILE }} * - ls -R .. - shell: bash - - - 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.CLIENT_VERSION }}*** - - [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 }}** - - Build time: ***${{ needs.prepare.outputs.BUILD_DATE_TIME }}*** - - **Docker Supported For linux/amd64 and linux/arm64**: - - For liunx/amd64: - - image id: `${{ needs.build-docker-image-multi-arch.outputs.DOCKER_IMAGEID_AMD64 }}` - - digest: `${{ needs.build-docker-image-multi-arch.outputs.DOCKER_DIGEST_AMD64 }}` - - ```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 - ``` - - 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 - docker pull stblog/spt-server:nightly-arm64 - docker pull ghcr.io/airryco/spt-server:nightly-arm64 - docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:nightly-arm64 - ``` - - > [!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: [${{ needs.prepare.outputs.BUILT_HASH }}...${{ needs.prepare.outputs.SPT_COMMIT_ID }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}/compare/${{ needs.prepare.outputs.BUILT_HASH }}...${{ needs.prepare.outputs.SPT_COMMIT_ID }}) - - files: | - ${{ needs.build-server-host.outputs.WIN_RELEASE_FILE }} - ${{ needs.build-server-host.outputs.LINUX_RELEASE_FILE }} diff --git a/.github/workflows/build-release-cron.yaml b/.github/workflows/build-release-cron.yaml deleted file mode 100644 index 29f932e..0000000 --- a/.github/workflows/build-release-cron.yaml +++ /dev/null @@ -1,573 +0,0 @@ -name: SPT-Server Release - -on: - schedule: - - cron: '0 2 * * *' - push: - paths: - - '.github/workflows/build-release-cron.yaml' - -env: - SERVER_URL: https://github.com - REPOSITORY_SPT_SERVER: sp-tarkov/server - REPOSITORY_SPT_SERVER_AIRRYCO: AirryCo/spt-server - RELEASE_BRANCH: master - RELEASE_BRANCH_FIKA: main - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - PROCEED: ${{ steps.compare-tags.outputs.PROCEED }} - BUILT_TAG: ${{ steps.compare-tags.outputs.BUILT_TAG }} - BUILT_TAG_FIKA: ${{ steps.get-fika-tag.outputs.BUILT_TAG }} - TARGET_TAG: ${{ steps.compare-tags.outputs.TARGET_TAG }} - TARGET_TAG_FIKA: ${{ steps.get-fika-tag.outputs.TARGET_TAG}} - - SPT_VERSION: ${{ steps.versions.outputs.SPT_VERSION }} - EFT_VERSION: ${{ steps.versions.outputs.EFT_VERSION }} - SPT_SERVER_COMMIT: ${{ steps.versions.outputs.SPT_SERVER_COMMIT }} - SPT_SERVER_COMMIT_TIME: ${{ steps.versions.outputs.SPT_SERVER_COMMIT_TIME }} - BUILD_DATE: ${{ steps.versions.outputs.DATE }} - BUILD_DATE_TIME: ${{ steps.versions.outputs.DATE_TIME }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Get Latest Tag From SPT - id: get-latest-tag - run: | - GIT_LFS_SKIP_SMUDGE=1 git clone ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git Server - cd Server - git fetch --tags origin - SPT_SERVER_LATEST_TAG=$(git for-each-ref --sort=-creatordate --format='%(creatordate:iso) %(refname:short)' refs/tags | head -n1 | awk '{print $4}') - echo "👽 SPT_SERVER_LATEST_TAG = $SPT_SERVER_LATEST_TAG" - echo "SPT_SERVER_LATEST_TAG=$SPT_SERVER_LATEST_TAG" >> $GITHUB_OUTPUT - shell: bash - - name: Compare Tags - id: compare-tags - run: | - source trigger.release - server_last_built_tag=$server - server_latest_tag=${{ steps.get-latest-tag.outputs.SPT_SERVER_LATEST_TAG }} - if [ "$server_last_built_tag" != "$server_latest_tag" ] && ${{ !contains(steps.get-latest-tag.outputs.SPT_SERVER_LATEST_TAG, 'BE') }}; then - echo "✅ There is different between last-built-tag and lastest-tag, continue to build." - echo "BUILT_TAG=$server_last_built_tag" >> $GITHUB_OUTPUT - echo "TARGET_TAG=$server_latest_tag" >> $GITHUB_OUTPUT - echo "PROCEED=true" >> $GITHUB_OUTPUT - else - echo "✋ tags are the same, stop building." - echo "PROCEED=false" >> $GITHUB_OUTPUT - fi - shell: bash - - name: Get Fika-Server Latest Tag - id: get-fika-tag - if: steps.compare-tags.outputs.PROCEED == 'true' - run: | - source trigger.release - fika_built_tag=$fika - fika_latest_tag=$(git ls-remote --tags https://github.com/project-fika/Fika-Server.git | sort -t/ -k3 -V | tail -n 1 | awk '{print $2}' | sed 's/refs\/tags\///') - echo "BUILT_TAG=$fika_built_tag" >> $GITHUB_OUTPUT - echo "TARGET_TAG=$fika_latest_tag" >> $GITHUB_OUTPUT - shell: bash - - name: Extract versions - id: versions - if: steps.compare-tags.outputs.PROCEED == 'true' - run: | - cd Server - SERVER_TAG=${{ steps.get-latest-tag.outputs.SPT_SERVER_LATEST_TAG }} - git checkout $SERVER_TAG - SPT_SERVER_COMMIT=$(git rev-parse --short $SERVER_TAG) - SPT_SERVER_COMMIT_TIME=$(git log --pretty=format:"%ai" -1) - - # Extract versions from core.json - cp -v 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 "👽 SERVER_TAG = $SERVER_TAG" - echo "👽 SPT_SERVER_COMMIT = $SPT_SERVER_COMMIT" - echo "👽 SPT_SERVER_COMMIT_TIME = $SPT_SERVER_COMMIT_TIME" - - echo "SPT_VERSION=$SPT_VERSION" >> $GITHUB_OUTPUT - echo "EFT_VERSION=$EFT_VERSION" >> $GITHUB_OUTPUT - echo "SPT_SERVER_COMMIT=$SPT_SERVER_COMMIT" >> $GITHUB_OUTPUT - echo "SPT_SERVER_COMMIT_TIME=$SPT_SERVER_COMMIT_TIME" >> $GITHUB_OUTPUT - - echo "DATE=$(date +%Y%m%d)" >> $GITHUB_OUTPUT - echo "DATE_TIME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT - shell: bash - - build-server-linux: - needs: prepare - if: ${{ needs.prepare.outputs.PROCEED == 'true' }} - runs-on: ubuntu-latest - env: - OUTPUT_DIR: spt-server - - DOCKERHUB_USER: stblog - DOCKERHUB_REPOSITORY: spt-server - GHCR_USER: airryco - GHCR_REPOSITORY: spt-server - outputs: - 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_RELEASE_FILE: ${{ steps.filename.outputs.LINUX_RELEASE }} - LINUX_RELEASE_FIKA_FILE: ${{ steps.filename.outputs.LINUX_RELEASE_FIKA }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - repository: '${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}' - ref: '${{ env.RELEASE_BRANCH }}' - lfs: 'false' - fetch-depth: '0' - token: '${{ secrets.AIRRYCO_TOKEN }}' - - name: Setup Git Config - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "bot@github.com" - shell: bash - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 22.12.0 - - - name: Merge Server Code From SPT - 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 fetch -u ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git ${{ needs.prepare.outputs.TARGET_TAG }}:SPT-${{ needs.prepare.outputs.TARGET_TAG }} - git merge -m "🤖 Merge tag \`${{ needs.prepare.outputs.TARGET_TAG }}\` from SPT" --no-ff ${{ needs.prepare.outputs.TARGET_TAG }} - git tag -d ${{ needs.prepare.outputs.TARGET_TAG }} - git tag ${{ needs.prepare.outputs.TARGET_TAG }} - shell: bash - - - 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 - 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: | - 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: bash - - - name: Build Linux Server - id: build-server - run: | - git checkout ${{ needs.prepare.outputs.TARGET_TAG }} - cd 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.TARGET_TAG }}-linux-release-${{ 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.TARGET_TAG }}-linux-release-${{ 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: project/${{ env.OUTPUT_DIR }} - overwrite: true - retention-days: 1 - - - name: Push Linux Server Code - run: | - 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.RELEASE_BRANCH }} - git push -u origin ${{ needs.prepare.outputs.TARGET_TAG }} - shell: bash - - build-docker-image-multi-arch: - needs: [prepare, build-server-linux] - runs-on: ubuntu-latest - env: - DOCKERHUB_USER: stblog - DOCKERHUB_REPOSITORY: spt-server - GHCR_USER: airryco - GHCR_REPOSITORY: spt-server - - outputs: - DOCKER_DIGEST: ${{ steps.build-and-push.outputs.digest }} - DOCKER_IMAGEID: ${{ steps.build-and-push.outputs.imageid }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Git pull - run: | - git pull - - # docker - - name: Extract metadata for Docker with release version - 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=semver,pattern={{version}},value=${{ needs.prepare.outputs.TARGET_TAG }} - type=semver,pattern={{major}}.{{minor}},value=${{ needs.prepare.outputs.TARGET_TAG }} - type=raw,value=latest - - name: Extract metadata for Docker with release version and fika built-in - 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=semver,pattern={{version}}-fika,value=${{ needs.prepare.outputs.TARGET_TAG }} - type=semver,pattern={{major}}.{{minor}}-fika,value=${{ needs.prepare.outputs.TARGET_TAG }} - type=raw,value=latest-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 For Release With Fika - uses: docker/build-push-action@v6 - with: - context: ./docker - file: ./docker/Dockerfile-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 For Release - uses: docker/build-push-action@v6 - with: - context: ./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=${{ needs.build-server-linux.outputs.LINUX_COMMIT_ID_WHOLE }} - platforms: linux/amd64,linux/arm64 - - build-server-windows: - needs: [prepare, build-server-linux] - runs-on: windows-latest - env: - OUTPUT_DIR: spt-server - outputs: - 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: - repository: '${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}' - ref: '${{ env.RELEASE_BRANCH }}' - lfs: 'false' - fetch-depth: '1' - token: '${{ secrets.AIRRYCO_TOKEN }}' - - # Modify the JSON file with PowerShell - - name: Modify JSON file with PowerShell - run: | - cd project/assets/configs - $json = Get-Content -Path "core.json" | ConvertFrom-Json - $json.projectName = "AirryCo's SPT Windows" - $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.TARGET_TAG }}-win-release-${{ 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.TARGET_TAG }}-win-release-${{ 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 Windows Server - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.filename.outputs.WIN_ARTIFACT }} - path: project/${{ env.OUTPUT_DIR }} - overwrite: true - - assemble-and-publish: - needs: [prepare, build-server-windows, build-server-linux, build-docker-image-multi-arch] - runs-on: ubuntu-latest - - 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: Push Code To GitHub - run: | - git pull - rm trigger.release - echo "server=${{ needs.prepare.outputs.TARGET_TAG }}" > trigger.release - echo "fika=${{ needs.prepare.outputs.TARGET_TAG_FIKA }}" >> trigger.release - changes=$(git status --porcelain) - if [ -n "$changes" ]; then - git add trigger.release - git commit -m "🤖 bump to \`${{ needs.prepare.outputs.TARGET_TAG }}\`." - git push - fi - shell: bash - - - 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-Server - run: | - wget https://github.com/project-fika/Fika-Server/releases/download/${{ needs.prepare.outputs.TARGET_TAG_FIKA }}/fika-server-$(echo ${{ needs.prepare.outputs.TARGET_TAG_FIKA }} | cut -c2-).zip -O fika-server.zip - - - 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 - unzip ../fika-server.zip - zip -r ../${{ needs.build-server-windows.outputs.WIN_RELEASE_FIKA_FILE }} * - cd ../linux - unzip ../fika-server.zip - zip -r ../${{ needs.build-server-linux.outputs.LINUX_RELEASE_FIKA_FILE }} * - ls -R .. - - - name: Create Github Pre-release - id: create_pre_release - if: ${{ contains(needs.prepare.outputs.TARGET_TAG, 'BE') }} - uses: softprops/action-gh-release@v2 - with: - name: ${{ needs.prepare.outputs.TARGET_TAG }} - tag_name: ${{ needs.prepare.outputs.TARGET_TAG }} - 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 }}/tree/${{ needs.prepare.outputs.SPT_SERVER_COMMIT }}), commit time: **${{ needs.prepare.outputs.SPT_SERVER_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.TARGET_TAG_FIKA }}](https://github.com/project-fika/Fika-Server/tree/${{ needs.prepare.outputs.TARGET_TAG_FIKA }}) - - Build time: ***${{ needs.prepare.outputs.BUILD_DATE_TIME }}*** - - > [!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. - - ***Docker Supported For linux/amd64 and linux/arm64***: - - ```bash - docker pull stblog/spt-server:${{ needs.prepare.outputs.TARGET_TAG }} - docker pull ghcr.io/airryco/spt-server:${{ needs.prepare.outputs.TARGET_TAG }} - docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:${{ needs.prepare.outputs.TARGET_TAG }} - ``` - - Fika-Server built-in: - - ```bash - docker pull stblog/spt-server:${{ needs.prepare.outputs.TARGET_TAG }}-fika - docker pull ghcr.io/airryco/spt-server:${{ needs.prepare.outputs.TARGET_TAG }}-fika - docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:${{ needs.prepare.outputs.TARGET_TAG }}-fika - ``` - - Full Changelog: - - spt-server: [${{ needs.prepare.outputs.BUILT_TAG }}....${{ needs.prepare.outputs.TARGET_TAG }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}/compare/${{ needs.prepare.outputs.BUILT_TAG }}...${{ needs.prepare.outputs.TARGET_TAG }}) - - fika-server: [${{ needs.prepare.outputs.BUILT_TAG_FIKA }}....${{ needs.prepare.outputs.TARGET_TAG_FIKA }}](https://github.com/project-fika/Fika-Server/compare/${{ needs.prepare.outputs.BUILT_TAG }}...${{ needs.prepare.outputs.TARGET_TAG }}) - 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 }} - - - name: Create Github Release - id: create_release - if: ${{ !contains(needs.prepare.outputs.TARGET_TAG, 'BE') }} - uses: softprops/action-gh-release@v2 - with: - name: ${{ needs.prepare.outputs.TARGET_TAG }} - tag_name: ${{ needs.prepare.outputs.TARGET_TAG }} - prerelease: false - 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 }}/tree/${{ needs.prepare.outputs.SPT_SERVER_COMMIT }}), commit time: **${{ needs.prepare.outputs.SPT_SERVER_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.TARGET_TAG_FIKA }}](https://github.com/project-fika/Fika-Server/tree/${{ needs.prepare.outputs.TARGET_TAG_FIKA }}) - - Build time: ***${{ needs.prepare.outputs.BUILD_DATE_TIME }}*** - - > [!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. - - ***Docker Supported For linux/amd64 and linux/arm64***: - - ```bash - docker pull stblog/spt-server:${{ needs.prepare.outputs.TARGET_TAG }} - docker pull ghcr.io/airryco/spt-server:${{ needs.prepare.outputs.TARGET_TAG }} - docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:${{ needs.prepare.outputs.TARGET_TAG }} - ``` - - Fika-Server built-in: - - ```bash - docker pull stblog/spt-server:${{ needs.prepare.outputs.TARGET_TAG }}-fika - docker pull ghcr.io/airryco/spt-server:${{ needs.prepare.outputs.TARGET_TAG }}-fika - docker pull registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server:${{ needs.prepare.outputs.TARGET_TAG }}-fika - ``` - - Full Changelog: - - spt-server: [${{ needs.prepare.outputs.BUILT_TAG }}....${{ needs.prepare.outputs.TARGET_TAG }}](${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER_AIRRYCO }}/compare/${{ needs.prepare.outputs.BUILT_TAG }}...${{ needs.prepare.outputs.TARGET_TAG }}) - - fika-server: [${{ needs.prepare.outputs.BUILT_TAG_FIKA }}....${{ needs.prepare.outputs.TARGET_TAG_FIKA }}](https://github.com/project-fika/Fika-Server/compare/${{ needs.prepare.outputs.BUILT_TAG }}...${{ needs.prepare.outputs.TARGET_TAG }}) - 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 }} diff --git a/docker/Dockerfile-nightly b/Dockerfile similarity index 51% rename from docker/Dockerfile-nightly rename to Dockerfile index e38cd00..f42d334 100644 --- a/docker/Dockerfile-nightly +++ b/Dockerfile @@ -5,16 +5,25 @@ ARG SPT_BUILD_CONFIG RUN apt update && apt install -y git git-lfs wget && \ git clone -b develop --depth=1 https://github.com/sp-tarkov/server-csharp.git /snapshot && \ cd /snapshot && git lfs pull && \ - cd Libraries/SPTarkov.Server.Assets/SPT_Data/configs && sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Linux\",/g" core.json && \ - cd /snapshot/Libraries/SPTarkov.Server.Assets/SPT_Data/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 $SPT_BUILD_CONFIG -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) -p:IsPublish=true && \ + dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj \ + -c $SPT_BUILD_CONFIG \ + -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) \ + -p:IsPublish=true && \ rm SPTarkov.Server/bin/$SPT_BUILD_CONFIG/net9.0/linux-x64/publish/*.pdb && \ rm -rf /var/lib/apt/lists/* FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim ARG SPT_BUILD_CONFIG -LABEL author="AirryCo " +LABEL author="yhl452493373 " ENV TZ=Asia/Shanghai COPY --from=server-builder /snapshot/SPTarkov.Server/bin/$SPT_BUILD_CONFIG/net9.0/linux-x64/publish/ /app/spt-server/ VOLUME /opt/spt-server diff --git a/docker/Dockerfile-nightly-arm64 b/Dockerfile-arm64 similarity index 52% rename from docker/Dockerfile-nightly-arm64 rename to Dockerfile-arm64 index 3b56637..4aa0d84 100644 --- a/docker/Dockerfile-nightly-arm64 +++ b/Dockerfile-arm64 @@ -5,16 +5,25 @@ ARG SPT_BUILD_CONFIG RUN apt update && apt install -y git git-lfs wget && \ git clone -b develop --depth=1 https://github.com/sp-tarkov/server-csharp.git /snapshot && \ cd /snapshot && git lfs pull && \ - cd Libraries/SPTarkov.Server.Assets/SPT_Data/configs && sed -i "s/\"projectName\": \"SPT\",/\"projectName\": \"AirryCo's SPT Linux\",/g" core.json && \ - cd /snapshot/Libraries/SPTarkov.Server.Assets/SPT_Data/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 $SPT_BUILD_CONFIG -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) -p:IsPublish=true && \ + dotnet publish ./SPTarkov.Server/SPTarkov.Server.csproj \ + -c $SPT_BUILD_CONFIG \ + -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) \ + -p:IsPublish=true && \ rm SPTarkov.Server/bin/$SPT_BUILD_CONFIG/net9.0/linux-arm64/publish/*.pdb && \ rm -rf /var/lib/apt/lists/* FROM mcr.microsoft.com/dotnet/aspnet:9.0-bookworm-slim-arm64v8 ARG SPT_BUILD_CONFIG -LABEL author="AirryCo " +LABEL author="yhl452493373 " ENV TZ=Asia/Shanghai COPY --from=server-builder /snapshot/SPTarkov.Server/bin/$SPT_BUILD_CONFIG/net9.0/linux-arm64/publish/ /app/spt-server/ VOLUME /opt/spt-server diff --git a/README.md b/README.md deleted file mode 100644 index 4b1cbab..0000000 --- a/README.md +++ /dev/null @@ -1,92 +0,0 @@ -# Single Player Tarkov - Server Project(community) - -Automatically compiles the SPT code daily at midnight and pushes the compiled version to the releases. - -You can find the lanucher from [here](https://github.com/AirryCo/spt-launcher-ci/releases) - -[![SPT-Server Build Release](https://github.com/AirryCo/spt-server-ci/actions/workflows/build-release-cron.yaml/badge.svg)](https://github.com/AirryCo/spt-server-ci/actions/workflows/build-release-cron.yaml) - -[![SPT-Server Build Nightly](https://github.com/AirryCo/spt-server-ci/actions/workflows/build-nightly-cron.yaml/badge.svg)](https://github.com/AirryCo/spt-server-ci/actions/workflows/build-nightly-cron.yaml) - - -## How to use - -### For windows - -1. go to https://github.com/AirryCo/spt-server-ci/releases - -2. download the `.zip` file - -3. use extraction software to unzip the files - -4. then run `SPT.Server.exe` - -5. run `SPT.Launcher` to connect - -### For linux - -repository: ~~https://dev.sp-tarkov.com/medusa/spt-server~~ https://github.com/AirryCo/spt-server - -~~SPT Registry: https://dev.sp-tarkov.com/medusa/-/packages/container/spt-server/nightly~~ - -Docker Hub: https://hub.docker.com/r/stblog/spt-server - -Github Container Registry: https://github.com/AirryCo/spt-server-ci/pkgs/container/spt-server - -Aliyun Registry: registry.cn-shenzhen.aliyuncs.com/spt-server/spt-server - -> [!NOTE] -> ***Mods using***: please replace all instances of the string "/snapshot/project" in the mod folder with "/snapshot/workspace/medusa/spt-server/code/project" before running.(**version 3.9 only**,No changes required for version 3.10) -> -> You can run the commond `sed -i "s/\/snapshot\/workspace\/project/\/snapshot\/workspace\/medusa\/spt-server\/code\/project/g" $(grep -rl "/snapshot/workspace" .)` to replace all. - -### 3.10 - -1. use docker shell - -```bash -docker pull stblog/spt-server:nightly -docker run -d --name spt-server -v ./spt-server:/opt/spt-server -e backendIp=192.168.1.1 -e backendPort=6969 -p 6969:6969 stblog/spt-server:nightly -``` - -2. or use docker compose - -```yaml -services: - spt-server: - image: stblog/spt-server:nightly - container_name: spt-server - hostname: spt-server - restart: unless-stopped - volumes: - - ./spt-server:/opt/spt-server - network_mode: host - environment: - - backendIp=192.168.1.1 - - backendPort=6969 -``` - -`backendIp`(optional): Your server IP, default is your container IP like `172.17.0.2`. If `network_mode` is set to `host`, it will be your server IP by default - -`backendPort`(optional): Your server port, default is `6969` - -### 3.9 - -```bash -docker run -d --name spt-server --restart always -p 6969:6969 -v ./spt-server:/opt/spt-server stblog/spt-server:3.9 -``` - -docker compose -```yaml -services: - spt-server: - image: stblog/spt-server - container_name: spt-server - restart: always - volumes: - - './spt-server:/opt/spt-server' - ports: - - '6969:6969' -``` - -You need to modify the value of `backendIp` to your server IP in `SPT_Data/Server/configs/http.json` diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..028ff22 --- /dev/null +++ b/build.sh @@ -0,0 +1,43 @@ +#!/bin/bash +SERVER_URL=https://github.com +REPOSITORY_SPT_SERVER=sp-tarkov/server-csharp +BRANCH=develop + +latest_tag=$(git ls-remote --tags $SERVER_URL/$REPOSITORY_SPT_SERVER.git | awk -F'/' '{print $NF}' | grep -v '\^{}' | sort -V | tail -1) + +SPT_BUILD_TYPE=RELEASE #LOCAL, DEBUG, RELEASE, BLEEDING_EDGE, BLEEDING_EDGE_MODS +SPT_VERSION=$(echo $latest_tag | cut -d'-' -f1) +SPT_COMMIT_ID=$(git ls-remote $SERVER_URL/$REPOSITORY_SPT_SERVER.git refs/heads/$BRANCH | awk '{print $1}') +SPT_COMMIT_ID=${SPT_COMMIT_ID:0:8} +CLIENT_VERSION=$(wget -qO- "https://raw.githubusercontent.com/$REPOSITORY_SPT_SERVER/refs/heads/$BRANCH/Libraries/SPTarkov.Server.Assets/SPT_Data/configs/core.json" | jq -r '.compatibleTarkovVersion') +DATE_TIME=$(date +%Y%m%d) + +echo "SPT服务端构建类型:$SPT_BUILD_TYPE" +echo "SPT服务端版本:$SPT_VERSION" +echo "SPT服务端提交ID:$SPT_COMMIT_ID" +echo "适用客户端版本:$CLIENT_VERSION" +echo "构建日期:$DATE_TIME" + +docker buildx build \ + --platform linux/amd64 \ + -t yhl452493373/spt-server:$SPT_VERSION-$DATE_TIME-$SPT_COMMIT_ID \ + --build-arg SPT_VERSION=$SPT_VERSION \ + --build-arg SPT_BUILD_TYPE=$SPT_BUILD_TYPE \ + --build-arg SPT_BUILD_CONFIG=Release \ + -f Dockerfile . + +echo "AMD64镜像构建完毕,若无需ARM64镜像,则直接终止脚本,否则按任意键" + +read -n 1 -s -r -p "按任意键继续构建ARM64镜像,或按 Ctrl+C 终止..." + +echo "开始构建ARM64镜像" + +docker buildx build \ + --platform linux/arm64 \ + -t yhl452493373/spt-server:$SPT_VERSION-$DATE_TIME-$SPT_COMMIT_ID-arm64 \ + --build-arg SPT_VERSION=$SPT_VERSION \ + --build-arg SPT_BUILD_TYPE=$SPT_BUILD_TYPE \ + --build-arg SPT_BUILD_CONFIG=Release \ + -f Dockerfile-arm64 . + +echo "ARM64镜像构建完毕" \ No newline at end of file diff --git a/custom/bg.png b/custom/bg.png deleted file mode 100644 index 9792665..0000000 Binary files a/custom/bg.png and /dev/null differ diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 814f072..0000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM node:22.12.0-bullseye AS server-builder -RUN apt update && apt install -y git git-lfs p7zip-full && \ - git clone -b master --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ - cd /snapshot && git lfs pull && \ - cd project && \ - npm install && npm run build:release && \ - rm -rf /var/lib/apt/lists/* - -FROM debian:bookworm-slim -LABEL author="AirryCo " -ENV TZ=Asia/Shanghai -COPY --from=server-builder /snapshot/project/build/ /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"] - diff --git a/docker/Dockerfile-fika b/docker/Dockerfile-fika deleted file mode 100644 index 7e8672f..0000000 --- a/docker/Dockerfile-fika +++ /dev/null @@ -1,27 +0,0 @@ -FROM node:22.12.0-alpine AS fika-builder -RUN apk add --no-cache git unzip && \ - git clone -b main --depth=1 https://github.com/project-fika/Fika-Server.git /fika-server && \ - cd /fika-server && \ - npm install && npm run build && \ - mkdir output && cd output && unzip /fika-server/dist/*.zip - -FROM node:22.12.0-bullseye AS server-builder -RUN apt update && apt install -y git git-lfs p7zip-full && \ - git clone -b master --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ - cd /snapshot && git lfs pull && \ - cd project && \ - npm install && npm run build:release && \ - rm -rf /var/lib/apt/lists/* - -FROM debian:bookworm-slim -LABEL author="AirryCo " -ENV TZ=Asia/Shanghai -COPY --from=server-builder /snapshot/project/build/ /app/spt-server/ -COPY --from=fika-builder /fika-server/output/ /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"] - diff --git a/docker/Dockerfile-manual b/docker/Dockerfile-manual deleted file mode 100644 index 6e055c1..0000000 --- a/docker/Dockerfile-manual +++ /dev/null @@ -1,19 +0,0 @@ -FROM node:22.12.0-bullseye AS server-builder -RUN apt update && apt install -y git git-lfs p7zip-full && \ - git clone -b 3.11.3 --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ - cd /snapshot && git lfs pull && \ - cd project && \ - npm install && npm run build:release && \ - rm -rf /var/lib/apt/lists/* - -FROM debian:bookworm-slim -LABEL author="AirryCo " -ENV TZ=Asia/Shanghai -COPY --from=server-builder /snapshot/project/build/ /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"] - diff --git a/docker/Dockerfile-manual-fika b/docker/Dockerfile-manual-fika deleted file mode 100644 index 64f887b..0000000 --- a/docker/Dockerfile-manual-fika +++ /dev/null @@ -1,27 +0,0 @@ -FROM node:22.12.0-alpine AS fika-builder -RUN apk add --no-cache git unzip && \ - git clone -b v2.4.6 --depth=1 https://github.com/project-fika/Fika-Server.git /fika-server && \ - cd /fika-server && \ - npm install && npm run build && \ - mkdir output && cd output && unzip /fika-server/dist/*.zip - -FROM node:22.12.0-bullseye AS server-builder -RUN apt update && apt install -y git git-lfs p7zip-full && \ - git clone -b 3.11.3 --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ - cd /snapshot && git lfs pull && \ - cd project && \ - npm install && npm run build:release && \ - rm -rf /var/lib/apt/lists/* - -FROM debian:bookworm-slim -LABEL author="AirryCo " -ENV TZ=Asia/Shanghai -COPY --from=server-builder /snapshot/project/build/ /app/spt-server/ -COPY --from=fika-builder /fika-server/output/ /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"] - diff --git a/docker/Dockerfile-nightly-fika b/docker/Dockerfile-nightly-fika deleted file mode 100644 index 7736303..0000000 --- a/docker/Dockerfile-nightly-fika +++ /dev/null @@ -1,27 +0,0 @@ -FROM node:22.12.0-alpine AS fika-builder -RUN apk add --no-cache git unzip && \ - git clone -b main --depth=1 https://github.com/project-fika/Fika-Server.git /fika-server && \ - cd /fika-server && \ - npm install && npm run build && \ - mkdir output && cd output && unzip /fika-server/dist/*.zip - -FROM node:22.12.0-bullseye AS server-builder -RUN apt update && apt install -y git git-lfs p7zip-full && \ - git clone -b 3.11.x-DEV --depth=1 https://github.com/AirryCo/spt-server.git /snapshot && \ - cd /snapshot && git lfs pull && \ - cd project && \ - npm install && npm run build:release && \ - rm -rf /var/lib/apt/lists/* - -FROM debian:bookworm-slim -LABEL author="AirryCo " -ENV TZ=Asia/Shanghai -COPY --from=server-builder /snapshot/project/build/ /app/spt-server/ -COPY --from=fika-builder /fika-server/output/ /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"] - diff --git a/docker/entrypoint.sh b/entrypoint.sh similarity index 97% rename from docker/entrypoint.sh rename to entrypoint.sh index 37a5ca8..96e4dd3 100644 --- a/docker/entrypoint.sh +++ b/entrypoint.sh @@ -54,4 +54,4 @@ if [ ! -f "sptLogger.json" ]; then fi fi -chmod +x SPTarkov.Server && ./SPTarkov.Server +chmod +x SPT.Server.Linux && ./SPT.Server.Linux diff --git a/trigger.nightly b/trigger.nightly deleted file mode 100644 index 927bee5..0000000 --- a/trigger.nightly +++ /dev/null @@ -1 +0,0 @@ -server=0f447469 diff --git a/trigger.release b/trigger.release deleted file mode 100644 index 93805a9..0000000 --- a/trigger.release +++ /dev/null @@ -1,2 +0,0 @@ -server=3.11.3 -fika=v2.4.6