-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathrelease.sh
78 lines (64 loc) · 1.77 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh
#
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
# Stop at first error
set -e
# Use version from changelog
# version=$(head -n1 CHANGELOG.md|cut -d"v" -f2);
version=$1
echo "Releasing version $version";
# Ask for confirmation
read -r -p "Are you sure? [y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "You say Yes"
;;
[nN][oO]|[nN])
echo "You say No"
exit 1
;;
*)
echo "Invalid input..."
exit 1
;;
esac
# Ask for confirmation
read -r -p "Create commit and bump package.json version? [y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "You say Yes"
# Bump version in info.xml
sed -i -E "s|^\t<version>.+</version>|\t<version>$version</version>|" appinfo/info.xml
# Add changed files to git
# git add CHANGELOG.md
git add appinfo/info.xml
# Bump npm version, commit and tag
npm version --allow-same-version -f $version
# Show the result
git log -1 -p
# Add signoff
git commit --amend -s
;;
*)
echo "You say No"
;;
esac
# Ask for confirmation
read -r -p "Push? [y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "You say Yes"
# Then:
git push --tags
# Create release on github
git push [email protected]:nextcloud-releases/ldap_write_support.git v$version
# Create release on github
;;
*)
echo "You say No"
;;
esac
# Then manually:
echo "Create release on github from tag on https://github.com/nextcloud/ldap_write_support/tags"
echo "Create release on github from tag on https://github.com/nextcloud-releases/ldap_write_support/tags"