3 function preparing_to
() {
4 for ((i
=10; i
> 0; i--
)); do
5 printf "\rPreparing to %s in %d ... " "$1" $i
8 printf "\rRunning %s ... \n\n" "$1"
16 PACKAGE_INFO
=$
(.
/configure
-V |
head -n1)
17 PACKAGE_NAME
=$
(echo "$PACKAGE_INFO" | cut
-f1 -d' ')
18 PACKAGE_VERSION
=$
(echo "$PACKAGE_INFO" | cut
-f3 -d' ')
19 TAG_NAME
="${PACKAGE_VERSION}"
21 RELEASE_RC_FILE
="release-rc"
22 .
"$RELEASE_RC_FILE" 2>/dev
/null \
23 || bail
"Could not load release RC file: '$RELEASE_RC_FILE'"
25 [[ -z "${PACKAGE_NAME}" ||
-z "${PACKAGE_VERSION}" ]] \
26 && bail
"Could not figure out package information. Do you have a configure?"
31 SHA256
="shasum -a 256"
35 SHA256
="shasum -a 256"
46 Package: ${PACKAGE_NAME}
47 Version: ${PACKAGE_VERSION}
52 DOAP: ${WEB_DOAP_PATH}
56 OS X Build Configuration:
59 if [[ -z $OSX_USER ]]; then
65 Path: ${OSX_BUILD_DIR}
71 read -p "Press enter if the configuration is correct..."
74 function hook_defined
() {
75 type $1 2>/dev
/null |
grep -q function
78 function run_hook
() {
82 function distcheck
() {
83 preparing_to
"make distcheck"
84 $MAKE distcheck || bail
"distcheck failed"
87 function prepare_upload
() {
88 preparing_to
"create upload data"
91 mkdir release-data || bail
"Could not create release directory"
93 find .
-maxdepth 1 \
( \
96 \
) -exec cp -a {} release-data \
;
98 cp -a NEWS release-data
/${PACKAGE_NAME}-${PACKAGE_VERSION}.news \
99 || bail
"Could not copy NEWS file"
101 (cd release-data
&& {
102 $SHA256 * > ${PACKAGE_NAME}-${PACKAGE_VERSION}.sha256sum \
103 || bail
"Could not sha256sum the release files"
107 function upload_release
() {
108 preparing_to
"upload release files"
110 scp
-r release-data
${WEB_USER}@
${WEB_HOST}: \
111 || bail
"Uploading release failed"
113 [[ -z "${WEB_DOAP_PATH}" ]] ||
{
114 scp
*.doap
${WEB_USER}@${WEB_HOST}:${WEB_DOAP_PATH} \
115 || bail
"Could not upload DOAP file"
118 # ( ssh ${WEB_USER}@${WEB_HOST} ftpadmin install \
119 # release-data/${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.bz2) \
120 # || bail "Could not install the tarball"
121 echo "Connect by ssh to gnomeuserid@master.gnome.org and then run this command to install the tarballs to ftp.gnome.org :"
122 echo " ftpadmin install release-data/${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.bz2"
124 read -p "Press enter when the tarballs are installed..."
129 function tag_release
() {
130 preparing_to
"tag release as '${TAG_NAME}'"
131 git tag
-a -m "${PACKAGE_VERSION} release" \
132 ${TAG_NAME} || bail
"Could not create tag"
133 git push origin
${TAG_NAME} || bail
"Failed to push tag to remote"
136 function post_release
() {
137 # This is supposed to be done by ftpadmin on master.gnome.org
138 # But apparently it is not the case
139 xdg-open
"http://bugzilla.gnome.org/editversions.cgi?action=new&product=banshee&version=${PACKAGE_VERSION}"
142 # Build the OS X binary
143 function osx_run_remote
() {
144 ssh ${OSX_USER}@${OSX_HOST} "cd ${OSX_BUILD_DIR}; $@
"
147 function osx_build_dmg () {
148 osx_run_remote ${OSX_GIT} pull \
149 || bail "Could not update git clone
"
151 scp ${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.bz2 \
152 ${OSX_USER}@${OSX_HOST}:${OSX_BUILD_DIR} \
153 || bail "Could not transfer tarball to OS X build machine
"
155 osx_run_remote ./release.sh ${PACKAGE_VERSION} \
156 || bail "OS X build failed
"
158 scp ${OSX_USER}@${OSX_HOST}:${OSX_BUILD_DIR}/${PACKAGE_NAME}-${PACKAGE_VERSION}\*.dmg . \
159 || bail "Could not fetch DMG image from OS X build machine
"
163 if [[ -z $OSX_USER ]]; then
164 echo "Skipping OS X build
"
174 echo "Congratulations
, you have released
${PACKAGE_VERSION}!"