1616
1717jobs :
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 :
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 :
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