0
0
mirror of https://github.com/sp-tarkov/build.git synced 2025-02-13 07:10:46 -05:00

Refactor build type determination logic in build.yaml

This commit is contained in:
Refringe 2024-03-02 21:57:09 -05:00
parent 9d0787fdf9
commit f16d4c7823
No known key found for this signature in database
GPG Key ID: DA8524051241DD36

View File

@ -49,21 +49,16 @@ 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: |
IFS=$'\n' read -r -d '' -a ADDR <<< "${{ steps.cache-keys.outputs.tags }}" || true TAGS="${{ steps.cache-keys.outputs.tags }}"
BUILD_TYPE="debug" # Default BUILD_TYPE="debug" # Default
for TAG in "${ADDR[@]}"; do if [[ "$TAGS" =~ -BE ]]; then
RELEASE_BUILD_REGEX='^(v?\d+\.\d+\.\d+)$' BUILD_TYPE="bleeding"
BLEEDING_BUILD_REGEX='^(v?\d+\.\d+\.\d+-BE(?:-[^-]+)?)$' elif [[ "$TAGS" =~ ^(v?\d+\.\d+\.\d+)$ ]]; then
if [[ "$TAG" =~ $RELEASE_BUILD_REGEX ]]; then BUILD_TYPE="release"
BUILD_TYPE="release" fi
break # Stop checking
elif [[ "$TAG" =~ $BLEEDING_BUILD_REGEX ]]; then
BUILD_TYPE="bleeding"
fi
done
echo "Build type: $BUILD_TYPE" echo "Build type: $BUILD_TYPE"
echo "::set-output name=build_type::$BUILD_TYPE" echo "::set-output name=build_type::$BUILD_TYPE"
shell: bash shell: bash