Skip to content

Commit 02f562d

Browse files
committed
test version for auto version
1 parent 56f485a commit 02f562d

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

.github/workflows/DO_NOT_RUN_auto_version_dev.yml renamed to .github/workflows/auto_version_dev.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,23 @@
77
#
88
# Versioning Logic:
99
# - 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
1412
#
1513
# 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`
1817
#
1918
# The updated version is then committed and pushed back to the `dev` branch.
2019
#
2120
# Prerequisites:
2221
# - `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
2423
# - GitHub Actions bot must have workflow permission to push to `dev`.
2524
# -----------------------------------------------------------------------------
2625

27-
name: Bump Dev Version
26+
name: zzz [DO NOT RUN] Bump LOOP_FOLLOW_MARKETING_VERSION on dev push
2827

2928
on:
3029
push:
@@ -53,18 +52,18 @@ jobs:
5352
VERSION_LINE=$(grep -E '^LOOP_FOLLOW_MARKETING_VERSION *= *[0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?' "$FILE")
5453
CURRENT_VERSION=$(echo "$VERSION_LINE" | sed -E 's/^LOOP_FOLLOW_MARKETING_VERSION *= *//')
5554
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"
5857
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"
6261
else
63-
BUILD=$((BUILD + 1))
62+
FIX=$((FIX + 1))
6463
fi
6564
6665
# Construct new version
67-
NEW_VERSION="$MAJOR.$MINOR.$FIX.$BUILD"
66+
NEW_VERSION="$MAJOR.$MINOR.$FIX"
6867
echo "New version: $NEW_VERSION"
6968
7069
# Escape dots in current version for sed replacement

0 commit comments

Comments
 (0)