Skip to content

Commit

Permalink
Clarify travis steps; switch to using containers for builds
Browse files Browse the repository at this point in the history
* add comments for each step in .travis.yml
* clarify naming convention for tags in readme
* enable container based Travis builds (sudo: false)
* switch build to run first the steps and then compile
  • Loading branch information
corinadev committed Nov 14, 2018
1 parent b91b555 commit 3c880a6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
# We don't need to use `sudo`, and can instead use containers for faster builds
sudo: false
# This is a JS project
language: node_js
# Use latest stable node version
node_js:
- stable
branches:
only:
# Only run branch builds on master to prevent double builds on pull requests
- master
- "/^\\d+\\.\\d*\\.?\\d*$/" # Build on tags - allow branches with version numbers
# Allow branches representing tags, otherwise the deploy step won't trigger
- "/^\\d+\\.\\d*\\.?\\d*$/"
# Use `npm ci` instead of default `npm install` for installing dependencies
install:
- npm ci
cache:
directories:
- "$HOME/.npm"
script:
- npm run compile
- npm run test
- npm run compile
# Archive the built files in preparation of uploading them to Github
before_deploy:
- tar -zcvf venus-html5-app.tar.gz dist/
deploy:
# Upload artifacts to Github Releases - use `releases` provider
provider: releases
api_key:
secure: YwhVwYCJE47WyVNjlFSun8KpgD0vmz4Qg+2yrGKsRCVtD9f060sENlQbLkQL1eiDM/JNrWb8lQS+OoBxKuVHBGhzbeVNt0/VES3c43H7zqHl4tZF5D5wlF5Nv/86Ppu0dkx0mt4PCmsU1Te5fSRyjAE8tY/mzHoNt6ntUWE6wAi0h1/Qj+FqKa2vVJ1U/ruP89XDGIyrXGUlzFGBbotopGYXctypDMW7AcIDG40RtDKolaLRtX19THVGrGBfOKI5rbCH/4iamRt6kGvkmrUv7SPc9ESx9YdkNdoRiaaVC1GFN+yUcK0WXFfuaxwAlKZqC2IDEGPqXwJenpXeQB0mIjRDkXaisZEwuviev47yuFyCk4eWHmVoUAFdYSZ6lqs3r2SntaCIchpocbbe5M626Sbr4sRu/Nk7OMgiojuIiyoxhAZ3+ozso664BDQW1pL5Dn7cMNF+0h/BzbPqF+sw2e4IDA1/2wZmZylTC7GQsCz/y722WVOT0UGwlTR6GqeUUnP03pdCNjSO2C9wzmrRH5U9UPA4JNw0WEBiBZ3AswDjByZPSZ48KZYoLtftyBHQ1htortcZdWXopVWZU+mOadggB/3xrJaH/2lwWh1SgBkAQeqpSDqP2K6RrgUn+RtadZ3wCm8Hl+2nU5chD2CorLvtNmhE9UzONcG02+qyQOE=
skip_cleanup: true
# Upload archive build `before_deploy`
file: venus-html5-app.tar.gz
# Trigger release on tags
on:
repo: victronenergy/venus-html5-app
tags: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ press the `reload page` on the top left corner of the page.

Whenever a new tag is created, Travis CI will build the app, archive the built files and upload them as `venus-html5-app.tar.gz` to the Github Release associated with the tag.
The app can then be downloaded from `https://github.com/victronenergy/venus-html5-app/releases/download/<TAG_NAME>/venus-html5-app.tar.gz`.
The build script expects the tags to follow semantic versioning (e.g. `1.2.3`, `1.2`, etc.) and will not trigger for tags that don't follow this convention (e.g. `v1.0`, `test`).

To include the HTML5 app in the next Venus OS version:

Expand Down

0 comments on commit 3c880a6

Please sign in to comment.