2024-02-29 21:44:53 -05:00
|
|
|
name: SPT Release Build
|
2024-02-29 21:25:58 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ main ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ main ]
|
|
|
|
|
|
|
|
jobs:
|
2024-03-01 16:35:27 -05:00
|
|
|
Build Server:
|
2024-02-29 21:25:58 -05:00
|
|
|
runs-on: ubuntu-latest
|
2024-03-01 11:12:38 -05:00
|
|
|
container:
|
2024-03-02 13:59:49 -05:00
|
|
|
image: refringe/spt-build-server:0.0.1
|
2024-02-29 21:25:58 -05:00
|
|
|
steps:
|
2024-03-02 14:42:07 -05:00
|
|
|
- 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
|
|
|
|
|
|
|
|
- name: Pull LFS Files
|
2024-03-02 14:48:27 -05:00
|
|
|
run: |
|
|
|
|
cd ./server
|
|
|
|
git lfs pull && git lfs ls-files
|
2024-03-02 14:42:07 -05:00
|
|
|
|
|
|
|
- name: Runner Debug Information
|
2024-03-02 13:59:49 -05:00
|
|
|
run: |
|
2024-03-02 14:48:27 -05:00
|
|
|
cd ./server
|
2024-03-02 14:38:19 -05:00
|
|
|
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)"
|
2024-03-02 14:52:00 -05:00
|
|
|
echo "Last Commit Message:" && git log -1 --pretty=%B
|
2024-03-01 18:54:44 -05:00
|
|
|
|
2024-03-02 14:38:19 -05:00
|
|
|
- name: Cache Keys
|
|
|
|
id: cache-keys
|
|
|
|
run: |
|
2024-03-02 14:48:27 -05:00
|
|
|
cd ./server
|
2024-03-02 14:38:19 -05:00
|
|
|
echo "::set-output name=commit_hash::$(git rev-parse HEAD)"
|
2024-03-02 14:52:00 -05:00
|
|
|
TAGS=$(git tag --contains HEAD || echo "no-tag")
|
|
|
|
if [ -z "$TAGS" ]; then
|
2024-03-02 14:38:19 -05:00
|
|
|
TAGS="no-tag"
|
|
|
|
fi
|
2024-03-02 14:52:00 -05:00
|
|
|
printf "::set-output name=tags::%s" "${TAGS//$'\n'/,}"
|
2024-03-02 14:38:19 -05:00
|
|
|
echo "Commit Hash: ${{ steps.cache-keys.outputs.commit_hash }}"
|
|
|
|
echo "Tags: ${{ steps.cache-keys.outputs.tags }}"
|
2024-03-02 14:52:00 -05:00
|
|
|
shell: bash
|
2024-03-02 14:38:19 -05:00
|
|
|
|
|
|
|
- name: Build Cache
|
|
|
|
id: build-cache
|
2024-03-01 16:35:27 -05:00
|
|
|
uses: actions/cache@v4
|
2024-03-01 16:29:25 -05:00
|
|
|
with:
|
2024-03-02 14:38:19 -05:00
|
|
|
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-
|
2024-03-01 13:19:08 -05:00
|
|
|
|
2024-03-02 14:07:51 -05:00
|
|
|
- name: Install Dependencies
|
2024-03-02 14:38:19 -05:00
|
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
2024-03-02 14:48:27 -05:00
|
|
|
run: |
|
|
|
|
cd ./server/project
|
|
|
|
npm install
|
2024-03-02 13:59:49 -05:00
|
|
|
|
2024-03-02 14:07:51 -05:00
|
|
|
- name: Build Server
|
2024-03-02 14:38:19 -05:00
|
|
|
if: steps.build-cache.outputs.cache-hit != 'true'
|
2024-03-02 14:48:27 -05:00
|
|
|
run: |
|
|
|
|
cd ./server/project
|
|
|
|
npm run build:bleeding
|
2024-03-02 13:59:49 -05:00
|
|
|
|
2024-03-02 14:48:27 -05:00
|
|
|
# find build type
|
|
|
|
# npm install
|
|
|
|
# npm build:type
|