-
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 axios-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/axios-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: Pn2kH6U6NCsvGa4P0zEVl/TN+c9wrblBsbNicUVDM/HYFmiB+rPYfAgh6RT1oKxWZNZXl2jGVkBxnIDpNNXHdFRj4zTSbpz5iDNi38n1i70Ch7xfmXWblx4SrEwOVoR/RVS7Kd+IZCyjT5CEygnM/wO/uU5PZHUVsDqpaG/88EsF/gyMCVmaQQHlfDubBjFJ4VQ78RG3SlVv6lC+as9eLmscHO0Z0Bi7rRAs/zNJu11XEOG4Qc3BW1pZVpA6tm19HFdkljdi1YVL2NBgU+0wC/1URhYI5tGFiuXWI0sa7/3pqhKBoi6Mav1kH1ybfbTZwfiywI6MODIeeRa7jpgKg9S9wRu3UQLHI9J4hn+2I7G/6VwWxQTn/AXcqzRAvAqTuQ6KrNl/WgPnQXs5vOGJ2C/2UIKsecL/3W9ecbQNEhCUz13Y8xT5k8tSZDUr353AsvbGx8Y0F0fnzBYOm7kiCijYls22RNOK5/6G4cfNJiALQXwVgQUO1jBAEA2inJgxmkI73k2U4vC51V54EZBa5mr5W/KDBNuSHt7EOJvadqFOpEY5Wfg+aTO/8AH/Y5OOf+HT8GwhnUvYjQFrZ3HGJza6hcxqwx8b0pt9QPY5HM/YxRbbkqhNm08zrsh9HBLl2tZncDtjB+3tbtBMUTDXgP7eZzH93mGnwmkcKSQm7d0=