Skip to content

Commit c86f553

Browse files
ci: skip verifyRelease in prepare-release dry-run and add changelog
1 parent 5980ce6 commit c86f553

3 files changed

Lines changed: 368 additions & 12 deletions

File tree

.github/workflows/prepare-release.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,14 @@ jobs:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
run: |
4141
# Run semantic-release with dry-run to detect version
42-
NEXT_VERSION=$(npx semantic-release --dry-run --verify-conditions false | tee /dev/stderr | awk '/The next release version is/{print $NF}')
42+
set -o pipefail
43+
if ! OUTPUT=$(npx semantic-release --dry-run --verify-conditions false --verify-release false 2>&1); then
44+
echo "$OUTPUT"
45+
echo "::error::semantic-release failed during version detection"
46+
exit 1
47+
fi
48+
echo "$OUTPUT"
49+
NEXT_VERSION=$(echo "$OUTPUT" | awk '/The next release version is/{print $NF}')
4350
echo "next=$NEXT_VERSION" >> $GITHUB_OUTPUT
4451
4552
- name: Update package.json
@@ -48,6 +55,10 @@ jobs:
4855
env:
4956
NEXT_VERSION: ${{ steps.version.outputs.next }}
5057

58+
- name: Update CHANGELOG.md
59+
if: steps.version.outputs.next != ''
60+
run: npm run update-changelog
61+
5162
- name: Create Pull Request
5263
if: steps.version.outputs.next != ''
5364
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
@@ -63,6 +74,7 @@ jobs:
6374
**Changes:**
6475
- Updated version in `package.json` to ${{ steps.version.outputs.next }}
6576
- Updated version in `package-lock.json` to ${{ steps.version.outputs.next }}
77+
- Updated `CHANGELOG.md` with release notes
6678
6779
**Next Steps:**
6880
Review and merge this PR to trigger the publish workflow.

0 commit comments

Comments
 (0)