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
11 changes: 9 additions & 2 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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 @@ -49,7 +56,7 @@ jobs:

- name: Update CHANGELOG.md
if: steps.version.outputs.next != ''
run: npx conventional-changelog-cli -p conventionalcommits -i CHANGELOG.md -s
run: npm run update-changelog

- name: Create Pull Request
if: steps.version.outputs.next != ''
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"lint": "eslint .",
"coverage": "nyc mocha --use_strict",
"test": "mocha",
"prepare": "husky"
"prepare": "husky",
"update-changelog": "conventional-changelog -p conventionalcommits -i CHANGELOG.md"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -54,7 +55,7 @@
"@semantic-release/exec": "^7.0.3",
"atob": "^2.1.2",
"chai": "^4.1.2",
"conventional-changelog": "~1.1.0",
"conventional-changelog": "^7.2.1",
"conventional-changelog-conventionalcommits": "^9.3.0",
"eslint": "^4.19.1",
"husky": "^9.1.7",
Expand Down