-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (64 loc) · 2.99 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
64
65
66
67
68
language: node_js
dist: focal
node_js: 18
branches:
only:
- main
- /^v\d+\.\d+\.\d+$/
stages:
- name: test
if: tag IS blank
- name: deploy
before_install:
- git config --local user.name "LTO Network"
- git config --local user.email "[email protected]"
install:
- npm install
jobs:
fast_finish: true
include:
- name: "Test"
stage: test
script:
- npm test
- name: "Publish GitHub release"
stage: deploy
if: branch = main AND type = push
before_script:
- CURRENT_VERSION=$(git describe --tags --abbrev=0)
- |
if (git log $CURRENT_VERSION..HEAD | grep -q -i "\[bump:major\]"); then
NEXT_VERSION=$(awk -F. -v OFS=. '{$1++;$2=0;$3=0;print}' <<< "$CURRENT_VERSION")
elif (git log $CURRENT_VERSION..HEAD | grep -q -i "\[bump:minor\]"); then
NEXT_VERSION=$(awk -F. -v OFS=. '{$2++;$3=0;print}' <<< "$CURRENT_VERSION")
else
NEXT_VERSION=$(awk -F. -v OFS=. '{$3++;print}' <<< "$CURRENT_VERSION")
fi
script:
- git tag "$NEXT_VERSION"
before_deploy:
- npm run build
deploy:
provider: releases
api_key:
secure: "z6C1LajSuhEBC9+DROJjJ+xKYxIPsaQ7q/E5RTqduWapPgz0RYLBE18zIA4nq7WnkzkXwyHe642T3j4l+NYvXdHzVff2H9gbUOl+Bnh0Ex7C+u1E/fVzEFc3p5XxsHtTLfqccCDED/hRBiw/cg8Gy4L5Pr0PacPYDmqnIdyYAUgg7lI5znrbUMCQRrVn1wMY4RpZ+xNQDWzTJ/JGPDo2ZIrfSmZ7iT2k+3ZKNJPt48RMG5CXKDP9Z9Fatiz6HK5g9of+k3N/Ga7OIXv/TKo93UIyuBaZ8dSXY4PiOCmLAUZKkBIjpG9k1Rgpt+C/yeW29RdCieErI52YRGgH7Ho/Wt8Mgl9ieAkgn4yhjb+PuwI8bDIsOLS2Lcu4QmWd4hqQiP91DT1I/DuCHtlvU6fTJkTujZPnjY6knSRuhk8ICRTCl2OT8wT9etT5uES9paW/3vfZDOb3ftEcfCeONn+1OvMwjCdwEWYF59xDNbezN+r0lllVwR3mP1QbCxb5wPoYlzeW4H1h6cTQWsnAk47I2G4IxK0lOiuUtL0IrcpQLHrml8J/xTta8FGmoK3Qz8AbzKKIFzVmgc8GkVsYCyAoB8g6H6sXFCxrZrGSPfcUm9diqSgQKOpY12sNfteAjwRA9VWjNQ9XPfkpK9Hxr3ZpFnk7t/ifiw12LPvxnTazTfc="
cleanup: false
skip_cleanup: true
on:
all_branches: true
- name: "Publish to NPM"
stage: deploy
if: tag IS present
before_install:
- npm version $TRAVIS_TAG --no-git-tag-version
script:
- npx tsc
deploy:
provider: npm
email: [email protected]
api_key:
secure: "DX1lqgQCnfhPE829g2wLIqAseMLLwzJ+N53GaETauIDfpCzff9MLNZhfsdkNLwZU29duVHbqzTaX/3vSIde56Qe75OTQUPvvcMjrAsorH3lTHQQZPQ4nu60sZMflP1XFEt9DabGfyCa8K1N0H17OFurcu831l5yvHrXUgjy4XPLEqOzFbJDc9UwMVtPWN0QwP2hBYkX/PzbXV0sYj/G4SjRKo4GBDJU8IgQ507vQYWMdBTwsQYByt3cD8jcCIV04WKtnqLozrhzhYJvLQiFNzJodBNNkkgooMQT4DaRVaXug4qXjF+gVO82fa36Vwc89GfJiLvBr1M5Fe8FfBgbqW/+4ZwZccRzfE6pf4QdLVdp1ZGkDu3RrnodjQnAJjldAlIi2xdrTzHy+3rDtym7PCs2QY6zA6fGokx/3Wxch4HfwgW051PQEZ30xfEDBmQDdPhCO11OW0qzGSuwzZb72lgRYzHqooeeqE4ohAmJE0qi3dmqlyBMarttLY/JXfTpZUKCx/pRwWvYI8qIyO5wJH8QtrDSvi/FWb+Ed/xg6Eg0ewEv5c/zKEs1sGcWfyaVuIy0WpRRzZPvUJOchyciu23s9IZRHO9z9anE2hW0c7NiCHkfdc7DjZ6DVR2BEVFc4tCU3L2FsGpG0S0UBSv5gVCzleWxQC49xZwlqjPfXtnY="
on:
tags: true
cleanup: false
skip_cleanup: true