-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
63 lines (57 loc) · 2.61 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
61
62
63
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 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/serializy"
- export RELEASE_BODY=$(node -p "'[Click here to see release changes](https://github.com/$PROJECT_NAME/blob/$TRAVIS_BRANCH/CHANGELOG.md#' + require('./build/get_latest_tag.js') + ')'")
install:
- npm ci
jobs:
include:
- stage: pre-test(lint,audit)
script:
- npm audit
- npm run lint
- stage: test
script:
- npm run build
- npm run test
- npm run exec
- 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: tZ7R4VKqn5zjvXhxzIMRq+4CG17Klk9u/xKf0p5mLihd6esC4+Wg/HRpCkJ2oYodrcNA012CzHy3OeChiA10GpHL1Z1yTa/JWVtv5mvx7SxfkiTtSlg53eeH9CVinQpRNWpcSLTlZF5Pprs6alt5Jm5/hEJymHbKp1y+4cpHjrLO8yIgGcxlpCfDQQ9k/1tIPDifyEqbyIAL2aBnafNk8E8WKLqPPZ4TfFZDepvHqZmH7sYwWnexO716wGbO5lRMYoRHjPD63mbkMJehAqeFOo7lJnO4FESL/4ad1bh8iQ9L9wCY/AKmZyrUMNmVUFX0k7yq9NjJ33PJAD4hG696PC2fZVBvAe1c/QI1IGBYjX13UIKV/lIBdSYLGDoXFerO5jpQqvDLzL9Na7LWf1q4sljuOIPlMCx+HbWBn2bc6nQT0WQqnWfWNvERIaERwrI+YFPeXslD+fWdaBY9ugzgvhZgIVA2mpFxuMlkCJjvkPOED8gdo2gsd7nwHOduiVHoJ7bGtXv+B0lUYOs8HuvsY2WLqorsFZVbZivyLE6Hav3Aao821VHThbdIXBWDtRq4bAyE7JUHv6aPkGymvOeZOny6qb4R5PaGXrA/iNEUjbYrhQ0I/DbCuTIvhaR8/8O4UU4U6h1eO2fNl7oGi8M7lbHh7uV5hw3sXuIWFgnsXbA=