Skip to content

Commit 2544b71

Browse files
fix: Try fix release
1 parent 8dcc6f8 commit 2544b71

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/release.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,27 @@ jobs:
9797
--notes "Manual release: ${{ github.event.inputs.version_type }} version bump" \
9898
--target main
9999
else
100-
# Automatic semantic release
101-
npx semantic-release --debug
100+
# Automatic semantic release with error handling
101+
echo "Running automatic semantic release..."
102+
103+
# Try semantic-release, but handle PR-related failures gracefully
104+
if npx semantic-release --debug; then
105+
echo "✅ Semantic release completed successfully"
106+
else
107+
SEMANTIC_EXIT_CODE=$?
108+
echo "⚠️ Semantic release failed with exit code: $SEMANTIC_EXIT_CODE"
109+
110+
# Check if this was a PR-related failure and the release was actually created
111+
if gh release list --limit 1 | head -n 1 | grep -q "v"; then
112+
LATEST_TAG=$(gh release list --limit 1 | head -n 1 | awk '{print $1}')
113+
echo "✅ Release $LATEST_TAG was created despite semantic-release error"
114+
echo "new_release_version=${LATEST_TAG#v}" >> $GITHUB_OUTPUT
115+
echo "new_release_published=true" >> $GITHUB_OUTPUT
116+
else
117+
echo "❌ No release was created"
118+
exit $SEMANTIC_EXIT_CODE
119+
fi
120+
fi
102121
fi
103122
104123
build-and-tag:

.releaserc.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
"@semantic-release/github",
1212
{
1313
"assets": [],
14-
"releasedLabels": false
14+
"releasedLabels": false,
15+
"addReleases": "bottom",
16+
"failComment": false,
17+
"failTitle": false,
18+
"successComment": false
1519
}
1620
]
1721
]

0 commit comments

Comments
 (0)