Skip to content

Latest commit

 

History

History
91 lines (64 loc) · 3.04 KB

CONTRIBUTING.md

File metadata and controls

91 lines (64 loc) · 3.04 KB

Contributing

Thank you for considering contributing to ejson2env!

Getting Started

$ go get -u github.com/Shopify/ejson2env/cmd/ejson2env
  • Fork this project on GitHub. :octocat:

  • Setup your fork as a remote for your project:

$ cd $GOPATH/src/github.com/Shopify/ejson2env
$ git remote add <your username> <your fork's remote path>

Work on your feature

  • Create your feature branch based off of the master branch. (It might be worth doing a git pull if you haven't done one in a while.)
$ git checkout master
$ git pull
$ git checkout -b <the name of your branch>
  • Code/write! ⌨️

    • If working on code, please run go fmt and golangci-lint before opening a PR against main.
  • Push your changes to your fork's remote:

$ git push -u <your username> <the name of your branch>

Send in your changes

Releasing

Binaries and packages are built with GoReleaser. GoReleaser runs when a new version is tagged.

Before releasing a new version, bump /VERSION, commit the changes and open a PR to merge the changes into main.

Tag the commit in main using git tag vx.y.z, e.g. v1.0.0.

In order to release the rubygem, find someone in the owners list at https://rubygems.org/gems/ejson2env and ask them to add you, then:

  1. Download the gem file from the release
  2. gem push ejson2env-x.y.z.gem

Releasing the homebrew package is more awkward. There is surely a more efficient way to do this but current process is:

  1. dev clone homebrew-shopify
  2. Edit ejson2env.rb, changing the URL to reflect the new version. Also remove the bottle do paragraph.
  3. Run brew install ./ejson2env.rb and change the sha256 line to the SHA that is printed as an error.
  4. cd /usr/local/Homebrew/Library/Taps/shopify/homebrew-shopify
  5. cp $(dev project-path homebrew-shopify)/ejson2env.rb .
  6. brew install --build-bottle ejson2env
  7. brew bottle ejson2env
  8. This will generate a file called ejson2env--vx.y.z.high_sierra.tar.gz. Rename it, turning -- into -, e.g. ejson2env-vx.y.z.high_sierra.tar.gz.
  9. Find some public place to upload this file. I use a personal S3 bucket but there are definitely better ways.
  10. reset your changes in the homebrew tap and dev cd homeshop
  11. Copy the bottle do paragraph printed by the brew bottle command into ejson2env.rb, and add root_url "https://.... The final expected URL is going to be "#{root_url}/ejson2env...tar.gz.
  12. Commit and push directly to master.
  13. brew update && brew uninstall ejson2env && brew install ejson2env. If this didn't work, or didn't correctly install from the bottle (i.e. took more than 10 seconds to install), troubleshoot, or revert.