|
| 1 | +# Cutting a CLI Release |
| 2 | + |
| 3 | +## Bootstrap Cross-Compilation for Go |
| 4 | + |
| 5 | +**This only has to be done once.** |
| 6 | + |
| 7 | +Change directory to the go source. Then run the bootstrap command for |
| 8 | +each operating system and architecture. |
| 9 | + |
| 10 | +```plain |
| 11 | +$ cd `which go`/../../src |
| 12 | +$ sudo GCO_ENABLED=0 GOOS=windows GOARCH=386 ./make.bash --no-clean |
| 13 | +$ sudo GCO_ENABLED=0 GOOS=darwin GOARCH=386 ./make.bash --no-clean |
| 14 | +$ sudo GCO_ENABLED=0 GOOS=linux GOARCH=386 ./make.bash --no-clean |
| 15 | +$ sudo GCO_ENABLED=0 GOOS=windows GOARCH=amd64 ./make.bash --no-clean |
| 16 | +$ sudo GCO_ENABLED=0 GOOS=darwin GOARCH=amd64 ./make.bash --no-clean |
| 17 | +$ sudo GCO_ENABLED=0 GOOS=linux GOARCH=amd64 ./make.bash --no-clean |
| 18 | +$ sudo GCO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 ./make.bash --no-clean |
| 19 | +$ sudo GCO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 ./make.bash --no-clean |
| 20 | +``` |
| 21 | + |
| 22 | +## Bump the version |
| 23 | + |
| 24 | +Edit the `Version` constant in `exercism/main.go`. |
| 25 | + |
| 26 | +## Generate the Binaries |
| 27 | + |
| 28 | +```plain |
| 29 | +$ rm release/* |
| 30 | +$ CGO_ENABLED=0 bin/build-all |
| 31 | +``` |
| 32 | + |
| 33 | +## Cut Release on GitHub |
| 34 | + |
| 35 | +Go to [the exercism/cli "new release" page](https://github.com/exercism/cli/releases/new). |
| 36 | + |
| 37 | +Describe the release, select a specific commit to target, name the version `v{VERSION}`, where |
| 38 | +VERSION matches the value of the `Version` constant. |
| 39 | + |
| 40 | +Upload all the binaries from `release/*`. |
| 41 | + |
| 42 | +## Update Homebrew |
| 43 | + |
| 44 | +This is helpful for the (many) Mac OS X users. |
| 45 | + |
| 46 | +Calculate the `SHA1` checksum for the two mac builds: |
| 47 | + |
| 48 | +```plain |
| 49 | +$ openssl sha1 release/exercism-mac-32bit.tgz |
| 50 | +$ openssl sha1 release/exercism-mac-64bit.tgz |
| 51 | +``` |
| 52 | + |
| 53 | +Fork and clone [homebrew/homebrew-binary](https://github.com/homebrew/homebrew-binary/fork). |
| 54 | + |
| 55 | +Add the upstream repository: |
| 56 | + |
| 57 | +```plain |
| 58 | +$ git remote add upstream git@github.com:Homebrew/homebrew-binary.git |
| 59 | +``` |
| 60 | + |
| 61 | +If you already had this cloned, ensure that you are entirely up-to-date with the upstream master: |
| 62 | + |
| 63 | +```plain |
| 64 | +$ git fetch upstream && git checkout master && git reset upstream/master && git push -f origin master |
| 65 | +``` |
| 66 | + |
| 67 | +Check out a feature branch, where X.Y.Z is the actual version number. |
| 68 | + |
| 69 | +```plain |
| 70 | +$ git checkout -b exercism-vX.Y.Z |
| 71 | +``` |
| 72 | + |
| 73 | +Update the homebrew-binary/exercism.rb formula. |
| 74 | + |
| 75 | +- version |
| 76 | +- urls |
| 77 | +- `SHA1` checksums |
| 78 | + |
| 79 | +If you are on a mac, you can test the formula by running: |
| 80 | + |
| 81 | +```plain |
| 82 | +$ brew unlink exercism && brew install ./exercism.rb |
| 83 | +``` |
| 84 | + |
| 85 | +Then submit a pull request to homebrew-binary. Note that they're very, very careful about their |
| 86 | +commit history. If you made multiple commits, squash them. They don't merge using the button on |
| 87 | +GitHub, they merge by making sure that the branch is rebased on to the most recent master, and |
| 88 | +then they do a fast-forward merge. That means that the PR will be red when it's closed, not purple. |
| 89 | + |
| 90 | +## Update the Docs Site |
| 91 | + |
| 92 | +If there are any significant changes, we should describe them on |
| 93 | +[cli.exercism.io](http://cli.exercism.io/). |
| 94 | + |
| 95 | +The codebase lives at [exercism/cli-www](https://github.com/exercism/cli-www). |
0 commit comments