@@ -5,6 +5,7 @@ set -euo pipefail
5
5
6
6
SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " > /dev/null && pwd) "
7
7
cd " $SCRIPT_DIR /.."
8
+ readonly repo_url=" git@github.com:nix-community/nixos-anywhere"
8
9
9
10
version=${1:- }
10
11
if [[ -z $version ]]; then
@@ -23,16 +24,38 @@ if [[ -n $uncommitted_changes ]]; then
23
24
echo -e " There are uncommitted changes, exiting:\n${uncommitted_changes} " >&2
24
25
exit 1
25
26
fi
26
- git pull git@github.com:nix-community/nixos-anywhere main
27
+ git pull " $repo_url " main
27
28
unpushed_commits=$( git log --format=oneline origin/main..main)
28
- if [[ $unpushed_commits != " " ]]; then
29
+ if [[ -n $unpushed_commits ]]; then
29
30
echo -e " \nThere are unpushed changes, exiting:\n$unpushed_commits " >&2
30
31
exit 1
31
32
fi
33
+
34
+ git branch -D " release-${version} " || true
35
+ git checkout -b " release-${version} "
36
+
32
37
sed -i -e " s!version = \" .*\" ;!version = \" ${version} \" ;!" src/default.nix
33
38
git add src/default.nix
34
- nix-shell -p nix-fast-build --command " nix-fast-build --eval-workers 2 "
39
+
35
40
git commit -m " bump version ${version} "
36
- git tag " ${version} "
41
+ git push origin " release-${version} "
42
+ gh pr create \
43
+ --base main \
44
+ --head " release-${version} " \
45
+ --title " Release ${version} " \
46
+ --body " Release ${version} of nixpkgs-review" \
47
+ --merge \
48
+ --delete-branch
49
+
50
+ gh pr merge --auto " release-${version} "
51
+ git checkout main
37
52
38
- echo " now run 'git push --tags origin main'"
53
+ while true ; do
54
+ if gh pr view " release-${version} " | grep -q ' MERGED' ; then
55
+ break
56
+ fi
57
+ echo " Waiting for PR to be merged..."
58
+ sleep 5
59
+ done
60
+ git pull " $repo_url " main
61
+ gh release create " ${version} " --draft --title " ${version} " --notes " "
0 commit comments