mirror of
https://github.com/sp-tarkov/build.git
synced 2025-02-12 20:30:44 -05:00
Converts server job to use windows-latest and powershell
Cross your fingers
This commit is contained in:
parent
8b27f94e69
commit
a92baa2a21
87
.github/workflows/build.yaml
vendored
87
.github/workflows/build.yaml
vendored
@ -166,57 +166,68 @@ jobs:
|
|||||||
build-server:
|
build-server:
|
||||||
needs: prepare
|
needs: prepare
|
||||||
if: needs.prepare.outputs.proceed == 'true'
|
if: needs.prepare.outputs.proceed == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: windows-latest
|
||||||
container:
|
|
||||||
image: refringe/spt-build-node:1.0.9
|
|
||||||
outputs:
|
outputs:
|
||||||
server_commit: ${{ steps.clone-server.outputs.server_commit }}
|
server_commit: ${{ steps.commit-hash.outputs.hash }}
|
||||||
steps:
|
steps:
|
||||||
- name: Clone Server
|
- name: Setup Git Target
|
||||||
id: clone-server
|
shell: pwsh
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
rm -rf /workspace/SPT/Build/server
|
if ("${{ needs.prepare.outputs.is_nightly }}" -eq "true") {
|
||||||
if [[ "${{ needs.prepare.outputs.is_nightly }}" == "true" ]]; then
|
echo "TARGET=${{ needs.prepare.outputs.branch_server }}" >> $env:GITHUB_ENV
|
||||||
BRANCH=${{ needs.prepare.outputs.branch_server }}
|
}
|
||||||
echo "Cloning branch $BRANCH"
|
else {
|
||||||
git clone https://github.com/sp-tarkov/server.git --branch "$BRANCH" --depth 1 /workspace/SPT/Build/server
|
echo "TARGET=${{ needs.prepare.outputs.target_tag }}" >> $env:GITHUB_ENV
|
||||||
else
|
}
|
||||||
TAG=${{ needs.prepare.outputs.target_tag }}
|
Write-Host "Cloning target: ${{ env.TARGET }}"
|
||||||
echo "Cloning tag $TAG"
|
|
||||||
git clone https://github.com/sp-tarkov/server.git --branch "$TAG" --depth 1 /workspace/SPT/Build/server
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd /workspace/SPT/Build/server
|
- uses: actions/checkout@v4
|
||||||
echo "server_commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
with:
|
||||||
|
ref: ${{ env.TARGET }}
|
||||||
|
lfs: false
|
||||||
|
path: 'SPT/Build/server'
|
||||||
|
|
||||||
- name: Pull LFS Files
|
- name: Pull LFS
|
||||||
shell: bash
|
run: git lfs pull
|
||||||
run: |
|
shell: pwsh
|
||||||
cd /workspace/SPT/Build/server
|
working-directory: ./SPT/Build/server
|
||||||
git lfs install --local
|
|
||||||
git lfs pull
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
- name: Output Commit Hash
|
||||||
shell: bash
|
id: commit-hash
|
||||||
run: |
|
shell: pwsh
|
||||||
cd /workspace/SPT/Build/server/project
|
run: Write-Host ("hash=" + (git rev-parse --short HEAD)) | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
|
||||||
npm install
|
working-directory: ./SPT/Build/server
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version-file: "SPT/Build/server/project/.nvmrc"
|
||||||
|
cache: "npm"
|
||||||
|
cache-dependency-path: "SPT/Build/server/project/package.json"
|
||||||
|
|
||||||
|
- name: Check NPM Cache
|
||||||
|
id: cache-check
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: ~/.npm
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('SPT/Build/server/project/package.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
|
- name: Install NPM Dependencies
|
||||||
|
if: steps.cache-check.outputs.cache-hit != 'true'
|
||||||
|
run: npm install
|
||||||
|
working-directory: ./SPT/Build/server/project
|
||||||
|
|
||||||
- name: Build Server
|
- name: Build Server
|
||||||
shell: bash
|
shell: pwsh
|
||||||
run: |
|
run: npm run build:${{ needs.prepare.outputs.build_type }} -- --arch=x64 --platform=win32
|
||||||
cd /workspace/SPT/Build/server/project
|
working-directory: ./SPT/Build/server/project
|
||||||
BUILD_TYPE="${{ needs.prepare.outputs.build_type }}"
|
|
||||||
echo "Running build for $BUILD_TYPE"
|
|
||||||
npm run build:$BUILD_TYPE -- --arch=x64 --platform=win32
|
|
||||||
printf "\nBuilt!\n\n"
|
|
||||||
|
|
||||||
- name: Upload Server Artifact
|
- name: Upload Server Artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: server-artifact
|
name: server-artifact
|
||||||
path: /workspace/SPT/Build/server/project/build/
|
path: ./SPT/Build/server/project/build/
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user