This repository has been archived by the owner on Feb 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
60 lines (54 loc) · 2.53 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
language: node_js
node_js:
- "node"
cache:
directories:
- "node_modules"
before_install:
- export PACKAGE_VERSION=$(node -p "require('./package.json').version")
- export NPM_REMOTE_VERSION=$(npm view kinka version)
- export PACKAGE_NAME=$(node -p "require('./package.json').name")
- export BRANCH_IS_TAG=$(node -p "/^([0-9].[0-9].[0-9]+((-(alpha|beta))|))$/.test('${TRAVIS_BRANCH}')")
- export GIT_LOG="$(git log --pretty=format:"* %s (%h)")"
- export PROJECT_NAME="acacode/kinka"
- export RELEASE_BODY=$(node -p "'[Click here to see release changes](https://github.com/$PROJECT_NAME/blob/$TRAVIS_BRANCH/CHANGELOG.md#' + require('./bin/getLatestTag.js') + ')'")
install:
- npm ci
jobs:
include:
- stage: lint
script: npm run lint
- stage: test
script:
- npm run build
- npm run test
- stage: publish
if: env(BRANCH_IS_TAG) != true AND branch = master AND type = push
name: "Create Github Release"
before_deploy:
- git config --global user.email "builds@travis-ci.com"
- git config --global user.name "Travis CI"
- git tag $PACKAGE_VERSION -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER from $TRAVIS_BRANCH"
- git push -q https://$GITHUB_TOKEN@github.com/$PROJECT_NAME --tags
- zip -r release.zip dist lib es src index.d.ts LICENSE README.md package.json
- ls -l
deploy:
provider: releases
name: "Release ${PACKAGE_VERSION}"
body: "$RELEASE_BODY"
overwrite: true
skip_cleanup: true
api_key:
secure: ${GITHUB_TOKEN}
file:
- release.zip
on:
all_branches: true
repo: $PROJECT_NAME
after_deploy:
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
- npm publish
notifications:
slack:
rooms:
secure: t9LO6BExYzs4mElFgeeVhoDC01t9tg/L/6extSBqIQmJzvVNQaOMiZh6QYUg9wmnzVU4FqjoVeuMrR7bMrlzek2jvC7bPYHwnWCN86QFcbtnr8IApYhxLWmByDWruxcTbBhkTHzkyBJJboaZXnk0zcJhcsRkFYntUwBo/PTuYnQvZoAh/vQqRDoVQEUa+4dp+W3Muu7TTit06t+T4Qxk4wtoGd1ehVUoi4e/UONa7Ykm4QyQz16vksjz4loHly8aJ6hP4KP89vqksC1bGzn15StvA4YHBvg0PDrHcqGwVHtZUkD72CzKB7C96TFIojej+wh+MDX8SR9GDRpqlKNblCcbm+pObHPkvESC3+w9uZJAyLgoA398zp0sPt3RYZ37Rz+RXUx3Vnlu6t7IM+Bo6q6ZlivmiYKUujoX91cbBiMu2dOXWAtgVV3+qpsskUOEi8cm/O1/kuM/n2pjsgU4AYqE+f2rRNd9OeXHQoEr+j56PqgOcOOGdzOi8IxfpCfVSrrePHvTE534FbAySEbpX+Ulk1nuFzj6ort0DfYKDU8SxFCmfOl42BiCg/T4e5dxP9plpnBHBFJYNqqfcLIu9o2RsXILSAtoawzvrsBN3wxgeFmSJ9dMARODSRNGmeROwBDyT7y03gJcmxYT4UI8DsXkTEBANv/IfinbeBGrMo4=