-
Notifications
You must be signed in to change notification settings - Fork 48
Developer Guide: Releasing Inject
Congratulations!(?) You're on the hook for releasing Inject!
-
LAST_REV the latest final release we have done so far. do not include the RC information for this For example, if we are releasing 0.4.3-rc2, then LAST_REV is
0.4.2
-
NEW_REV is the new final release we are intending to make. do not include the RC information for this. For example, if we are releasing 0.4.3-rc2, then NEW_REV is
0.4.3
-
RC_REV the release we are intending to make. includes RC information. For example, if we are releasing 0.4.3-rc2, then RC_REV is
0.4.3-rc2
I recommend the following directories to keep yourself sane. You don't have to blow them away... it can help with later managing pull requests, iterating on the website, etc.
|-inject
|-linkedin
|-bower
|-gh-pages
|-yourname
cd <your_favorite_directory>
mkdir -p inject
git clone [email protected]:linkedin/inject.git linkedin
git clone [email protected]:linkedin/inject-bower.git bower
git clone [email protected]:linkedin/inject.git gh-pages
git clone [email protected]: YOUR_GITHUB_USERNAME /inject.git YOUR_GITHUB_USERNAME
cd gh-pages && git checkout origin/gh-pages && git checkout -b gh-pages && git branch -D master && cd ..
cd YOUR_GITHUB_USERNAME && git remote add upstream [email protected]:linkedin/inject.git && cd ..
- You really want to blow away
master
in gh-pages... we have lots of artifacts that don't overlap - The upstream and "your" branches make it easier to separate work for LinkedIn (managing pull requests) and work for yourself as a contributor (sending pull requests). We all send pull requests (even people with commit access to the main repo), and this removes the need to push to multiple upstream locations.
These steps are needed for the FIRST RC in a series. Subsequent releases do not need this step, continue to "Update Release Branch"
# Make a new branch based on the LAST_REV and check it out
cd linkedin
git checkout origin/LAST_REV
git checkout -b NEW_REV
These steps are needed for all RCs and Final versions.
Get into your release branch
cd linkedin
git checkout NEW_REV
Use one of the following strategies...
# absorb everything in master (often for a first RC)
git rebase master
# if conflicts, use
git add <fixed file>
git rebase --continue
# cherry pick a fix from master (hotfix)
git cherry-pick <SHA-1 from git-log in github>
# apply a hotfix manually... patch/apply, edit, etc
# edit your files then
git add <files>
git commit -m <message>
- Verify your changes in
git log
- Do a diffstat to get a general sense of the release's size
git diff --stat -r LAST_REV -r NEW_REV
git push origin NEW_REV:NEW_REV
or, if you're just a new RC
git push origin YOUR_REV:YOUR_REV
In addition to publishing a release branch, we tag the point in which we make changes. This makes it possible for us to make additional builds (hotfixes) on top of a single release if required. Plus, it just makes the grunt process easier since now every build for inject identifies it's nearest build and contains a SHA-1 we can map to on github... meaning we know exactly what code someone is running.
git tag -a RC_VER
# add your commit message. Use github's issues to populate your message with
# a list of features and changes
git push origin --tags
rm -rf node_modules
npm install
git submodule init
git submodule update
grunt release
Inside of /.artifacts
you will see your shiny code.
Once you've got a ZIP file, you can update bower. Grab the zip file, crack it open, and put the contents into the bower/dist
directory.
Then, update the bower.json
to reflect the proper version, which should be NEW_REV. Commit that change.
Create a tag git tag -a NEW_REV
and then push it all up
git push origin
git push origin --tags
Bower will automatically pick up these changes.
- Go to your gh-pages checkout
- Add the ZIP file
- Edit the download page (and the home page for a final release)
- Use
jekyll --server
to verify it looks good -
git push origin gh-pages:gh-pages
in yourgh-pages
directory to make it go live