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}"
22 [[ "x$1" = "x--unstable" ]] && RELEASE_TYPE
="unstable"
24 RELEASE_RC_FILE
="release-rc"
25 .
"$RELEASE_RC_FILE" 2>/dev
/null \
26 || bail
"Could not load release RC file: '$RELEASE_RC_FILE'"
28 [[ -z "${PACKAGE_NAME}" ||
-z "${PACKAGE_VERSION}" ]] \
29 && bail
"Could not figure out package information. Do you have a configure?"
34 Package: ${PACKAGE_NAME}
35 Version: ${PACKAGE_VERSION}
36 Release: ${RELEASE_TYPE}
42 DOAP: ${WEB_DOAP_PATH}
46 OS X Build Configuration:
49 if [[ -z $OSX_USER ]]; then
55 Path: ${OSX_BUILD_DIR}
61 read -p "Press enter if the configuration is correct..."
64 function hook_defined
() {
65 type $1 2>/dev
/null |
grep -q function
68 function run_hook
() {
72 function distcheck
() {
73 preparing_to
"make distcheck"
74 make distcheck || bail
"distcheck failed"
77 function prepare_upload
() {
78 preparing_to
"create upload data"
81 mkdir release-data || bail
"Could not create release directory"
88 \
) -exec cp -a {} release-data \
;
90 cp -a NEWS release-data
/${PACKAGE_NAME}-${PACKAGE_VERSION}.news \
91 || bail
"Could not copy NEWS file"
94 sha256sum
* > ${PACKAGE_NAME}-${PACKAGE_VERSION}.sha256sum \
95 || bail
"Could not sha256sum the release files"
99 function upload_release
() {
100 preparing_to
"upload release files"
102 scp
-r release-data
${WEB_USER}@${WEB_HOST}:${WEB_PATH}/${PACKAGE_VERSION} \
103 || bail
"Uploading release failed"
105 ( ssh ${WEB_USER}@${WEB_HOST} rm -f ${WEB_PATH}/LATEST-IS\
* &&
106 ssh ${WEB_USER}@${WEB_HOST} ln -s ${PACKAGE_VERSION} \
107 ${WEB_PATH}/LATEST-IS-
${PACKAGE_VERSION} ) \
108 || bail
"Could not create the LATEST-IS-${PACKAGE_VERSION} link"
112 [[ -z "${WEB_DOAP_PATH}" ]] ||
{
113 scp
*.doap
${WEB_USER}@${WEB_HOST}:${WEB_DOAP_PATH} \
114 || bail
"Could not upload DOAP file"
118 function tag_release
() {
119 preparing_to
"tag release as '${TAG_NAME}'"
120 git tag
-a -m "${PACKAGE_VERSION} ${RELEASE_TYPE} release" \
121 ${TAG_NAME} || bail
"Could not create tag"
122 git push origin
${TAG_NAME} || bail
"Failed to push tag to remote"
125 function post_release
() {
126 firefox
"http://bugzilla.gnome.org/editversions.cgi?action=new&product=banshee&version=${PACKAGE_VERSION}"
129 # Build the OS X binary
130 function osx_run_remote
() {
131 ssh ${OSX_USER}@${OSX_HOST} "cd ${OSX_BUILD_DIR}; $@
"
134 function osx_build_dmg () {
135 osx_run_remote ${OSX_GIT} pull \
136 || bail "Could not update git clone
"
138 scp ${PACKAGE_NAME}-${PACKAGE_VERSION}.tar.bz2 \
139 ${OSX_USER}@${OSX_HOST}:${OSX_BUILD_DIR} \
140 || bail "Could not transfer tarball to OS X build machine
"
142 osx_run_remote ./release.sh ${PACKAGE_VERSION} \
143 || bail "OS X build failed
"
145 scp ${OSX_USER}@${OSX_HOST}:${OSX_BUILD_DIR}/${PACKAGE_NAME}-${PACKAGE_VERSION}\*.dmg . \
146 || bail "Could not fetch DMG image from OS X build machine
"
150 if [[ -z $OSX_USER ]]; then
151 echo "Skipping OS X build
"
161 echo "Congratulations
, you have released
${PACKAGE_VERSION}!"