-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
1 parent
24f2d37
commit ef59484
Showing
1 changed file
with
37 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu -o pipefail | ||
|
||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" | ||
cd "$SCRIPT_DIR/.." | ||
|
||
version=${1:-} | ||
if [[ -z $version ]]; then | ||
echo "USAGE: $0 version" >&2 | ||
exit 1 | ||
fi | ||
|
||
if [[ "$(git symbolic-ref --short HEAD)" != "main" ]]; then | ||
echo "must be on main branch" >&2 | ||
exit 1 | ||
fi | ||
|
||
# ensure we are up-to-date | ||
uncommitted_changes=$(git diff --compact-summary) | ||
if [[ -n $uncommitted_changes ]]; then | ||
echo -e "There are uncommitted changes, exiting:\n${uncommitted_changes}" >&2 | ||
exit 1 | ||
fi | ||
git pull [email protected]:nix-community/nixos-anywhere main | ||
unpushed_commits=$(git log --format=oneline origin/main..main) | ||
if [[ $unpushed_commits != "" ]]; then | ||
echo -e "\nThere are unpushed changes, exiting:\n$unpushed_commits" >&2 | ||
exit 1 | ||
fi | ||
sed -i -e "s!version = \".*\"\$!version = \"${version}\"!" default.nix | ||
git add src/default.nix | ||
nix-shell -p nix-fast-build --command "nix-fast-build --eval-workers 2" | ||
git commit -m "bump version ${version}" | ||
git tag "${version}" | ||
|
||
echo "now run 'git push --tags origin main'" |