Skip to content

Commit 203a075

Browse files
mxxkannyhe
authored andcommitted
Make Travis build app.ele from commits to master (#16)
- Provide instant feedback on pull requests if there is a build failure - Use custom names for tags and releases - Add build status icon to README
1 parent c3b4263 commit 203a075

3 files changed

Lines changed: 52 additions & 0 deletions

File tree

.travis.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
language: node_js
2+
3+
# Use stable version of Node.js
4+
node_js:
5+
- node
6+
7+
# Cache installed node_modules between builds
8+
cache:
9+
directories:
10+
- node_modules
11+
12+
# Do not build tags (otherwise newly tagged releases get rebuilt)
13+
if: tag IS blank
14+
15+
env:
16+
- VERSION_NUMBER=$(node build/get-app-version-number.js)
17+
18+
install:
19+
- yarn global add create-quip-app
20+
- yarn install
21+
22+
script:
23+
- yarn run build
24+
25+
before_deploy:
26+
- export TRAVIS_TAG="v${VERSION_NUMBER}-b${TRAVIS_BUILD_NUMBER}"
27+
- git tag -f "$TRAVIS_TAG"
28+
29+
# Deploy by publishing the built app.ele file as a GitHub release
30+
deploy:
31+
provider: releases
32+
api_key: $GITHUB_TOKEN
33+
file: app/app.ele
34+
# Generate fancy release name
35+
name: "Version ${VERSION_NUMBER}: $(TZ=UTC date +'%B %d, %Y %r')"
36+
# Necessary for GitHub release deploy mechanism
37+
skip-cleanup: true
38+
# Skip deploys from tags and branches other than the master
39+
on:
40+
branch: master
41+
tags: false

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Build Status](https://travis-ci.org/toastmasters-dev/quip-toastmasters.svg?branch=master)](https://travis-ci.org/toastmasters-dev/quip-toastmasters)
2+
13
`npm install`
24

35
`npm start`

build/get-app-version-number.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Takes a look at manifest.json and outputs the key `version_number`.
3+
*/
4+
5+
const fs = require('fs');
6+
7+
fs.readFile('app/manifest.json', 'utf8', (err, manifest) =>
8+
console.log(JSON.parse(manifest).version_number),
9+
);

0 commit comments

Comments
 (0)