@@ -103,6 +103,12 @@ jobs:
103103 # Try semantic-release, but handle PR-related failures gracefully
104104 if npx semantic-release --debug; then
105105 echo "✅ Semantic release completed successfully"
106+
107+ # Get the version that was created
108+ LATEST_TAG=$(gh release list --limit 1 | head -n 1 | awk '{print $1}')
109+ echo "🔍 Debug: Latest release tag from semantic-release: $LATEST_TAG"
110+ echo "new_release_version=${LATEST_TAG#v}" >> $GITHUB_OUTPUT
111+ echo "new_release_published=true" >> $GITHUB_OUTPUT
106112 else
107113 SEMANTIC_EXIT_CODE=$?
108114 echo "⚠️ Semantic release failed with exit code: $SEMANTIC_EXIT_CODE"
@@ -111,6 +117,7 @@ jobs:
111117 if gh release list --limit 1 | head -n 1 | grep -q "v"; then
112118 LATEST_TAG=$(gh release list --limit 1 | head -n 1 | awk '{print $1}')
113119 echo "✅ Release $LATEST_TAG was created despite semantic-release error"
120+ echo "🔍 Debug: Latest release tag from fallback: $LATEST_TAG"
114121 echo "new_release_version=${LATEST_TAG#v}" >> $GITHUB_OUTPUT
115122 echo "new_release_published=true" >> $GITHUB_OUTPUT
116123 else
@@ -148,10 +155,19 @@ jobs:
148155 id : version
149156 run : |
150157 VERSION="${{ needs.release.outputs.version }}"
158+ echo "🔍 Debug: Received version from release job: '$VERSION'"
159+
160+ if [ -z "$VERSION" ]; then
161+ echo "❌ Error: Version is empty!"
162+ exit 1
163+ fi
164+
151165 echo "full=$VERSION" >> $GITHUB_OUTPUT
152166
153167 # Extract major, minor, patch
154168 IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
169+ echo "🔍 Debug: Version components - MAJOR=$MAJOR, MINOR=$MINOR, PATCH=$PATCH"
170+
155171 echo "major=$MAJOR" >> $GITHUB_OUTPUT
156172 echo "minor=$MINOR" >> $GITHUB_OUTPUT
157173 echo "patch=$PATCH" >> $GITHUB_OUTPUT
@@ -160,6 +176,8 @@ jobs:
160176 echo "major_tag=v$MAJOR" >> $GITHUB_OUTPUT
161177 echo "minor_tag=v$MAJOR.$MINOR" >> $GITHUB_OUTPUT
162178 echo "patch_tag=v$MAJOR.$MINOR.$PATCH" >> $GITHUB_OUTPUT
179+
180+ echo "🔍 Debug: Generated tags - major_tag=v$MAJOR, minor_tag=v$MAJOR.$MINOR, patch_tag=v$MAJOR.$MINOR.$PATCH"
163181
164182 - name : Generate Docker metadata
165183 id : meta
@@ -209,16 +227,34 @@ jobs:
209227 fetch-depth : 0
210228 token : ${{ secrets.GITHUB_TOKEN }}
211229
212- - name : Update major version tag
230+ - name : Update mutable Git tags
213231 run : |
214232 VERSION="${{ needs.release.outputs.version }}"
215- MAJOR=$(echo $VERSION | cut -d. -f1)
216-
217- # Update or create the major version tag
233+ echo "Creating mutable tags for version: $VERSION"
234+
235+ # Extract version components
236+ IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
237+ echo "Version components: MAJOR=$MAJOR, MINOR=$MINOR, PATCH=$PATCH"
238+
239+ # Configure git
240+ git config user.name "github-actions[bot]"
241+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
242+
243+ # Create and push major version tag (v1, v2, etc.)
244+ echo "Creating major version tag: v$MAJOR"
218245 git tag -f "v$MAJOR"
219246 git push origin "v$MAJOR" --force
220-
221- echo "Updated mutable tag v$MAJOR to point to v$VERSION"
247+ echo "✅ Updated mutable tag v$MAJOR to point to v$VERSION"
248+
249+ # Create and push minor version tag (v1.2, v1.3, etc.)
250+ echo "Creating minor version tag: v$MAJOR.$MINOR"
251+ git tag -f "v$MAJOR.$MINOR"
252+ git push origin "v$MAJOR.$MINOR" --force
253+ echo "✅ Updated mutable tag v$MAJOR.$MINOR to point to v$VERSION"
254+
255+ # List all tags to verify
256+ echo "Current tags:"
257+ git tag --sort=-version:refname | head -10
222258
223259 - name : Create release summary
224260 run : |
0 commit comments