-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (54 loc) · 2.55 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-serializy 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-serializy"
- 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 "[email protected]"
- 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://[email protected]/$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: NmTpLAVX83pyyKJnTAyCy89XAJioG7dUM86CMl2V7u2Z3BdN4++Ee6pfTQkzrjZ6ITz+kil4Jpn8Vo5AHU18gmDwaqV+xrV2TX3Z58umPXY3tMR4s9STjDukUUhYn6H5m2cwcdScW+00s+aR8KUSkY49YtF3Kbha+EO1rA8/cpT8rINDz9ecUPH6AWuOIWbwpFiUQtrXUUxA9yKoGBRHRy5XX4r3GWuMRBKC4dTk0m1Z9kLgTmpi2ICrPmvzKyMtLspoqJWMO1n7d0saRW7mepJ34alCjaoUGi1lzHqwimCT87pCvwDIF4tXrRVmpCp4ZS1hTYeH/TedJcn+qw1abmmYaeC6fzSCB6DlWWQSJ4NI73pOzWKhQ1Q1SSd/x7ScWy+9K8CNY7jUoUVSMka1fBgeNeGxqezYl1A1GEa/iW6r0uiTOnQYC80UNtCnCbeB4kR6TeofECGWXMwuKOkT9gYnrvR0edGZmwmGqSFiLte86A1rxk3eoQr8NONMr11mkbeAe0hNbcG7TGojy4AwlY/q0VKpw7if0Wo9Hft/26sahFMawT7XvM9QmIs7+/QUnSEdVMDFy/qphQNlSUqNAMJX7U/5dtjc13WUAeNwg6gGAwoaAuE2mysFUYxbtD/KjlYStGFXhGJXilx2MVDZal2ZtDXGxKtIMV1xNF5QwaM=