Skip to content

Commit

Permalink
chore(release-script): push release branch to Github
Browse files Browse the repository at this point in the history
  • Loading branch information
eysi09 committed Mar 1, 2019
1 parent 51a2162 commit f4b80b3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ To make a new release, set your current working directory to the garden root dir
1. Run the release script: `./bin/release.tsx <minor | patch | preminor | prepatch | prerelease> [--force]`. The script does the following:
* Checks out a branch named `release-<version>`.
* Updates `package.json` and `package-lock.json` for `garden-service` and the changelog.
* Commits the changes, tags the commit and pushes the tag, triggering a CI process the creates the release artifacts.
* Commits the changes, tags the commit and pushes the tag and branch, triggering a CI process the creates the release artifacts.
2. Open the [Garden project on CircleCI](https://circleci.com/gh/garden-io/garden) and browse to the job marked `release-service-pkg`. Open the **Artifacts** tab and download the listed artifacts.
3. Go to our Github [Releases tab](https://github.com/garden-io/garden/releases) and click the **Draft a new release** button.
4. Fill in the **Tag version** and **Release title** fields with the new release version (same as you used for the tag).
5. Upload the downloaded artifacts.
6. Write release notes (not necessary for RCs). The notes should _at least_ contain the changelog. To generate a changelog for just that tag, run `git-chglog <tag-name>`.
7. Click the **Publish release** button.
8. Push the branch and make a pull request.
8. Make a pull request for the branch that was pushed by the script.
9. If you're making an RC, you're done! Otherwise, you need to update Homebrew package: `gulp update-brew`.

## Changelog
Expand Down
9 changes: 8 additions & 1 deletion bin/release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const RELEASE_TYPES = ["minor", "patch", "preminor", "prepatch", "prerelease"]
* 7. Tag the commit.
* 8. Push the tag. This triggers CircleCI process that creates the release artifacts.
* 9. If we're making a minor release, update links to examples and re-push the tag.
* 10. Pushes the release branch to Github.
*
* Usage: ./bin/release.ts <minor | patch | preminor | prepatch | prerelease> [--force]
*/
Expand Down Expand Up @@ -119,12 +120,18 @@ async function release() {
await createTag(version, gardenRoot, true)
}

console.log("Pushing release branch...")
await execa("git", ["push", "origin", branchName, "--no-verify"], { cwd: gardenRoot })

console.log(deline`
\nVersion ${chalk.bold.cyan(version)} has been ${chalk.bold("tagged")}, ${chalk.bold("committed")},
and ${chalk.bold("pushed")} to Github! 🎉\n
A CI job that creates the release artifacts is currently in process: https://circleci.com/gh/garden-io/garden\n
Create a pull request for ${branchName} on Github by visting:
https://github.com/garden-io/garden/pull/new/${branchName}
Please refer to our contributing docs for the next steps:
https://github.com/garden-io/garden/blob/master/CONTRIBUTING.md
`)
Expand Down Expand Up @@ -168,7 +175,7 @@ async function rollBack(gardenRoot: string) {

async function prompt(version: string): Promise<boolean> {
const message = deline`
Running this script will create a tag for ${chalk.bold.cyan(version)} and push it to Github.
Running this script will create a branch and a tag for ${chalk.bold.cyan(version)} and push them to Github.
This triggers a CI process that creates the release artifacts.\n
Are you sure you want to continue?
Expand Down

0 comments on commit f4b80b3

Please sign in to comment.