Skip to content

Commit 252d6ef

Browse files
committed
Permit releases on 0.6 branch
1 parent dc0ee40 commit 252d6ef

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

.github/workflows/_test_release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ on:
77
required: true
88
type: string
99
description: "From which folder this pipeline executes"
10+
11+
release-branch:
12+
required: false
13+
type: string
14+
default: "main"
15+
1016

1117
env:
1218
PYTHON_VERSION: "3.10"
@@ -16,7 +22,7 @@ permissions:
1622

1723
jobs:
1824
build:
19-
if: github.ref == 'refs/heads/main'
25+
if: github.ref == 'refs/heads/${{ inputs.release-branch }}'
2026
runs-on: ubuntu-latest
2127

2228
outputs:

.github/workflows/release.yml

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616

1717
jobs:
1818
build:
19-
if: github.ref == 'refs/heads/main'
19+
if: github.ref == 'refs/heads/0.6'
2020
runs-on: ubuntu-latest
2121

2222
outputs:
@@ -79,6 +79,10 @@ jobs:
7979
echo short-pkg-name="$SHORT_PKG_NAME" >> $GITHUB_OUTPUT
8080
echo version="$VERSION" >> $GITHUB_OUTPUT
8181
echo tag="$TAG" >> $GITHUB_OUTPUT
82+
echo "Pkg-name: $PKG_NAME"
83+
echo "Short-pkg-name: $SHORT_PKG_NAME"
84+
echo "Version: $VERSION"
85+
echo "Tag: $TAG"
8286
8387
release-notes:
8488
needs:
@@ -93,7 +97,7 @@ jobs:
9397
path: langgraph
9498
sparse-checkout: | # this only grabs files for relevant dir
9599
${{ inputs.working-directory }}
96-
ref: main # this scopes to just master branch
100+
ref: "0.6" #this scopes to just 0.6 branch
97101
fetch-depth: 0 # this fetches entire commit history
98102
- name: Check Tags
99103
id: check-tags
@@ -105,19 +109,48 @@ jobs:
105109
VERSION: ${{ needs.build.outputs.version }}
106110
TAG: ${{ needs.build.outputs.tag }}
107111
run: |
108-
if [ -z $SHORT_PKG_NAME ]; then
109-
REGEX="^\\d+\\.\\d+\\.\\d+((a|b|rc)\\d+)?\$"
112+
# 1) Parse major/minor and enforce we're on the 0.6 series
113+
MAJOR="${VERSION%%.*}"
114+
REST="${VERSION#*.}"
115+
MINOR="${REST%%.*}"
116+
117+
# Minor/major numeric guard: fail if >= 0.7.* (or any non-0 major)
118+
if [ -z "$MAJOR" ] || [ -z "$MINOR" ]; then
119+
echo "Could not parse VERSION '$VERSION' to MAJOR.MINOR"
120+
exit 1
121+
fi
122+
123+
if [ "$MAJOR" -ne 0 ] || [ "$MINOR" -ne 6 ]; then
124+
echo "Refusing to release VERSION '$VERSION' from 0.6 maintenance branch (got $MAJOR.$MINOR)"
125+
exit 1
126+
fi
127+
128+
# 2) Build a regex that only matches 0.6.* tags, handling both tag shapes
129+
# - Plain: ^0\.6\.\d+((a|b|rc)\d+)?$
130+
# - With prefix: ^<SHORT>==0\.6\.\d+((a|b|rc)\d+)?$
131+
SERIES_REGEX="0\\.6"
132+
if [ -z "$SHORT_PKG_NAME" ]; then
133+
REGEX="^${SERIES_REGEX}\\.\\d+((a|b|rc)\\d+)?$"
110134
else
111-
REGEX="^$SHORT_PKG_NAME==\\d+\\.\\d+\\.\\d+((a|b|rc)\\d+)?\$"
135+
# SHORT_PKG_NAME is already pre-sanitized by your step (e.g., no spaces).
136+
REGEX="^${SHORT_PKG_NAME}==${SERIES_REGEX}\\.\\d+((a|b|rc)\\d+)?$"
112137
fi
113-
echo $REGEX
114-
PREV_TAG=$(git tag --sort=-creatordate | grep -P $REGEX | head -1 || echo "")
115-
echo $PREV_TAG
116-
if [ "$TAG" == "$PREV_TAG" ]; then
117-
echo "No new version to release"
138+
139+
echo "Tag match regex: $REGEX"
140+
141+
# 3) Find the most recent tag in this series
142+
PREV_TAG="$(git tag --sort=-creatordate | grep -P "$REGEX" | head -1 || true)"
143+
echo "Previous tag in series: ${PREV_TAG:-<none>}"
144+
145+
# 4) If computed TAG equals the previous tag, there’s nothing new to release
146+
if [ "$TAG" = "$PREV_TAG" ] && [ -n "$TAG" ]; then
147+
echo "No new version to release for 0.6.x (TAG matches previous)."
118148
exit 1
119149
fi
120-
echo prev-tag="$PREV_TAG" >> $GITHUB_OUTPUT
150+
151+
# 5) Surface prev-tag for later steps
152+
echo "prev-tag=$PREV_TAG" >> "$GITHUB_OUTPUT"
153+
121154
- name: Generate release body
122155
id: generate-release-body
123156
working-directory: langgraph
@@ -149,6 +182,7 @@ jobs:
149182
uses: ./.github/workflows/_test_release.yml
150183
with:
151184
working-directory: ${{ inputs.working-directory }}
185+
release-branch: "0.6"
152186
secrets: inherit
153187

154188
pre-release-checks:

0 commit comments

Comments
 (0)