File tree Expand file tree Collapse file tree 1 file changed +83
-0
lines changed Expand file tree Collapse file tree 1 file changed +83
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ RELEASE_DIR=${HOME} /Releases
4+ GITHUB_USER=fkooman
5+ PROJECT_NAME=php-voot-provider
6+
7+ if [ -z " $1 " ]
8+ then
9+
10+ cat << EOF
11+ Please specify the tag or branch to make a release of.
12+
13+ Examples:
14+
15+ sh make_release.sh 0.1.0
16+ sh make_release.sh master
17+ sh make_release.sh develop
18+
19+ If you want to GPG sign the release, you can specify the "sign" parameter, this will
20+ invoke the gpg command line tool to sign it.
21+
22+ sh make_release 0.1.0 sign
23+
24+ EOF
25+ exit 1
26+ else
27+ TAG=$1
28+ fi
29+
30+ mkdir -p ${RELEASE_DIR}
31+ rm -rf ${RELEASE_DIR} /${PROJECT_NAME} -${TAG}
32+
33+ # get Composer
34+ (
35+ cd ${RELEASE_DIR}
36+ curl -O http://getcomposer.org/composer.phar
37+ )
38+
39+ # clone the tag
40+ (
41+ cd ${RELEASE_DIR}
42+ git clone -b ${TAG} https://github.com/${GITHUB_USER} /${PROJECT_NAME} .git ${PROJECT_NAME} -${TAG}
43+ )
44+
45+ # run Composer
46+ (
47+ cd ${RELEASE_DIR} /${PROJECT_NAME} -${TAG}
48+ php ${RELEASE_DIR} /composer.phar install
49+ )
50+
51+ # remove Git and Composer files
52+ (
53+ cd ${RELEASE_DIR} /${PROJECT_NAME} -${TAG}
54+ rm -rf .git
55+ rm -f .gitignore
56+ rm -f composer.json
57+ rm -f composer.lock
58+ rm -f make_release.sh
59+ )
60+
61+ # create tarball
62+ (
63+ cd ${RELEASE_DIR}
64+ tar -czf ${PROJECT_NAME} -${TAG} .tar.gz ${PROJECT_NAME} -${TAG}
65+ )
66+
67+ # create checksum file
68+ (
69+ cd ${RELEASE_DIR}
70+ shasum ${PROJECT_NAME} -${TAG} .tar.gz > ${PROJECT_NAME} -${TAG} .sha
71+ )
72+
73+ # sign it if requested
74+ (
75+ if [ -n " $2 " ]
76+ then
77+ if [ " $2 " == " sign" ]
78+ then
79+ cd ${RELEASE_DIR}
80+ gpg -o ${PROJECT_NAME} -${TAG} .sha.gpg --clearsign ${PROJECT_NAME} -${TAG} .sha
81+ fi
82+ fi
83+ )
You can’t perform that action at this time.
0 commit comments