Skip to content

Commit

Permalink
feat: add release script
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Dec 29, 2022
1 parent d65dd73 commit 144c732
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ options:
- feat
- fix
- refactor
- chore
- docs
commit_groups:
title_order:
- feat
- fix
- refactor
- chore
- docs
header:
pattern: "^(\\w*)(?:\\(([\\w\\$\\.\\-\\*\\s]*)\\))?(?:\\!)?:\\s(.*)$"
Expand Down
7 changes: 0 additions & 7 deletions .chglog/template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@
{{ end }}
{{ end -}}
{{ end -}}

### Contributors

Thanks for contributing to the project:
{{ range .Commits -}}
- [@{{ .Author.Name }}](/~https://github.com/{{ .Author.Name }})
{{ end }}
{{ end -}}

{{- if .Versions }}
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ documentation:
lint:
stylua .

release:
./scripts/release.sh

changelog:
git-chglog -o CHANGELOG.md -no-case
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
## ⚡️ Features

- README.md template
- GitHub Release script
- Perfect for open-source:
- CODEOWNERS file for PR auto-assign
- Issues and PR templates
Expand Down
22 changes: 22 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [[ -z "$NEXT_TAG" ]]; then
echo "usage: NEXT_TAG=0.2.2 make release"
exit 1
fi

echo "Generating changelog for version $NEXT_TAG"

git-chglog -o CHANGELOG.md -no-case --next-tag=$NEXT_TAG

echo "Pushing release commit and tag $NEXT_TAG"

git add .
git commit -m "chore: release v$NEXT_TAG"
git tag $NEXT_TAG
git push origin main $NEXT_TAG

echo "Creating release v$NEXT_TAG"

NOTES=$(git-chglog -no-case $NEXT_TAG)
gh release create $NEXT_TAG -t v$NEXT_TAG --notes "$NOTES"

0 comments on commit 144c732

Please sign in to comment.