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:
parent
297e254107
commit
d6344653d6
@ -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 }}"
|
||||||
RELEASE_BUILD_REGEX='^(v?\d+\.\d+\.\d+)$'
|
BUILD_TYPE="debug" # Default to debug
|
||||||
BLEEDING_BUILD_REGEX='^(v?\d+\.\d+\.\d+-(BE)(?:-[^-]+)?)$'
|
for TAG in "${ADDR[@]}"; do
|
||||||
if [[ "$TAGS" =~ $RELEASE_BUILD_REGEX ]]; then
|
RELEASE_BUILD_REGEX='^(v?\d+\.\d+\.\d+)$'
|
||||||
echo "Build type: release"
|
BLEEDING_BUILD_REGEX='^(v?\d+\.\d+\.\d+-(BE)(?:-[^-]+)?)$'
|
||||||
echo "::set-output name=build_type::release"
|
if [[ "$TAG" =~ $RELEASE_BUILD_REGEX ]]; then
|
||||||
elif [[ "$TAGS" =~ $BLEEDING_BUILD_REGEX ]]; then
|
BUILD_TYPE="release"
|
||||||
echo "Build type: bleeding"
|
break # Priority given to release, stop checking further
|
||||||
echo "::set-output name=build_type::bleeding"
|
elif [[ "$TAG" =~ $BLEEDING_BUILD_REGEX ]]; then
|
||||||
else
|
BUILD_TYPE="bleeding"
|
||||||
echo "Build type: debug"
|
# Don't break here to ensure release tags take precedence if present
|
||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user