mirror of
https://github.com/sp-tarkov/build.git
synced 2025-02-13 09:50:45 -05:00
Refactor build type determination logic
This commit is contained in:
parent
d6344653d6
commit
9d0787fdf9
@ -49,20 +49,19 @@ jobs:
|
|||||||
echo "Tags: ${{ steps.cache-keys.outputs.tags }}"
|
echo "Tags: ${{ steps.cache-keys.outputs.tags }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Determine Build Type
|
- name: Build Type
|
||||||
id: build-type
|
id: build-type
|
||||||
run: |
|
run: |
|
||||||
IFS='-' read -ra ADDR <<< "${{ steps.cache-keys.outputs.tags }}"
|
IFS=$'\n' read -r -d '' -a ADDR <<< "${{ steps.cache-keys.outputs.tags }}" || true
|
||||||
BUILD_TYPE="debug" # Default to debug
|
BUILD_TYPE="debug" # Default
|
||||||
for TAG in "${ADDR[@]}"; do
|
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 [[ "$TAG" =~ $RELEASE_BUILD_REGEX ]]; then
|
if [[ "$TAG" =~ $RELEASE_BUILD_REGEX ]]; then
|
||||||
BUILD_TYPE="release"
|
BUILD_TYPE="release"
|
||||||
break # Priority given to release, stop checking further
|
break # Stop checking
|
||||||
elif [[ "$TAG" =~ $BLEEDING_BUILD_REGEX ]]; then
|
elif [[ "$TAG" =~ $BLEEDING_BUILD_REGEX ]]; then
|
||||||
BUILD_TYPE="bleeding"
|
BUILD_TYPE="bleeding"
|
||||||
# Don't break here to ensure release tags take precedence if present
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "Build type: $BUILD_TYPE"
|
echo "Build type: $BUILD_TYPE"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user