-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add release.sh script to automate most of the process - minor revisions to the unreleased changelog - migrate away from deprecated release asset action
- Loading branch information
Showing
3 changed files
with
49 additions
and
10 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
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,41 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
version=$1 | ||
|
||
# ensure there are no uncommitted changes | ||
[ "" == "$(git status --porcelain)" ] | ||
|
||
# update the version in sv2v.cabal | ||
sed -i.bak -e "s/^version.*/version: $version/" sv2v.cabal | ||
diff sv2v.cabal{,.bak} && echo not changed && exit 1 || true | ||
rm sv2v.cabal.bak | ||
|
||
# update the version in CHANGELOG.md | ||
sed -i.bak -e "s/^## Unreleased$/## v$version/" CHANGELOG.md | ||
diff CHANGELOG.md{,.bak} && echo not changed && exit 1 || true | ||
rm CHANGELOG.md.bak | ||
|
||
# create the release commit and tag | ||
git commit -a -m "release v$version" | ||
git tag -a v$version HEAD -m "Release v$version" | ||
|
||
# build and test | ||
make | ||
make test | ||
[ $version == `bin/sv2v --numeric-version` ] | ||
|
||
# push the release commit and tag | ||
git push | ||
git push origin v$version | ||
|
||
# create the GitHub release | ||
notes=`pandoc --from markdown --to markdown --wrap none CHANGELOG.md | \ | ||
sed '3,/^## /!d' | \ | ||
tac | tail -n +3 | tac` | ||
gh release create v$version --title v$version --notes "$notes" | ||
|
||
# create the Hackage release candidate | ||
stack upload --test-tarball --candidate . |