-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hardcode version, add a release script
Having thought about this more, I am semi-reverting fcd4d58 in favor of hardcoding the version to the binary and a release script.
- Loading branch information
Showing
3 changed files
with
32 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FILES = btrfs-auto-snapshot | ||
FILES = btrfs-auto-snapshot release | ||
|
||
.PHONY: lint | ||
lint: shfmt shellcheck | ||
|
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,30 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
log_run() | ||
{ | ||
echo >&2 "+ $*" | ||
"$@" | ||
} | ||
|
||
main() | ||
{ | ||
VERSION=$1 | ||
if [[ ! $VERSION =~ ^v[0-9]\.[0-9]\.[0-9]$ ]]; then | ||
echo >&2 "Invalid version. Expected v1.2.3 or so" | ||
exit 1 | ||
fi | ||
|
||
log_run sed -i'' 's/^\(BTRFS_AUTO_SNAPSHOT_VERSION\)=.*/\1='"$VERSION/" btrfs-auto-snapshot | ||
log_run git add btrfs-auto-snapshot | ||
log_run git commit -m "Release $VERSION" | ||
log_run git tag "$VERSION" | ||
log_run sed -i'' 's/^\(BTRFS_AUTO_SNAPSHOT_VERSION\)=.*/\1='"$VERSION+dev/" btrfs-auto-snapshot | ||
log_run git add btrfs-auto-snapshot | ||
log_run git commit -m "$VERSION+dev" | ||
echo "You have tagged $VERSION. Now run the following:" | ||
echo " git push origin master" | ||
echo " git push origin $VERSION" | ||
} | ||
|
||
main "$@" |