From patchwork Mon Jan 30 06:23:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 9544511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B447760415 for ; Mon, 30 Jan 2017 06:23:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A53B22018F for ; Mon, 30 Jan 2017 06:23:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A25526E75; Mon, 30 Jan 2017 06:23:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14C1E27D16 for ; Mon, 30 Jan 2017 06:23:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbdA3GXi (ORCPT ); Mon, 30 Jan 2017 01:23:38 -0500 Received: from mail.kernel.org ([198.145.29.136]:56284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbdA3GXf (ORCPT ); Mon, 30 Jan 2017 01:23:35 -0500 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FFC220274; Mon, 30 Jan 2017 06:23:21 +0000 (UTC) Received: from localhost (unknown [213.57.247.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 868E82026C; Mon, 30 Jan 2017 06:23:19 +0000 (UTC) From: Leon Romanovsky To: dledford@redhat.com, Jason Gunthorpe Cc: linux-rdma@vger.kernel.org Subject: [PATCH rdma-core V1 2/2] travis: Upload assets to github release Date: Mon, 30 Jan 2017 08:23:16 +0200 Message-Id: <20170130062316.16268-3-leon@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170130062316.16268-1-leon@kernel.org> References: <20170130062316.16268-1-leon@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Create and upload library source code to the corresponding release. The upload is triggered for pushed tags which are expected to be in semantic version format, e.g. v12.7.0. Signed-off-by: Leon Romanovsky --- .travis.yml | 18 +++++++++ Documentation/release.md | 100 +++++++++++++++++++++++++++++++++++++++++++++++ buildlib/github-release | 8 ++++ 3 files changed, 126 insertions(+) create mode 100644 Documentation/release.md create mode 100755 buildlib/github-release diff --git a/.travis.yml b/.travis.yml index c4fa1985..d65e30c1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,3 +37,21 @@ addons: script: - buildlib/travis-build +before_deploy: + - buildlib/github-release +deploy: + # Deploy assets to Github releases + # https://docs.travis-ci.com/user/deployment/releases/ + provider: releases + api_key: + # This is encrypted OAth token generated by + # Travis CLI tool (travis setup releases) limited to specific repo. + secure: G9sQd578nctgaety6f27P4p5nyrEgXdvMs1g+K2Hj7GPWxBpQ1Jm7kUlahcwfnYXpYqXen9b2dzyGzaLxjLL5rv6rbtOYp9SVrvybQrnJwkB0HCERKVMwEPsLPOB2lMouBDfk4+iUGdxtcw8Y5UU/xqKcAjkHkM5YpF5HauEX1Jj+Ep/XpX5DEcsVmFwkDgPKJOZv/eUgz1eVtXNFIvmSwJ+QuuUz64JpEpKMY4u7bFu0+2qWqACj19P/Rnufxpr+o5yoCuVNVptoRHMIWJiWZsrd2IhmL3knBoPoxNXSOWqQCK6DCW1KYOOVVAfFoD4YWhWrt6MuB3hh7lgLkS0rsdG9+iMlosl4SOkWZF8ZTkmrmtt6yx+s18tFdNI46QKzaA4wS/1hktweIFizYvmEwUCU8sNK5y9PMfDoGJGwiF1FzWrnLItKMiib0sTGO4Umgc0DKTazVRlIJYooOOOnBGubRudNx3elBTy4C/txSmqR39/6GYlvcyUDJMqB/oQJj2erQ5Gu8VykW5zjko6+3miX3C7GFVQ781BLxAdyNl4WRjZ9ibzjMbK3MC7f0ho1hST6cvBBmy2UnIdvB6zMayHZ/gtXKsDqE386k5FwSuTLT2V7942uFRVJiEwhVmgmBzbZND7PTj4s9GPrL2HLlJOgZooRZdx/ZcT/YNPFbA= + file: rdma-core-*.tar.gz + # Allow asterisks in file names. + file_glob: true + skip_cleanup: true + # Limit scope of deploy to specific repo. + on: + repo: linux-rdma/rdma-core + tags: true diff --git a/Documentation/release.md b/Documentation/release.md new file mode 100644 index 00000000..e0f0e814 --- /dev/null +++ b/Documentation/release.md @@ -0,0 +1,100 @@ +# Release Process + +Release process of rdma-core library consists from three stages + +1. Change library version, according to [Overall Pacakge Version](versioning.md) guide. +2. Push the change above to master branch and ensure that Travis CI reports successful build. +3. Create local annotated signed tag vX.X.X (`git tag vX.X.X -a -s`). +4. Issue `git release` command which will push tag, trigger Travis CI to upload + release tar.gz file and create release notes based on tag context with release notes in it. + +## git release + +There are many implmentations of different `git release` commands. We recommend you to use +the command from [this](https://github.com/mpalmer/github-release) repository due to its simplicity. + +--- +Copy&Paste from relevant [README](https://github.com/mpalmer/github-release/blob/master/README.md) + +--- + +This very simple gem provides a `git release` command, which will +automatically fill out any and all "release tags" into fully-blown "Github +Releases", complete with release notes, a heading, and all the other good +things in life. + +Using this gem, you can turn the following tag annotation: + + First Release + + It is with much fanfare and blowing of horns that I bequeath the + awesomeness of `git release` upon the world. + + Features in this release include: + + * Ability to create a release from a tag annotation or commit message; + * Automatically generates an OAuth token if needed; + * Feeds your cat while you're hacking(*) + + You should install it now! `gem install github-release` + +Into [this](https://github.com/mpalmer/github-release/releases/tag/v0.1.0) +simply by running + + git release + + +### Installation + +Simply install the gem: + + gem install github-release + + +### Usage + +Using `git release` is very simple. Just make sure that your `origin` +remote points to your Github repo, and then run `git release`. All tags +that look like a "version tag" (see "Configuration", below) will be created +as Github releases (if they don't already exist) and the message from the +tag will be used as the release notes. + +The format of the release notes is quite straightforward -- the first line +of the message associated with the commit will be used as the "name" of the +release, with the rest of the message used as the "body" of the release. +The body will be interpreted as Github-flavoured markdown, so if you'd like +to get fancy, go for your life. + +The message associated with the "release tag" is either the tag's annotation +message (if it is an annotated tag) or else the commit log of the commit on +which the tag is placed. I *strongly* recommend annotated tags (but then +again, [I'm biased...](http://theshed.hezmatt.org/git-version-bump)) + +The first time you use `git release`, it will ask you for your Github +username and password. This is used to request an OAuth token to talk to +the Github API, which is then stored in your global git config. Hence you +*shouldn't* be asked for your credentials every time you use `git release`. +If you need to use multiple github accounts for different repos, you can +override the `release.api-token` config parameter in your repo configuration +(but you'll have to get your own OAuth token). + + +### Configuration + +There are a few things you can configure to make `git release` work slightly +differently. None of them should be required for normal, sane use. + + * `release.remote` (default `origin`) -- The name of the remote which is + used to determine what github repository to send release notes to. + + * `release.api-token` (default is runtime generated) -- The OAuth token + to use to authenticate access to the Github API. When you first run `git + release`, you'll be prompted for a username and password to use to + generate an initial token; if you need to override it on a per-repo + basis, this is the key you'll use. + + * `release.tag-regex` (default `v\d+\.\d+(\.\d+)?$`) -- The regular + expression to filter which tags denote releases, as opposed to other tags + you might have decided to make. Only tags which match this regular + expression will be pushed up by `git release`, and only those tags will + be marked as releases. diff --git a/buildlib/github-release b/buildlib/github-release new file mode 100755 index 00000000..4c0ffda2 --- /dev/null +++ b/buildlib/github-release @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e + +if [[ $TRAVIS_TAG == v* ]] && [ "$TRAVIS_OS_NAME" = "linux" ]; then + # Let's create release for vX tags only. + git archive --prefix rdma-core/ --output rdma-core-$TRAVIS_TAG.tar.gz HEAD +fi