-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Web3 1195 readme and slack / github release notes (#16)
* docs: update README and add commitlint configuration in CI pipeline for automated release notes * chore: update build-publish workflow and add conventional-changelog-cli
- Loading branch information
Showing
9 changed files
with
1,563 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ jobs: | |
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
|
@@ -47,10 +49,43 @@ jobs: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc | ||
|
||
- name: Generate Release Notes | ||
id: generate_release_notes | ||
run: | | ||
git fetch --tags | ||
current_tag="v${{ env.package_version }}" | ||
last_tag=$(git tag --sort=-creatordate | grep -B1 "$current_tag" | head -n 1) | ||
if [ -z "$last_tag" ]; then | ||
echo "No previous tag found. Generating release notes for all history." | ||
npx conventional-changelog -p angular -o release_notes.md | ||
else | ||
echo "Generating release notes from $last_tag to $current_tag." | ||
npx conventional-changelog -p angular -o release_notes.md --from "$last_tag" --to "$current_tag" | ||
fi | ||
if [ ! -s release_notes.md ]; then | ||
echo "Error: No new conventional commits found to generate release notes." | ||
exit 1 | ||
fi | ||
echo "release_notes<<EOF" >> $GITHUB_ENV | ||
cat release_notes.md >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Publish to npm | ||
id: publish | ||
run: npm publish --ignore-scripts | ||
|
||
- name: Create GitHub Release | ||
if: ${{ steps.publish.outcome == 'success' }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release create "$current_tag" -F release_notes.md -t "Release $current_tag" | ||
- name: Send Slack Notification for Publish | ||
if: ${{ steps.publish.outcome == 'success' }} | ||
uses: slackapi/[email protected] | ||
|
@@ -62,7 +97,7 @@ jobs: | |
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "*:tada: :zk-logo-icon-square-black: zkVerifyJS Package v${{ env.package_version }} Published :zk-logo-icon-square-black: :tada:*\n\n*Build URL:* <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to view the build>\n\n*Published Package:* <https://www.npmjs.com/package/zkverifyjs/v/${{ env.package_version }}|zkverifyjs@${{ env.package_version }}>" | ||
"text": "*:tada: :zk-logo-icon-square-black: zkVerifyJS Package v${{ env.package_version }} Published :zk-logo-icon-square-black: :tada:*\n\n*Build URL:* <https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to view the build>\n\n*Published Package:* <https://www.npmjs.com/package/zkverifyjs/v/${{ env.package_version }}|zkverifyjs@${{ env.package_version }}>\n\n*Release Notes:*\n```${{ env.release_notes }}```" | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npx --no-install commitlint --edit "$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; |
Oops, something went wrong.