-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
* text=auto | ||
|
||
*.md diff=markdown | ||
*.php diff=php | ||
|
||
/.github export-ignore | ||
/bin export-ignore | ||
/tests export-ignore | ||
.gitattributes export-ignore | ||
.gitignore export-ignore | ||
phpunit.xml export-ignore | ||
psalm.xml export-ignore |
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
# Make sure the release tag is provided. | ||
if (( "$#" != 1 )) | ||
then | ||
echo "Tag has to be provided." | ||
|
||
exit 1 | ||
fi | ||
|
||
RELEASE_BRANCH="master" | ||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
VERSION=$1 | ||
|
||
# Make sure current branch and release branch match. | ||
if [[ "$RELEASE_BRANCH" != "$CURRENT_BRANCH" ]] | ||
then | ||
echo "Release branch ($RELEASE_BRANCH) does not match the current active branch ($CURRENT_BRANCH)." | ||
|
||
exit 1 | ||
fi | ||
|
||
# Make sure the working directory is clear. | ||
if [[ ! -z "$(git status --porcelain)" ]] | ||
then | ||
echo "Your working directory is dirty. Did you forget to commit your changes?" | ||
|
||
exit 1 | ||
fi | ||
|
||
# Make sure latest changes are fetched first. | ||
git fetch origin | ||
|
||
# Make sure that release branch is in sync with origin. | ||
if [[ $(git rev-parse HEAD) != $(git rev-parse origin/$RELEASE_BRANCH) ]] | ||
then | ||
echo "Your branch is out of date with its upstream. Did you forget to pull or push any changes before releasing?" | ||
|
||
exit 1 | ||
fi | ||
|
||
# Always prepend with "v" | ||
if [[ $VERSION != v* ]] | ||
then | ||
VERSION="v$VERSION" | ||
fi | ||
|
||
# Tag PHPEnum | ||
git tag $VERSION | ||
git push origin --tags |