mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
ci(workflow): Calculate release increment based on target channel (#3420)
This commit is contained in:
parent
df37f3e030
commit
f09b522f97
1 changed files with 13 additions and 4 deletions
17
.github/workflows/create-or-promote-release.yml
vendored
17
.github/workflows/create-or-promote-release.yml
vendored
|
|
@ -71,12 +71,21 @@ jobs:
|
|||
fi
|
||||
|
||||
echo "Found latest internal tag to promote: $LATEST_INTERNAL_TAG"
|
||||
INCREMENT=$(echo "$LATEST_INTERNAL_TAG" | sed -n "s/.*-internal\.\([0-9]*\)/\1/p")
|
||||
|
||||
if [[ "$CHANNEL" == "production" ]]; then
|
||||
NEW_TAG="v${BASE_VERSION}"
|
||||
# Calculate the increment for the TARGET channel
|
||||
if [[ "$CHANNEL" != "production" ]]; then
|
||||
LATEST_CHANNEL_TAG=$(git tag --list "v${BASE_VERSION}-${CHANNEL}.*" --sort=-v:refname | head -n 1)
|
||||
|
||||
if [ -z "$LATEST_CHANNEL_TAG" ]; then
|
||||
INCREMENT=1
|
||||
else
|
||||
INCREMENT=$(echo "$LATEST_CHANNEL_TAG" | sed -n "s/.*-${CHANNEL}\.\([0-9]*\)/\1/p" | awk '{print $1+1}')
|
||||
fi
|
||||
|
||||
NEW_TAG="v${BASE_VERSION}-${CHANNEL}.${INCREMENT}"
|
||||
else
|
||||
NEW_TAG="v${BASE_VERSION}-${CHANNEL}.${INCREMENT}"
|
||||
# Production is special, it has no increment
|
||||
NEW_TAG="v${BASE_VERSION}"
|
||||
fi
|
||||
|
||||
echo "New release name will be: $NEW_TAG"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue