-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Miikka Koskinen
committed
May 5, 2020
1 parent
a5a285b
commit 370365a
Showing
3 changed files
with
88 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Developer guide | ||
|
||
## Running tests | ||
|
||
```sh | ||
./scripts/test.sh clj | ||
./scripts/test.sh cljs | ||
``` | ||
|
||
|
||
## Creating a release | ||
|
||
1. Update `CHANGELOG.md` | ||
2. Set the appropriate version in `project.clj` and commit and push. | ||
3. Run `./scripts/release.sh` | ||
|
||
The actual building of the release artifact is done by the CI service. |
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,69 @@ | ||
#!/usr/bin/env bash | ||
# Release a new version | ||
|
||
set -euo pipefail | ||
|
||
if ! hub version > /dev/null; then | ||
echo "The hub tool is needed. If you're on macOS, you can install it with \`brew install hub\`" | ||
exit 1 | ||
fi | ||
|
||
BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
|
||
if [[ "$BRANCH" != "master" ]]; then | ||
echo "This script only works in the master branch." | ||
exit 1 | ||
fi | ||
|
||
if ! git diff-index --quiet HEAD -- project.clj; then | ||
echo "project.clj contains uncommited changes. Commit them first." | ||
exit 1 | ||
fi | ||
|
||
if ! git merge-base --is-ancestor "master@{u}" master; then | ||
echo "The master branch has not been pushed. Please git push." | ||
exit 1 | ||
fi | ||
|
||
VERSION=$(lein pprint --no-pretty -- :version) | ||
|
||
echo "Version in project.clj: $VERSION" | ||
|
||
case "$VERSION" in | ||
*-SNAPSHOT) | ||
echo "" | ||
echo "SNAPSHOT releases are not supported. You can \`lein deploy\` them yourself." | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "Going to release version $VERSION... is this correct? [y/n]" | ||
|
||
read -r answer | ||
case "$answer" in | ||
y | Y | yes | YES) | ||
;; | ||
*) | ||
echo "Exiting" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
if hub release show "$VERSION" 2>/dev/null; then | ||
echo | ||
echo "Release $VERSION already exists" | ||
exit 1 | ||
else | ||
echo "* Release $VERSION does not yet exist" | ||
fi | ||
|
||
# Let's just check if the chanelog contains an appropriate title | ||
if ! grep -q -F "# $VERSION " CHANGELOG.md; then | ||
echo | ||
echo "Please update CHANGELOG to contain the release $VERSION" | ||
exit 1 | ||
else | ||
echo "* Changelog has been updated" | ||
fi | ||
|
||
hub release create -m "$VERSION" "$VERSION" |