Skip to content

Commit

Permalink
Use Yarn package/installer on Travis/AppVeyor/CircleCI rather than npm (
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel15 authored Oct 16, 2016
1 parent d24c5da commit 8f4f01e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 16 deletions.
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
git:
depth: 10
language: generic
language: node_js

sudo: false
node_js:
- "6"

sudo: required # Until Yarn repo is added to apt-source-whitelist

addons:
apt:
Expand Down Expand Up @@ -39,13 +42,13 @@ matrix:
- env: TEST_TYPE="lint"
os: osx

before_install:
# Repo for newer Node.js versions
- curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
- ./scripts/bootstrap-env-ubuntu.sh

install:
# install proper node version
- nvm install ${NODE_VERSION:=6}
- node --version

# install deps
- npm install -g yarn
- yarn install

os:
Expand Down
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ branches:

install:
- ps: Install-Product node $env:node_version
- npm install -g yarn
- choco install yarn
- refreshenv
- yarn install

build_script:
Expand Down
12 changes: 5 additions & 7 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,24 @@ general:
artifacts:
- "artifacts/"

machine:
node:
version: 6

dependencies:
cache_directories:
- "~/.yarn-cache"

override:
# install node
- nvm install 6
- nvm use 6 && nvm alias default 6
- which node

# install dependencies
- npm install -g yarn
- yarn install
- ./scripts/bootstrap-env-ubuntu.sh

# setup ghr
- curl -L -o ghr.zip https://github.com/tcnksm/ghr/releases/download/v0.5.0/ghr_v0.5.0_linux_amd64.zip
- unzip ghr.zip

- ./scripts/bootstrap-env-ubuntu.sh

test:
override:
- node -v
Expand Down
7 changes: 6 additions & 1 deletion scripts/bootstrap-env-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
# Bootstraps a Yarn development environment on Ubuntu.
set -ex

sudo apt-get install -y rpm lintian
# Add Yarn package repo - We require Yarn to build Yarn itself :D
sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3
echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

sudo apt-get update -qq
sudo apt-get install -y rpm lintian yarn
gem install fpm
2 changes: 2 additions & 0 deletions scripts/build-dist.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$ErrorActionPreference = 'Stop'

npm run build
# Change this to "yarn pack" once #1114 is fixed
npm pack
if (Test-Path dist) {
rm dist -Recurse
Expand All @@ -11,6 +12,7 @@ mv yarn-*.tgz dist/pack.tgz
cd dist
tar -xzf pack.tgz --strip 1
rm pack.tgz
# Change this to "yarn install --production" once #1115 is fixed
npm install --production
rm node_modules/*/test -Recurse
rm node_modules/*/dist -Recurse
Expand Down
1 change: 1 addition & 0 deletions scripts/build-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cd dist
umask 0022 # Ensure permissions are correct (0755 for dirs, 0644 for files)
tar -xzf pack.tgz --strip 1
rm -rf pack.tgz
# Change this to "yarn install --production" once #1115 is fixed
npm install --production
rm -rf node_modules/*/test node_modules/*/dist
cd ..
Expand Down

0 comments on commit 8f4f01e

Please sign in to comment.