From ec75510635c6360195e512f7f664efe063183293 Mon Sep 17 00:00:00 2001 From: AirryCo Date: Fri, 24 Oct 2025 22:56:58 +0800 Subject: [PATCH] fixed `SPT-VERSION` getting. --- .github/workflows/build-nightly-cron.yaml | 4 +- .github/workflows/build-nightly-manual.yaml | 209 -------- .github/workflows/build-release-manual.yaml | 525 -------------------- 3 files changed, 3 insertions(+), 735 deletions(-) delete mode 100644 .github/workflows/build-nightly-manual.yaml delete mode 100644 .github/workflows/build-release-manual.yaml diff --git a/.github/workflows/build-nightly-cron.yaml b/.github/workflows/build-nightly-cron.yaml index 1f8d48c..dbe707d 100644 --- a/.github/workflows/build-nightly-cron.yaml +++ b/.github/workflows/build-nightly-cron.yaml @@ -60,9 +60,11 @@ jobs: 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}' | 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 - SPT_VERSION=4.0.1 CLIENT_VERSION=$(jq -r '.compatibleTarkovVersion' core.json) echo "👽 CLIENT_VERSION = $CLIENT_VERSION" diff --git a/.github/workflows/build-nightly-manual.yaml b/.github/workflows/build-nightly-manual.yaml deleted file mode 100644 index ba78e5c..0000000 --- a/.github/workflows/build-nightly-manual.yaml +++ /dev/null @@ -1,209 +0,0 @@ -name: SPT-Server Nightly Manual - -on: - push: - paths: - - '.github/workflows/build-nightly-manual.yaml' - -env: - SERVER_URL: https://dev.sp-tarkov.com - REPOSITORY_SERVER: SPT/Server - REPOSITORY_SERVER_MEDUSA: medusa/spt-server - NIGHTLY_BRANCH: 3.11.x-DEV - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - SPT_VERSION: ${{ steps.versions.outputs.SPT_VERSION }} - EFT_VERSION: ${{ steps.versions.outputs.EFT_VERSION }} - BUILD_DATE_TIME: ${{ steps.versions.outputs.DATE_TIME }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Extract versions - id: versions - run: | - # Extract versions from core.json - wget ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SERVER_MEDUSA }}/raw/branch/${{ 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_VERSION=$SPT_VERSION" >> $GITHUB_OUTPUT - echo "EFT_VERSION=$EFT_VERSION" >> $GITHUB_OUTPUT - echo "DATE_TIME=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT - shell: bash - - build-server-windows: - needs: prepare - runs-on: windows-latest - env: - OUTPUT_DIR: spt-server - SOURCECODE_DIR: c:/code - - 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 Medusa's Server Code - run: | - git clone ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SERVER_MEDUSA }} ${{ env.SOURCECODE_DIR }} - cd ${{ env.SOURCECODE_DIR }} - git checkout ${{ env.NIGHTLY_BRANCH }}_windows - git lfs pull - shell: bash - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20.11.1 - - - 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 - shell: pwsh - - - name: Build 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 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 - echo "WIN_ARTIFACT=$artifact_name" >> $GITHUB_OUTPUT - shell: bash - - - name: Artifact Server - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.filename.outputs.WIN_ARTIFACT }} - path: ${{ env.SOURCECODE_DIR }}/project/${{ env.OUTPUT_DIR }} - overwrite: true - - build-server-linux: - needs: prepare - runs-on: ubuntu-latest - env: - OUTPUT_DIR: spt-server - SOURCECODE_DIR: ${{ github.workspace }}/code - - 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 Medusa's Server Code - run: | - git clone ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SERVER_MEDUSA }} ${{ env.SOURCECODE_DIR }} - cd ${{ env.SOURCECODE_DIR }} - git checkout ${{ env.NIGHTLY_BRANCH }} - git lfs pull - shell: bash - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 20.11.1 - - - 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 - shell: bash - - - name: Build 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 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 - echo "LINUX_ARTIFACT=$artifact_name" >> $GITHUB_OUTPUT - shell: bash - - - name: Artifact Server - uses: actions/upload-artifact@v4 - with: - name: ${{ steps.filename.outputs.LINUX_ARTIFACT }} - path: ${{ env.SOURCECODE_DIR }}/project/${{ env.OUTPUT_DIR }} - overwrite: true - diff --git a/.github/workflows/build-release-manual.yaml b/.github/workflows/build-release-manual.yaml deleted file mode 100644 index 1fa1166..0000000 --- a/.github/workflows/build-release-manual.yaml +++ /dev/null @@ -1,525 +0,0 @@ -name: SPT-Server Release Manual - -on: - push: - tags: - - '*' - -env: - SERVER_URL: https://github.com - REPOSITORY_SPT_SERVER: sp-tarkov/server - REPOSITORY_SPT_SERVER_AIRRYCO: AirryCo/spt-server - -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 -b ${{ github.ref_name }} ${{ env.SERVER_URL }}/${{ env.REPOSITORY_SPT_SERVER }}.git Server - cd Server - SPT_SERVER_LATEST_TAG=${{ github.ref_name }} - 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 }} - echo "BUILT_TAG=$server_last_built_tag" >> $GITHUB_OUTPUT - echo "TARGET_TAG=$server_latest_tag" >> $GITHUB_OUTPUT - echo "PROCEED=true" >> $GITHUB_OUTPUT - 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 }} - 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: '${{ github.ref_name }}' - 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" - 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 - 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 - 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: | - 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 - - 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 - - # docker - - name: Extract metadata for Docker with release version - if: ${{ !contains(needs.prepare.outputs.TARGET_TAG, 'BE') }} - 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 - if: ${{ !contains(needs.prepare.outputs.TARGET_TAG, 'BE') }} - 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 - if: ${{ !contains(needs.prepare.outputs.TARGET_TAG, 'BE') }} - uses: docker/build-push-action@v6 - with: - context: ./docker - file: ./docker/Dockerfile-manual-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 - if: ${{ !contains(needs.prepare.outputs.TARGET_TAG, 'BE') }} - uses: docker/build-push-action@v6 - with: - context: ./docker - file: ./docker/Dockerfile-manual - 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: '${{ github.ref_name }}' - 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 - - - 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 }}