mirror of
https://github.com/sp-tarkov/build.git
synced 2025-02-13 06:30:45 -05:00
71 lines
2.1 KiB
YAML
71 lines
2.1 KiB
YAML
name: SPT Release Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
Build Server:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: refringe/spt-build-server:0.0.1
|
|
steps:
|
|
- name: Clone
|
|
run: |
|
|
rm -rf ./server
|
|
git clone https://dev.sp-tarkov.com/SPT-AKI/Server.git --branch 3.8.0-BE --depth 1 ./server
|
|
working-path: ./
|
|
|
|
- name: Pull LFS Files
|
|
run: git lfs pull && git lfs ls-files
|
|
working-path: ./server
|
|
|
|
- name: Runner Debug Information
|
|
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 "Associated Tags: $(git tag --contains HEAD)"
|
|
echo "Branch Name: $(git branch --show-current)"
|
|
echo "Last Commit Message: $(git log -1 --pretty=%B)"
|
|
working-path: ./server
|
|
|
|
- name: Cache Keys
|
|
id: cache-keys
|
|
run: |
|
|
echo "::set-output name=commit_hash::$(git rev-parse HEAD)"
|
|
TAGS=$(git tag --contains HEAD)
|
|
if [[ "$TAGS" == "" ]]; then
|
|
TAGS="no-tag"
|
|
fi
|
|
echo "::set-output name=tags::${TAGS//[$'\n\r']/}"
|
|
echo "Commit Hash: ${{ steps.cache-keys.outputs.commit_hash }}"
|
|
echo "Tags: ${{ steps.cache-keys.outputs.tags }}"
|
|
working-path: ./server
|
|
|
|
- name: Build Cache
|
|
id: build-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ./server/project/build
|
|
key: build-${{ steps.cache-keys.outputs.commit_hash }}-${{ steps.cache-keys.outputs.tags }}
|
|
restore-keys: |
|
|
build-${{ steps.cache-keys.outputs.commit_hash }}-
|
|
build-
|
|
|
|
- name: Install Dependencies
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
run: npm install
|
|
working-path: ./server/project
|
|
|
|
- name: Build Server
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
|
run: npm run build:bleeding
|
|
working-path: ./server/project
|
|
|
|
# TODO: find build type
|