-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrelease
executable file
·37 lines (28 loc) · 904 Bytes
/
release
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
#!/usr/bin/env bash
set -eu
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
rm -rf $dir/last-release
mkdir $dir/last-release
cd $dir/last-release
tagname="v$(grep -E ^version ../Cargo.toml | sed 's/version = "//' | sed 's/"//')"
if git rev-parse $tagname >/dev/null 2>&1
then
echo "tag $tagname already exists" >&2
exit 1
fi
echo "Release $tagname"
read -p "continue? [y/N] " -n 1 -r
echo
if ! [[ $REPLY =~ ^[^Nn]$ ]]; then
exit 0
fi
git tag -s $tagname -m "Release $tagname"
git push --tags
curl -OL "https://github.com/alexheretic/apart-core/archive/refs/tags/$tagname.tar.gz"
# gpg --armor --detach-sign "$tagname.tar.gz"
sha256sum *tar.gz*
echo "Pushed tag $tagname to repo, ready to add notes"
echo "Go to https://github.com/alexheretic/apart-core/releases/new?tag=$tagname"
# nautilus ./
gio open "https://github.com/alexheretic/apart-core/releases/new?tag=$tagname"
cd $dir