-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
release
executable file
·87 lines (71 loc) · 1.67 KB
/
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
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
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
GITSH_DOWNLOAD_URL="https://github.com/thoughtbot/gitsh/releases/download"
PARITY_DOWNLOAD_URL="https://github.com/thoughtbot/parity/archive/refs/tags"
RCM_DOWNLOAD_URL="https://github.com/thoughtbot/rcm/archive/refs/tags"
release_update() {
pushd $PACKAGE
current_version=`dpkg-parsechangelog --show-field Version | cut -d'-' -f1`
if [ $current_version = $VERSION ]; then
dch -R "New upstream release ${VERSION}"
else
dch -v "${VERSION}-1" -U "New upstream release ${VERSION}"
fi
dch -r "" -D stable
git commit -am "Release $PACKAGE v$VERSION"
popd
}
release_build() {
mkdir -p deb-build
wget -O deb-build/${PACKAGE}_${VERSION}.orig.tar.gz "$(download_url)"
tar -C deb-build -xf deb-build/${PACKAGE}_${VERSION}.orig.tar.gz
cp ${PACKAGE}/debian deb-build/${PACKAGE}-${VERSION} -r
pushd deb-build/${PACKAGE}-${VERSION}
debuild -F
popd
}
release_push() {
git push
}
release_clean() {
rm -rf deb-build
}
release_reset() {
release_clean
git reset --hard origin/main
}
release_upload() {
scp deb-build/${PACKAGE}_${VERSION}-?_all.deb thoughtbotapt:.
}
release_sandbox() {
git fetch
git checkout -B release-$PACKAGE origin/main
}
release_package() {
release_sandbox
release_clean
release_update
release_build
release_upload
}
release_check() {
uscan --no-download
}
download_url() {
case $PACKAGE in
"rcm"*)
echo "$RCM_DOWNLOAD_URL/v$VERSION.tar.gz"
;;
"parity"*)
echo "$PARITY_DOWNLOAD_URL/v$VERSION.tar.gz"
;;
"gitsh"*)
echo "$GITSH_DOWNLOAD_URL/v$VERSION/gitsh-$VERSION.tar.gz"
;;
esac
}
verb="$1"
PACKAGE="$2"
VERSION="$3"
cmd="release_${verb}"
set -x
${cmd}