Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,14 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Run semantic-release with dry-run to detect version
NEXT_VERSION=$(npx semantic-release --dry-run --verify-conditions false | tee /dev/stderr | awk '/The next release version is/{print $NF}')
set -o pipefail
if ! OUTPUT=$(npx semantic-release --dry-run --verify-conditions false --verify-release false 2>&1); then
echo "$OUTPUT"
echo "::error::semantic-release failed during version detection"
exit 1
fi
echo "$OUTPUT"
NEXT_VERSION=$(echo "$OUTPUT" | awk '/The next release version is/{print $NF}')
echo "next=$NEXT_VERSION" >> $GITHUB_OUTPUT

- name: Update package.json
Expand All @@ -48,6 +55,10 @@ jobs:
env:
NEXT_VERSION: ${{ steps.version.outputs.next }}

- name: Update CHANGELOG.md
if: steps.version.outputs.next != ''
run: npm run update-changelog

- name: Create Pull Request
if: steps.version.outputs.next != ''
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
Expand All @@ -63,6 +74,7 @@ jobs:
**Changes:**
- Updated version in `package.json` to ${{ steps.version.outputs.next }}
- Updated version in `package-lock.json` to ${{ steps.version.outputs.next }}
- Updated `CHANGELOG.md` with release notes

**Next Steps:**
Review and merge this PR to trigger the publish workflow.
Expand Down
Loading