|
13 | 13 | # - major
|
14 | 14 | required: true
|
15 | 15 | default: patch
|
| 16 | + mark_as_alpha: |
| 17 | + type: boolean |
| 18 | + description: Mark as alpha release |
| 19 | + required: false |
| 20 | + default: false |
16 | 21 |
|
17 | 22 | jobs:
|
18 | 23 | update:
|
@@ -40,26 +45,23 @@ jobs:
|
40 | 45 | run: |
|
41 | 46 | FILE=./Source/Immutable/Public/Immutable/ImmutableDataTypes.h
|
42 | 47 | UPGRADE_TYPE=${{ github.event.inputs.upgrade_type }}
|
| 48 | + MARK_AS_ALPHA=${{ github.event.inputs.mark_as_alpha }} |
43 | 49 |
|
44 | 50 | RAW_VERSION=$(grep -oP '#define ENGINE_SDK_VERSION TEXT\("\K[0-9]+\.[0-9]+\.[0-9]+(\.[a-zA-Z]+)?' $FILE)
|
45 |
| - |
46 | 51 | VERSION=$(echo "$RAW_VERSION" | grep -oP '^[0-9]+\.[0-9]+\.[0-9]+')
|
| 52 | + HAS_ALPHA=$(echo "$RAW_VERSION" | grep -q "\.alpha" && echo "true" || echo "false") |
47 | 53 |
|
48 | 54 | IFS='.' read -r major minor patch <<< "$VERSION"
|
49 | 55 |
|
50 |
| - # If the version had an alpha suffix, adjust the version bump behavior |
51 |
| - if [[ "$RAW_VERSION" == *".alpha" ]]; then |
| 56 | + if [[ "$HAS_ALPHA" == "true" ]]; then |
52 | 57 | if [ "$UPGRADE_TYPE" == "patch" ]; then
|
53 |
| - # Remove alpha suffix, keep the same version |
54 | 58 | UPDATED_VERSION="$major.$minor.$patch"
|
55 | 59 | elif [ "$UPGRADE_TYPE" == "minor" ]; then
|
56 |
| - # E.g. skip 1.3.0, go directly to 1.4.0 |
57 | 60 | minor=$((minor + 1))
|
58 | 61 | patch=0
|
59 | 62 | UPDATED_VERSION="$major.$minor.$patch"
|
60 | 63 | fi
|
61 | 64 | else
|
62 |
| - # Increment patch or minor |
63 | 65 | if [ "$UPGRADE_TYPE" == "patch" ]; then
|
64 | 66 | patch=$((patch + 1))
|
65 | 67 | elif [ "$UPGRADE_TYPE" == "minor" ]; then
|
|
69 | 71 | UPDATED_VERSION="$major.$minor.$patch"
|
70 | 72 | fi
|
71 | 73 |
|
| 74 | + if [[ "$MARK_AS_ALPHA" == "true" && "$HAS_ALPHA" == "false" ]]; then |
| 75 | + UPDATED_VERSION="$UPDATED_VERSION.alpha" |
| 76 | + fi |
| 77 | + |
72 | 78 | sed -i -E "s/#define ENGINE_SDK_VERSION TEXT\(\"[0-9]+\.[0-9]+\.[0-9]+(\.[a-zA-Z]+)?\"\)/#define ENGINE_SDK_VERSION TEXT(\"$UPDATED_VERSION\")/g" $FILE
|
73 | 79 |
|
74 | 80 | echo "Updated version: $UPDATED_VERSION"
|
|
0 commit comments