Skip to content

Loading…

Set up Travis releases. #496

Merged
merged 1 commit into from

2 participants

@fwalch

You can find the documentation of this feature here. Basically, it would automatically publish XPI (Firefox) and ZIP (Chromium) to a Github release when you create a tag on your repo.

What it does

Here's an overview of how it works: I created a test tag 0.8.5.4-TEST and pushed it. This triggered a build, which in turn created a release at https://github.com/fwalch/uBlock/releases/tag/0.8.5.4-TEST. As you can see, this has the two files for Firefox and Chromium. The commit message of the tagged commit is used as the release description, but you can also edit that later.

For ordinary commits (i.e. non-tagged), it of course doesn't create a release. See e.g. this build.

Required steps

If you want to merge this, I think the easiest way is the following (unfortunately it's still a bit lengthy, at least if you never used Travis):

  1. Create Travis account:
    1. Go to https://travis-ci.org and log in with Github.
  2. Generate a Github token that allows Travis to create new releases at Github:
    1. Install the travis Ruby gem (gem install travis)
    2. Change to the uBlock directory and execute travis setup releases. You'll need to log in with your Github username and password. What you answer is not that important, only that you say "yes" when it asks "Encrypt API key?". Copy the value of api_key.secure of generated .travis.yml somewhere for later.
    3. Remove the .travis.yml.
  3. Merge this PR and replace TODO: your key here! in the travis.yml with the encrypted key you got in step 2.2 (similar to fwalch@f160ddf).
  4. Go to your profile page at https://travis-ci.org/profile and enable Travis for the gorhill/uBlock repository.

The next time you push a tag, Chromium and XPI files will automatically be added to a new release.

I hope you find this useful; if you have any questions, let me know!

@gorhill

Looks nice, thanks. That will save time.

@gorhill gorhill merged commit 240ef0d into chrisaljoudi:master
@gorhill

When I look up gem, I am told if can be found in two packages: ruby and rubygems. Which one should I install (the smallest for all this to work)?

@fwalch fwalch deleted the fwalch:travis-releases branch
@fwalch

Hm, rubygems, I guess.. which OS are you on?

@gorhill

Linux Mint.

@fwalch

Well, you can install ruby and see if it has the gem executable (on my OS, this is the case [Arch Linux]). If not, rubygems will probably depend on ruby anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 14, 2015
  1. @fwalch

    Set up Travis releases.

    fwalch committed
This page is out of date. Refresh to see the latest.
Showing with 28 additions and 6 deletions.
  1. +16 −0 .travis.yml
  2. +7 −0 tools/make-chromium.sh
  3. +5 −6 tools/make-firefox.sh
View
16 .travis.yml
@@ -0,0 +1,16 @@
+sudo: false
+env:
+ matrix:
+ - BROWSER=chromium EXT=zip
+ - BROWSER=firefox EXT=xpi
+script: ./tools/make-${BROWSER}.sh all
+deploy:
+ provider: releases
+ api_key:
+ secure: TODO: your key here!
+ file: dist/build/uBlock.${BROWSER}.${EXT}
+ skip_cleanup: true
+ on:
+ repo: gorhill/uBlock
+ tags: true
+ all_branches: true
View
7 tools/make-chromium.sh
@@ -22,4 +22,11 @@ cp platform/chromium/*.js $DES/js/
cp platform/chromium/manifest.json $DES/
cp LICENSE.txt $DES/
+if [ "$1" = all ]; then
+ echo "*** uBlock.chromium: Creating package..."
+ pushd $(dirname $DES/)
+ zip uBlock.chromium.zip -qr $(basename $DES/)/*
+ popd
+fi
+
echo "*** uBlock.chromium: Package done."
View
11 tools/make-firefox.sh
@@ -2,10 +2,10 @@
#
# This script assumes a linux environment
-echo "*** uBlock_xpi: Copying files"
+echo "*** uBlock.firefox: Copying files"
# use underscore instead of a dot!
-DES=dist/build/uBlock_xpi
+DES=dist/build/uBlock.firefox
rm -r $DES
mkdir -p $DES
@@ -25,15 +25,14 @@ cp platform/firefox/chrome.manifest $DES/
cp platform/firefox/install.rdf $DES/
cp LICENSE.txt $DES/
-echo "*** uBlock_xpi: Generating meta..."
+echo "*** uBlock.firefox: Generating meta..."
python tools/make-firefox-meta.py $DES/
-
if [ "$1" = all ]; then
- echo "*** uBlock_xpi: Creating package..."
+ echo "*** uBlock.firefox: Creating package..."
pushd $DES/
zip ../uBlock.firefox.xpi -qr *
popd
fi
-echo "*** uBlock_xpi: Package done."
+echo "*** uBlock.firefox: Package done."
Something went wrong with that request. Please try again.