GStreamerSharp: PlayerEngine: avoid spurious *Stream events
[banshee.git] / extras / make-release
blobdf5d6c8e9807bce4e1910f2a56c6db67d9b68c83
1 #!/usr/bin/env bash
3 function preparing_to () {
4 for ((i=10; i > 0; i--)); do
5 printf "\rPreparing to %s in %d ... " "$1" $i
6 sleep 1
7 done
8 printf "\rRunning %s ... \n\n" "$1"
11 function bail () {
12 echo "Error: $@" 1>&2
13 exit 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?"
28 case "$(uname)" in
29 FreeBSD)
30 MAKE=gmake
31 SHA256="shasum -a 256"
33 Darwin)
34 MAKE=make
35 SHA256="shasum -a 256"
38 MAKE=make
39 SHA256=sha256sum
41 esac
43 cat <<EOF
44 Release Summary
46 Package: ${PACKAGE_NAME}
47 Version: ${PACKAGE_VERSION}
49 Release Upload:
50 User: ${WEB_USER}
51 Host: ${WEB_HOST}
52 DOAP: ${WEB_DOAP_PATH}
54 git tag: ${TAG_NAME}
56 OS X Build Configuration:
57 EOF
59 if [[ -z $OSX_USER ]]; then
60 echo " Disabled"
61 else
62 cat <<EOF
63 User: ${OSX_USER}
64 Host: ${OSX_HOST}
65 Path: ${OSX_BUILD_DIR}
66 git: ${OSX_GIT}
67 EOF
70 echo
71 read -p "Press enter if the configuration is correct..."
72 echo
74 function hook_defined () {
75 type $1 2>/dev/null | grep -q function
78 function run_hook () {
79 hook_defined $1 && $1
82 function distcheck () {
83 preparing_to "make distcheck"
84 $MAKE distcheck || bail "distcheck failed"
87 function prepare_upload () {
88 preparing_to "create upload data"
90 rm -rf release-data
91 mkdir release-data || bail "Could not create release directory"
93 find . -maxdepth 1 \( \
94 -name \*.bz2 -o \
95 -name \*.dmg \
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"
104 }) || exit 1
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..."
126 rm -rf release-data
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"
162 distcheck
163 if [[ -z $OSX_USER ]]; then
164 echo "Skipping OS X build"
165 else
166 osx_build_dmg
168 prepare_upload
169 upload_release
170 tag_release
171 post_release
173 echo
174 echo "Congratulations, you have released ${PACKAGE_VERSION}!"
175 echo