Skip to contentSkip to conversation

travis: Upload assets to github release

PATCH In review Leon Romanovsky 2 participants 2 messages Mar 12, 2017 – Mar 14, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 travis: Upload assets to github release

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.

---

Hi All,

This is second attempt to add automatic github release facilities. The previous version was merged [1] and reverted because it had wrong OAuth key. I hope that this time [3], it will work :)

[1] https://github.com/linux-rdma/rdma-core/commit/7b78568cb1c5fe75d760a87119475124a325df9a
[2] https://github.com/linux-rdma/rdma-core/commit/b9730c92d8873059ed651db472f942a5a6693793
[3] https://travis-ci.org/linux-rdma/rdma-core/builds/210311044

---
 .travis.yml              | 17 +++++++++
 Documentation/release.md | 99 ++++++++++++++++++++++++++++++++++++++++++++++++
 buildlib/github-release  |  8 ++++
 3 files changed, 124 insertions(+)
 create mode 100644 Documentation/release.md
 create mode 100755 buildlib/github-release
.travis.yml +17 -0
index 8f9adc83..d719eab7 100644
@@ -39,3 +39,20 @@ addons:
 
 script:
   - buildlib/travis-build
+  - 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: ok/WMzFgsSnk+NZ850QEUESHRfJ4Ae7T8eA4dcx4fuw2RqybAh8wjxrLP5GKR27WrzB3hKHHTi7fgE0VtBY024kGJ/+wlQXHN1p89JvCiQlGOKkxy5YIlS4GUhwwkqgoU+hmifxl1i+9yCuowHPIM4WoP+NR+IZgvMahlrdPCS2OleFtrqyaHZbC/Usdt0WZLeQzG+rVLec/NvPnVOn81e17yuAuluHAzu+qcV94szqe/zwDzG8RUUKXaeDEQ3JQja4bCLL/kTkWR8JGsfwvcqc9Ut4Ry2b7uEWp5/FIcxUGWviKRgRzEdcT40iMMiJbIrH7gYp66Ymr/dypqUfc4u/xSb4AmpTMcYGUXJxsdzKyL6d/7HbuHIIVc5o1V/L5mdaIjeO5KjTFjMMD5KoSXfBlNIGk2as1JD/99lxJ3VlpQGwI5390+Tyl8o4Ao4aBXSCG96PDK4+UkYFht/wrw+UoYdV07u3x7zz21O3N3Lu5733hDvcvyOW6uIzoeLQ5O62/3Pq+DOFRs/nnRiW8/gjIkEQAyj/GGxw/taslpFJFcdVt/MSueV4t5OCI2YdGA/NxG/c4FIGy+dntV5BB6Gld8KkP/PP74yzJ1o/PRDRExTbsQzrdisDrVIf0r4pxTTsw1gXRE5r6S0tQ5aNoXAQ5h4xiwAIGqqBF4HESJjA=
+  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
Documentation/release.md new file +99 -0

99 lines not on this page · raw message

buildlib/github-release new file +8 -0
new file mode 100755
index 00000000..8f21cf3a
@@ -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-$TRAVIS_TAG/ --output rdma-core-$TRAVIS_TAG.tar.gz HEAD
+fi

--
2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170312184758.14959-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw
Quoted 6 lines · Leon Romanovsky

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.

I've merged this and will give it a try later today.

Quoted 222 lines

---

Hi All,

This is second attempt to add automatic github release facilities. The previous version was merged [1] and reverted because it had wrong OAuth key.
I hope that this time [3], it will work :)

[1] https://github.com/linux-rdma/rdma-core/commit/7b78568cb1c5fe75d7
60a87119475124a325df9a
[2] https://github.com/linux-rdma/rdma-core/commit/b9730c92d8873059ed
651db472f942a5a6693793
[3] https://travis-ci.org/linux-rdma/rdma-core/builds/210311044

---
 .travis.yml              | 17 +++++++++
 Documentation/release.md | 99
++++++++++++++++++++++++++++++++++++++++++++++++
 buildlib/github-release  |  8 ++++

 3 files changed, 124 insertions(+)

 create mode 100644 Documentation/release.md
 create mode 100755 buildlib/github-release

.travis.yml +0 -0
index 8f9adc83..d719eab7 100644
@@ -39,3 +39,20 @@ addons:
 

 script:
   - buildlib/travis-build
+  - 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:
ok/WMzFgsSnk+NZ850QEUESHRfJ4Ae7T8eA4dcx4fuw2RqybAh8wjxrLP5GKR27WrzB3h KHHTi7fgE0VtBY024kGJ/+wlQXHN1p89JvCiQlGOKkxy5YIlS4GUhwwkqgoU+hmifxl1i +9yCuowHPIM4WoP+NR+IZgvMahlrdPCS2OleFtrqyaHZbC/Usdt0WZLeQzG+rVLec/NvP nVOn81e17yuAuluHAzu+qcV94szqe/zwDzG8RUUKXaeDEQ3JQja4bCLL/kTkWR8JGsfwv cqc9Ut4Ry2b7uEWp5/FIcxUGWviKRgRzEdcT40iMMiJbIrH7gYp66Ymr/dypqUfc4u/xS b4AmpTMcYGUXJxsdzKyL6d/7HbuHIIVc5o1V/L5mdaIjeO5KjTFjMMD5KoSXfBlNIGk2a s1JD/99lxJ3VlpQGwI5390+Tyl8o4Ao4aBXSCG96PDK4+UkYFht/wrw+UoYdV07u3x7zz 21O3N3Lu5733hDvcvyOW6uIzoeLQ5O62/3Pq+DOFRs/nnRiW8/gjIkEQAyj/GGxw/tasl pFJFcdVt/MSueV4t5OCI2YdGA/NxG/c4FIGy+dntV5BB6Gld8KkP/PP74yzJ1o/PRDREx TbsQzrdisDrVIf0r4pxTTsw1gXRE5r6S0tQ5aNoXAQ5h4xiwAIGqqBF4HESJjA= +  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

Documentation/release.md new file +5 -0
new file mode 100644
index 00000000..2a40ef76
@@ -0,0 +1,99 @@
+# 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.

Documentation/release.md new file +4 -0
+
+## 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.

Documentation/release.md new file +3 -0
+
+---
+Copy&Paste from relevant [README](https://github.com/mpalmer/github-

release/blob/master/README.md)

Documentation/release.md new file +5 -0
+
+---
+
+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

Documentation/release.md new file +12 -0
+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(*)

Documentation/release.md new file +4 -0
+
+    You should install it now!  `gem install github-release`
+
+Into [this](https://github.com/mpalmer/github-release/releases/tag/v

0.1.0)

Documentation/release.md new file +14 -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

Documentation/release.md new file +3 -0
+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

Documentation/release.md new file +3 -0
+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

Documentation/release.md new file +3 -0
+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

Documentation/release.md new file +6 -0
+(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

Documentation/release.md new file +3 -0
+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.

buildlib/github-release new file +7 -0
new file mode 100755
index 00000000..8f21cf3a
@@ -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-$TRAVIS_TAG/ --output rdma-

core-$TRAVIS_TAG.tar.gz HEAD
+fi
--
2.12.0

Signature · 9 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html