This repository has been archived by the owner on Jun 29, 2019. It is now read-only.
forked from php-build/php-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better output of make-release script, add automatic branching and tag…
…ging
- Loading branch information
Showing
1 changed file
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
VERSION="$1" | ||
|
||
if [ -z "$VERSION" ]; then | ||
echo "make-release.sh: No Version given." >&2 | ||
exit 1 | ||
fi | ||
|
||
./build-docs.sh "$VERSION" | ||
echo "Releasing $VERSION" | ||
echo "===" | ||
echo | ||
|
||
echo "--> Creating release branch... " | ||
|
||
{ | ||
git branch "release/$VERSION" master | ||
git checkout "release/$VERSION" | ||
} > /dev/null | ||
|
||
echo "Done" | ||
|
||
echo "---> Building documentation... " | ||
./build-docs.sh "$VERSION" > /dev/null | ||
echo "Done" | ||
|
||
echo "---> Updating version number to \"$VERSION\"... " | ||
sed -E -e "s/(PHP_BUILD_VERSION=\")(.+)(\")/\1$VERSION\3/" -i '' bin/php-build | ||
echo "Done" | ||
|
||
echo "---> Staging changed files... " | ||
git add bin/ | ||
git add man/ | ||
echo "Done" | ||
|
||
git commit -m "Release $VERSION" | ||
|
||
echo "---> Creating tag \"v$VERSION\"... " | ||
git tag -a "v$VERSION" -m "Release $VERSION" > /dev/null | ||
echo "Done" | ||
|
||
echo | ||
echo "Successfully released $VERSION" | ||
|
||
# Replace {{VERSION}} with the version passed as argument: | ||
sed -e "s/{{VERSION}}/$VERSION/" -i '' "bin/php-build" |