blob: a77ee09fdc810e593083e0a4248d46d54396ff54 (
plain)
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
|
#!/bin/bash
if [ -z "$1" ]; then
echo "Need version as argument"
exit -1
fi
if [ -z "$GITHUB_TOKEN" ]; then
echo "Need GITHUB_TOKEN env set."
exit -1
fi
branch=$(git symbolic-ref --short -q HEAD)
if [ "$branch" != "master" ]; then
echo "Need to be on develop branch."
exit -1
fi
version="v$1"
directory_name="carnet-nc-$version"
zip_name="carnet-nc-$version.zip"
tar_name="carnet-nc-$version.tar.gz"
changelog=$(awk -v version="$version" '/## v/ { printit = $2 == version }; printit;' CHANGELOG.md | grep -v "$version" | sed '1{/^$/d}')
printf "Changelog will be:\\n%s\\n" "$changelog"
read -p "Are you sure to release? " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 0
fi
#git tag -a "$version" -m "$version"
# Creating the archives
(
cur=$(pwd)
cp . ../CarnetNextcloudTmp -R
cd ../CarnetNextcloudTmp/
sudo rm .git -R
sudo rm templates/CarnetElectron/.git -R
# archive creation + signing
zip -r "$cur""/$zip_name" *
tar zcvf "$cur""/$tar_name" *
cd "$cur"
rm ../CarnetNextcloudTmp -R
# temporary setup destruction
)
# Creating the release on GitHub, with the created archives
(
git push origin --tag
github-release phief/CarnetNextcloud "$version" master "$changelog" "$zip_name"
github-release phief/CarnetNextcloud "$version" master "$changelog" "$tar_name"
#github-release upload --user phief --repo exode --tag "$version" --name "$zip_name" --file "$zip_name"
git push origin master
rm "$zip_name";
)
|