Skip to content

Commit 8b952b7

Browse files
committed
ci: improve release workflows
1 parent 8457062 commit 8b952b7

2 files changed

Lines changed: 37 additions & 9 deletions

File tree

ci/create_rc.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,21 @@ else
7878
echo "Warning: Previous tag not found"
7979
fi
8080

81+
# Determine release type based on version components
82+
# - major: X.0.0 releases
83+
# - minor: X.Y.0 releases where Y > 0
84+
# - patch: X.Y.Z releases where Z > 0
85+
if [ "${PATCH}" -gt 0 ]; then
86+
RELEASE_TYPE="patch"
87+
elif [ "${MINOR}" -eq 0 ]; then
88+
RELEASE_TYPE="major"
89+
else
90+
RELEASE_TYPE="minor"
91+
fi
92+
echo "Release type: ${RELEASE_TYPE}"
93+
8194
echo "Successfully created RC tag: ${RC_TAG}"
8295
echo "RC_TAG=${RC_TAG}" >> $GITHUB_OUTPUT 2>/dev/null || true
8396
echo "RC_VERSION=${RC_VERSION}" >> $GITHUB_OUTPUT 2>/dev/null || true
8497
echo "PREVIOUS_TAG=${PREVIOUS_TAG}" >> $GITHUB_OUTPUT 2>/dev/null || true
85-
echo "RELEASE_TYPE=patch" >> $GITHUB_OUTPUT 2>/dev/null || true
98+
echo "RELEASE_TYPE=${RELEASE_TYPE}" >> $GITHUB_OUTPUT 2>/dev/null || true

ci/publish_beta.sh

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,32 @@ fi
169169
BETA_MAJOR=$(echo "${NEW_VERSION}" | cut -d. -f1)
170170
BETA_MINOR=$(echo "${NEW_VERSION}" | cut -d. -f2)
171171
BETA_PATCH=$(echo "${NEW_VERSION}" | cut -d. -f3 | cut -d- -f1)
172+
BETA_NUM=$(echo "${NEW_VERSION}" | sed 's/.*-beta\.//')
172173

173174
if [[ "${BRANCH}" == "main" ]]; then
174-
# For main branch: compare against release-root tag
175-
BETA_RELEASE_ROOT_TAG="release-root/${BETA_MAJOR}.${BETA_MINOR}.${BETA_PATCH}-beta.N"
176-
177-
if git rev-parse "${BETA_RELEASE_ROOT_TAG}" >/dev/null 2>&1; then
178-
echo "Release notes will compare from ${BETA_RELEASE_ROOT_TAG} to ${BETA_TAG}"
179-
RELEASE_NOTES_FROM="${BETA_RELEASE_ROOT_TAG}"
175+
# For main branch:
176+
# - First beta (beta.1): compare against release-root tag (all changes since last RC)
177+
# - Subsequent betas (beta.2+): compare against previous beta tag (incremental changes)
178+
if [ "${BETA_NUM}" -eq 1 ]; then
179+
BETA_RELEASE_ROOT_TAG="release-root/${BETA_MAJOR}.${BETA_MINOR}.${BETA_PATCH}-beta.N"
180+
if git rev-parse "${BETA_RELEASE_ROOT_TAG}" >/dev/null 2>&1; then
181+
echo "First beta: release notes will compare from ${BETA_RELEASE_ROOT_TAG} to ${BETA_TAG}"
182+
RELEASE_NOTES_FROM="${BETA_RELEASE_ROOT_TAG}"
183+
else
184+
echo "Warning: Release root tag ${BETA_RELEASE_ROOT_TAG} not found"
185+
RELEASE_NOTES_FROM=""
186+
fi
180187
else
181-
echo "Warning: Release root tag ${BETA_RELEASE_ROOT_TAG} not found"
182-
RELEASE_NOTES_FROM=""
188+
# For beta.2+, compare against previous beta
189+
PREV_BETA_NUM=$((BETA_NUM - 1))
190+
PREV_BETA_TAG="${TAG_PREFIX}${BETA_MAJOR}.${BETA_MINOR}.${BETA_PATCH}-beta.${PREV_BETA_NUM}"
191+
if git rev-parse "${PREV_BETA_TAG}" >/dev/null 2>&1; then
192+
echo "Subsequent beta: release notes will compare from ${PREV_BETA_TAG} to ${BETA_TAG}"
193+
RELEASE_NOTES_FROM="${PREV_BETA_TAG}"
194+
else
195+
echo "Warning: Previous beta tag ${PREV_BETA_TAG} not found"
196+
RELEASE_NOTES_FROM=""
197+
fi
183198
fi
184199
elif [[ "${BRANCH}" =~ ^release/ ]]; then
185200
# For release branch: compare against last stable tag

0 commit comments

Comments
 (0)