From d79a97940b880482517291898a8b2f4818066f68 Mon Sep 17 00:00:00 2001 From: Nikita Chernyi Date: Mon, 9 Oct 2017 14:07:35 +0300 Subject: [PATCH 1/2] Added support for GitHub, updated README link to stable release --- README.md | 4 ++-- bin | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 04949a7..ff2cd8b 100644 --- a/README.md +++ b/README.md @@ -18,14 +18,14 @@ * Commits that file with commit summary `Release v` * Creates new tag with release version and changes list as message * Pushes commit with new tag and updated changelog -* Opens Gitlab Merge Request (url generated from origin url) with predefined title and branches in browser +* Opens Gitlab Merge Request or GitHub Pull Request (url generated from origin url) with predefined title and branches in browser **PLEASE**, use http://semver.org/ ## Integration with git ```bash -sudo curl -o /usr/local/bin/git-bump -s https://raw.githubusercontent.com/titanium-codes/bump.sh/master/bin && sudo chmod +x /usr/local/bin/git-bump +sudo curl -o /usr/local/bin/git-bump -s https://raw.githubusercontent.com/titanium-codes/bump.sh/stable/bin && sudo chmod +x /usr/local/bin/git-bump git config --global alias.bump "git-bump" ``` diff --git a/bin b/bin index 16a885e..a1bc802 100755 --- a/bin +++ b/bin @@ -50,5 +50,9 @@ echo -e "$PREFIX Pushing..." git push origin --follow-tags # Open merge request url with preset changes -xdg-open "https://$REPO_URL/merge_requests/new?utf8=✓&merge_request[source_branch]=$BRANCH_1&merge_request[target_branch]=$BRANCH_2&merge_request[title]=$NEW_VERSION" +if [[ $REPO_URL == *"gitlab"* ]]; then + xdg-open "https://$REPO_URL/merge_requests/new?utf8=✓&merge_request[source_branch]=$BRANCH_1&merge_request[target_branch]=$BRANCH_2&merge_request[title]=$NEW_VERSION" +elif [[ $REPO_URL == *"github"* ]]; then + xdg-open "https://$REPO_URL/compare/$BRANCH_1...$BRANCH_2&pull_request[title]=$NEW_VERSION" +fi echo -e "$PREFIX Don't forget to notify your teammates about new release!" From 8fca1fb99b3d3228a0e8be6f1194d8ec6f97427a Mon Sep 17 00:00:00 2001 From: Nikita Chernyi Date: Mon, 9 Oct 2017 14:08:00 +0300 Subject: [PATCH 2/2] Release v1.1.3 --- CHANGELOG.md | 8 +++++--- bin | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c358811..7d9142f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ -# Release v[1.1.2](github.com/rakshazi/bump.sh/tags/1.1.2) +# Release v[1.1.3](https://github.com/titanium-codes/bump.sh/tree/1.1.3) -* 2a062b2 Fixes shebang -* 62b4178 Update README.md +* d79a979 Added support for GitHub, updated README link to stable release +# Release v[1.1.2](https://github.com/titanium-codes/bump.sh/tree/1.1.2) +* 2a062b2 Fixes shebang +* 62b4178 Update README.md diff --git a/bin b/bin index a1bc802..1d1b8df 100755 --- a/bin +++ b/bin @@ -38,7 +38,12 @@ echo -n "Enter new version (Current branch: $BRANCH_CURRENT | Previous version: read NEW_VERSION # Update changelog -echo -e "# Release v[$NEW_VERSION]($REPO_URL/tags/$NEW_VERSION)\n\n$CHANGES\n\n$(cat CHANGELOG.md)" > CHANGELOG.md +if [[ $REPO_URL == *"gitlab"* ]]; then + TAG_URL="https://$REPO_URL/tags/$NEW_VERSION" +elif [[ $REPO_URL == *"github"* ]]; then + TAG_URL="https://$REPO_URL/tree/$NEW_VERSION" +fi +echo -e "# Release v[$NEW_VERSION]($TAG_URL)\n\n$CHANGES\n\n$(cat CHANGELOG.md)" > CHANGELOG.md git add CHANGELOG.md git commit -q -m "Release v$NEW_VERSION"