Skip to content

Commit

Permalink
chore: adding changelog
Browse files Browse the repository at this point in the history
Working through some ideas for a simple release process.
  • Loading branch information
digitalBush committed Dec 8, 2023
1 parent f848baf commit 7accd5b
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## 0.1.0 (2023-11-30)

- A bit of renaming. ([425b267](https://github.com/digitalBush/modpod/commit/425b267))
- Adding badges ([b51a7d7](https://github.com/digitalBush/modpod/commit/b51a7d7))
- Hello modpod ([f886633](https://github.com/digitalBush/modpod/commit/f886633))
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"cover:show": "c8 report -r html && open ./coverage/index.html",
"check": "npm run lint && npm run format",
"lint": "eslint .",
"format": "prettier -c ."
"format": "prettier -c .",
"preversion": "./tools/preversion.sh",
"version": "./tools/changelog.sh",
"postversion": "git push && git push --tags"
},
"imports": {
"#root/*.js": "./*.js"
Expand Down
13 changes: 13 additions & 0 deletions tools/changelog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
gh_url=$(gh repo view --json url -q ".url")
prev_tag=$(git describe --tags --abbrev=0)
new_version=$(npm pkg get version|xargs)
new_log=$(git log --pretty="* %s ([%h]($gh_url/commit/%H))" $prev_tag..)

echo "## $new_version ($(date +"%Y-%m-%d"))
$new_log
$(cat CHANGELOG.md)" > CHANGELOG.md

git add CHANGELOG.md
8 changes: 8 additions & 0 deletions tools/preversion.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
if [ $(git branch --show-current) != "main" ]; then
echo "Error: Not on main branch";
exit 1;
fi

npm run check
npm t

0 comments on commit 7accd5b

Please sign in to comment.