0
0
mirror of https://github.com/sp-tarkov/build.git synced 2025-02-13 06:30:45 -05:00

Refactor build type determination logic in build.yaml

This commit is contained in:
Refringe 2024-03-02 15:25:43 -05:00
parent 297e254107
commit d6344653d6
No known key found for this signature in database
GPG Key ID: DA8524051241DD36

View File

@ -49,22 +49,24 @@ jobs:
echo "Tags: ${{ steps.cache-keys.outputs.tags }}" echo "Tags: ${{ steps.cache-keys.outputs.tags }}"
shell: bash shell: bash
- name: Build Type - name: Determine Build Type
id: build-type id: build-type
run: | run: |
TAGS="${{ steps.cache-keys.outputs.tags }}" IFS='-' read -ra ADDR <<< "${{ steps.cache-keys.outputs.tags }}"
BUILD_TYPE="debug" # Default to debug
for TAG in "${ADDR[@]}"; do
RELEASE_BUILD_REGEX='^(v?\d+\.\d+\.\d+)$' RELEASE_BUILD_REGEX='^(v?\d+\.\d+\.\d+)$'
BLEEDING_BUILD_REGEX='^(v?\d+\.\d+\.\d+-(BE)(?:-[^-]+)?)$' BLEEDING_BUILD_REGEX='^(v?\d+\.\d+\.\d+-(BE)(?:-[^-]+)?)$'
if [[ "$TAGS" =~ $RELEASE_BUILD_REGEX ]]; then if [[ "$TAG" =~ $RELEASE_BUILD_REGEX ]]; then
echo "Build type: release" BUILD_TYPE="release"
echo "::set-output name=build_type::release" break # Priority given to release, stop checking further
elif [[ "$TAGS" =~ $BLEEDING_BUILD_REGEX ]]; then elif [[ "$TAG" =~ $BLEEDING_BUILD_REGEX ]]; then
echo "Build type: bleeding" BUILD_TYPE="bleeding"
echo "::set-output name=build_type::bleeding" # Don't break here to ensure release tags take precedence if present
else
echo "Build type: debug"
echo "::set-output name=build_type::debug"
fi fi
done
echo "Build type: $BUILD_TYPE"
echo "::set-output name=build_type::$BUILD_TYPE"
shell: bash shell: bash
- name: Build Cache - name: Build Cache
@ -95,6 +97,7 @@ jobs:
- name: Archive Build - name: Archive Build
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: build-artifacts name: server-build
path: ./server/project/build/ path: ./server/project/build/
overwrite: true overwrite: true