From 9b5d40de6bd06d466631983679a339591476dd03 Mon Sep 17 00:00:00 2001 From: Jeff Brateman Date: Thu, 12 May 2016 18:29:44 -0500 Subject: [PATCH] clean up release process docs --- fabfile.py | 149 ------------------------------------ official-release-process.md | 57 +------------- 2 files changed, 4 insertions(+), 202 deletions(-) delete mode 100644 fabfile.py diff --git a/fabfile.py b/fabfile.py deleted file mode 100644 index 2fb19b61..00000000 --- a/fabfile.py +++ /dev/null @@ -1,149 +0,0 @@ -#!/usr/bin/env python - -import os -import shutil -import zipfile - -from fabric.contrib.console import confirm -from fabric.api import env, local, hide -from fabric.context_managers import lcd, settings -from fabric.utils import abort -from fabric.tasks import execute -from fabric import colors - -env.verbose = False -env.dirty = False -env.test = False -env.to_hide = ["stdout", "stderr", "running"] - -# repos -env.public_repo_url = "git@github.com:card-io/card.io-Android-SDK.git" -env.public_repo_path = "distribution-repo" - - -# --- tasks ---- -def verbose(verbose=True): - env.verbose = verbose - - -def build(is_upload_archives): - cmd = "./gradlew clean :card.io:assembleRelease releaseDoc" - - with lcd(env.top_root): - print "running " + cmd - local(cmd) - - if is_upload_archives == True: - cmd = "./gradlew :card.io:uploadArchives" - print "running " + cmd - local(cmd) - - -def sdk_setup(): - env.top_root = local("git rev-parse --show-toplevel", capture=True) - - if not os.path.isdir(env.public_repo_path): - print(colors.blue("Creating public SDK repo")) - local("git clone --origin public {public_repo_url} {public_repo_path}".format(**env)) - - -def sdk_reset(warn_opt='warn'): - if warn_opt != 'nowarn': - print(colors.yellow("This step will fetch and reset the public repo to the latest version.")) - if not confirm("Proceed?"): - abort("OK, fine. I understand. :(") - - execute(sdk_setup) - - with lcd(env.public_repo_path): - local("git checkout master") - - # Merge in the internal repo's develop branch. - local("git fetch public --prune") - local("git reset --hard public/master") - local("git clean -x -d -f") - - -def sdk_release(is_upload_archives=True): - """ - Build library into public/card.io-Android-SDK. - """ - - execute(sdk_setup) - - version_str = _get_release_version() - - _confirm_tag_overwrite(env.top_root, version_str) - local("git tag -f {0}".format(version_str)) - - - with settings(hide(*env.to_hide)): - print(colors.blue("building sdk {version_str} ".format(**locals()))) - - build(is_upload_archives) - print(colors.blue("extracting sdk {version_str} to public repo".format(**locals()))) - - release_path = os.path.join(env.top_root, "card.io", "build", "outputs", "aar", "card.io-release.aar") - dest_file_name = "card.io-{version_str}.aar".format(**locals()) - - with lcd(env.public_repo_path): - # remove old everything - local("rm -rf *") - local("mkdir aars") - local("cp {release_path} aars/{dest_file_name}".format(**locals())) - - # update all sdk files - local("cp -r " + os.path.join(env.top_root, "sdk") + "/* .") - local("cp -r " + os.path.join(env.top_root, "sdk") + "/.[!.]* .") - - # update sample app - local("cp -R " + os.path.join(env.top_root, "SampleApp") + " .") - - local("sed -i '' 's/io.card:android-sdk:REPLACE_VERSION/io.card:android-sdk:{version_str}/g' ./SampleApp/build.gradle".format(**locals())) - local("sed -i '' 's/io.card:android-sdk:REPLACE_VERSION/io.card:android-sdk:{version_str}/g' ./README.md".format(**locals())) - - # add everything to git and commit - local("git add .") - local("git add -u .") - local("git commit -am \"Update library to {version_str}\"".format(**locals())) - - _confirm_tag_overwrite(env.public_repo_path, version_str) - - with lcd(env.public_repo_path): - local("git tag -f {0}".format(version_str)) - - print - print(colors.white("Success!")) - print "The distribution files are now available in {public_repo_path}".format(**env) - print - if is_upload_archives == True: - print "The aar file has been published to sonatype's mavenCentral staging repo. Promote it!" - print - print "Commit proguard-data" - print "Verify and merge back to master" - print - - -# --- Helpers ------------------------------------------------------------- - - -def _get_release_version(): - with settings(hide(*env.to_hide)): - git_describe_cmd = 'git rev-parse --short --abbrev-ref HEAD' - describe_results = local(git_describe_cmd, capture=True) - if not "/" in describe_results: - abort("cannot extract release version from branch. Be sure you're on a branch with format \"release/1.1.1\"") - version_str = describe_results.rsplit("/", 1)[1] - return version_str - - -def _confirm_tag_overwrite(repo, tag): - with settings(hide(*env.to_hide)): - git_list_tag_command = 'git tag -l' - with lcd(repo): - tag_results = local(git_list_tag_command, capture=True) - for row in tag_results.split('\n'): - if tag == row: - print(colors.yellow("Tag {tag} already present in {repo}.".format(**locals()))) - if not confirm("Proceed with overwriting tag?"): - abort("Tag not overwritten, aborted. ") \ No newline at end of file diff --git a/official-release-process.md b/official-release-process.md index a218ac09..b0cc5ca6 100644 --- a/official-release-process.md +++ b/official-release-process.md @@ -4,59 +4,10 @@ This is probably only useful for maintainers. Public github address (https://github.com/card-io/card.io-Android-SDK) -1. Make sure you're using NDK r10e! Ndk 8 is broken for some devices. +1. Follow releasinator process -1. Sanity check the master branch. - -1. Run `./gradlew clean :card.io:assembleRelease releaseDoc`, and review the unobfuscated aar and javadocs for any anomalies. - -1. Deploy release version of SampleApp with `./gradlew installRelease` to a device and run a few sanity checks. You will have to generate keystores to do this. - -1. Run `git checkout -b release/1.2.3 master` with a release version - -1. Update `release_notes.md` and commit. - -1. Run `fab sdk_reset sdk_release`, it will reset the branches, build the sdk in the `distribution-repo` folder, tag the release, and deploy to mavenCentral. Modify the fab task to `sdk_release:is_upload_archives=false` if you do not want to deploy to mavenCentral. - -1. Switch to master and merge release branch - ```bash - git checkout master - git merge --no-ff release/x.x.x - ``` - -1. Now push the changes to origin repo - ```bash - git push origin master --tags - ``` - -1. Wait for tests to complete and let's release to public, check the diffs to verify all is good - 1. Check the changes - ``` - cd distribution-repo; - git show - ``` - 2. Promote the repo in maven central - 2. Open [Sonatype](https://oss.sonatype.org/), and - 2. Follow [these instructions](http://central.sonatype.org/pages/releasing-the-deployment.html) - 2. Only when the [card.io maven repo](https://repo1.maven.org/maven2/io/card/android-sdk/) lists this release, proceed to next step. Otherwise, the sample app won't compile. - 3. Push - ``` - git push public master --tags - ``` - -1. Update javadocs - 1. On public repo, checkout special gh branch called gh-pages: - 2. `git checkout gh-pages` - 2. ``` rm -rf `ls | grep -v *.md` ``` - 1. On private sdk rep, build javadoc and copy to public repo: - 2. `./gradlew releaseDoc` - 2. `cp -a card.io/build/docs/javadoc/release/* ` - 1. On public repo, push the changes: - 2. `git push` - -1. Check github that all is good. +1. Publish the newly drafted release 1. Post that a new release is available using the same format previously used to: - 1. https://github.com/card-io/card.io-Android-SDK/releases - 2. Twitter (username=cardio/password=_ask for password_) - 3. Google Groups (send email to card-io-sdk-announce@googlegroups.com) + 1. Twitter (username=cardio/password=_ask for password_) + 2. Google Groups (send email to card-io-sdk-announce@googlegroups.com)