|
7 | 7 | # |
8 | 8 | # Versioning Logic: |
9 | 9 | # - Reads the `LOOP_FOLLOW_MARKETING_VERSION` from `Config.xcconfig`. |
10 | | -# - If the version is in `MAJOR.MINOR.PATCH.BUILD` format (4 digits), |
11 | | -# the `BUILD` number is incremented by 1. |
12 | | -# - If the version is in `MAJOR.MINOR.PATCH` format (3 digits), |
13 | | -# a `.1` is appended to start a `BUILD` count. |
| 10 | +# - The version is `MAJOR.MINOR.PATCH` format (3 digits) |
| 11 | +# where PATCH is 0 for main branch, each update to dev increments by 1 |
14 | 12 | # |
15 | 13 | # Example: |
16 | | -# - `0.5.0` → `0.5.0.1` |
17 | | -# - `0.5.0.3` → `0.5.0.4` |
| 14 | +# - `2.4.0` for main |
| 15 | +# for dev → `2.4.1`, then → `2.4.2` |
| 16 | +# - next release (main) will be `2.5.0` |
18 | 17 | # |
19 | 18 | # The updated version is then committed and pushed back to the `dev` branch. |
20 | 19 | # |
21 | 20 | # Prerequisites: |
22 | 21 | # - `LOOP_FOLLOW_MARKETING_VERSION` must exist and be defined using the format: |
23 | | -# LOOP_FOLLOW_MARKETING_VERSION = x.y.z or x.y.z.w |
| 22 | +# LOOP_FOLLOW_MARKETING_VERSION = x.y.z |
24 | 23 | # - GitHub Actions bot must have workflow permission to push to `dev`. |
25 | 24 | # ----------------------------------------------------------------------------- |
26 | 25 |
|
27 | | -name: Bump Dev Version |
| 26 | +name: zzz [DO NOT RUN] Bump LOOP_FOLLOW_MARKETING_VERSION on dev push |
28 | 27 |
|
29 | 28 | on: |
30 | 29 | push: |
@@ -53,18 +52,18 @@ jobs: |
53 | 52 | VERSION_LINE=$(grep -E '^LOOP_FOLLOW_MARKETING_VERSION *= *[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?' "$FILE") |
54 | 53 | CURRENT_VERSION=$(echo "$VERSION_LINE" | sed -E 's/^LOOP_FOLLOW_MARKETING_VERSION *= *//') |
55 | 54 | |
56 | | - # Split version into components (up to 4) |
57 | | - IFS='.' read -r MAJOR MINOR FIX BUILD <<< "$CURRENT_VERSION" |
| 55 | + # Split version into components (up to 3) |
| 56 | + IFS='.' read -r MAJOR MINOR FIX <<< "$CURRENT_VERSION" |
58 | 57 |
|
59 | | - # If 4th digit not present, start at 1; else increment |
60 | | - if [ -z "$BUILD" ]; then |
61 | | - BUILD=1 |
| 58 | + # Increment FIX |
| 59 | + if [ -z "$FIX" ]; then |
| 60 | + echo "Error, FIX not found" |
62 | 61 | else |
63 | | - BUILD=$((BUILD + 1)) |
| 62 | + FIX=$((FIX + 1)) |
64 | 63 | fi |
65 | 64 |
|
66 | 65 | # Construct new version |
67 | | - NEW_VERSION="$MAJOR.$MINOR.$FIX.$BUILD" |
| 66 | + NEW_VERSION="$MAJOR.$MINOR.$FIX" |
68 | 67 | echo "New version: $NEW_VERSION" |
69 | 68 |
|
70 | 69 | # Escape dots in current version for sed replacement |
|
0 commit comments