-
-
Save whilei/39ae1a63ae69de4d7fc9ba7bd686c290 to your computer and use it in GitHub Desktop.
Revisions
-
Jaskaranbir revised this gist
Sep 7, 2018 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,6 @@ #!/bin/bash # ===> Set these variables first branch="$GIT_BRANCH" # Example: "Jaskaranbir/MyRepo" repo_slug="$TRAVIS_REPO_SLUG" @@ -21,6 +20,8 @@ github_changelog_generator \ --token $token \ --since-tag ${LAST_RELEASE_TAG} body="$(cat CHANGELOG.md)" # Overwrite CHANGELOG.md with JSON data for GitHub API jq -n \ --arg body "$body" \ -
Jaskaranbir created this gist
Sep 6, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ #!/bin/bash # ===> Set these variables first body="$(cat CHANGELOG.md)" branch="$GIT_BRANCH" # Example: "Jaskaranbir/MyRepo" repo_slug="$TRAVIS_REPO_SLUG" token="$GITHUB_TOKEN" version="$TRAVIS_TAG" # An automatic changelog generator gem install github_changelog_generator LAST_REVISION=$(git rev-list --tags --skip=1 --max-count=1) LAST_RELEASE_TAG=$(git describe --abbrev=0 --tags ${LAST_REVISION}) # Generate CHANGELOG.md github_changelog_generator \ -u $(cut -d "/" -f1 <<< $repo_slug) \ -p $(cut -d "/" -f2 <<< $repo_slug) \ --token $token \ --since-tag ${LAST_RELEASE_TAG} # Overwrite CHANGELOG.md with JSON data for GitHub API jq -n \ --arg body "$body" \ --arg name "$version" \ --arg tag_name "$version" \ --arg target_commitish "$branch" \ '{ body: $body, name: $name, tag_name: $tag_name, target_commitish: $target_commitish, draft: false, prerelease: false }' > CHANGELOG.md echo "Create release $version for repo: $repo_slug, branch: $branch" curl -H "Authorization: token $token" --data @CHANGELOG.md "https://api.github.com/repos/$repo_slug/releases"