-
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: "gOLEpVldxcitQsNv74mA4D9p2bV5eaOa3eE1AO97Z0oYxsNGyxyVZbDSCBgQAkHLhaj7/nN7G0BE+pPgaOEUI6fE1LQDRENplqjAu64IlaC7V6R3bk0qZU53TTGWWPqCYBslTfY4kRewJTP0FMXMBMbBODfYu5k+jcRIO7WyDKO2A5aJmf0GfyI1PtT75QmlaMByiDwYsvOp7m5UVYPKWN+Exe3NdALDmprnTkIG4Q6/E2D+KTAkli+qq/i62WpyhBo7Ms/O/Xc3OW0fEKeEoJfV7V3oC8sowFLppBCTYV0M2DWY2t0qzJ++6cQt0MAb8IPSeGC8gB74NqnZB9Tn70I476+THlbw6TNdTyH5jJAanw2MIISqm1UyNjezKTPOZH1kSE1ldmUus4Yc9lbXuICrXbmF7b23qPMFKwVnykiYgv/LnbgzSkiOOpKD4KoOn+d7j3Waxmn7bWUbKRsNl9GbxppANZutUuy36lLiGXOy1SqLmkRot33UMs9u9yiv2os//UBAhUsLGOAkgsgf0zRqMJwRCr1mv+78GWVf6dt2fAVYES8vaKi3ObnSE99TU3sLwFM1Rv/1zhxP8Z2su/4Zj0kvUZ70cCKy7zLKwKt/IAnkDmDJN6GKZQpE1ZzCEUi6ez2674LJwVZk8Jw717wKFpe9BwR9cU/F5UnW6g8="
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: "yo4UVWDMKK2uHc6GNWsbnnQYASZza/gBCs1qzlNEq1GA4hoHW5slPplfUZjxvNmu+7SLpnwKzldm+dhnI8Z6Ve6IXGjME4C4YgNEiQbaCifvy3nrxPdUtsGWA03/XcnaBiz2MK8LHDHFszQNHqXR3fmX3kF7oQnKW1lhPj7X8cZKnP30YqY4vBx9ym6+yxqMJlPqZmCm+CT+HvJGh4XIZYy5/BIpyuhwgNi/i8RXjjRh2vo/xGnd/UTa52l3rBJNs+TAj55/Mt6UOnKZ1FmISR80uJO8IvG4InsdxTzuQY9X7pJ4RtuPgekQE0y4qcmDtWqKOE04mrgT6FkDYpaNT599rh1KrBH5wZ4wxa/3TSq0Lbn+xEvW4hMIqYK+mOsNXgQ1z4rYhhjOXdzNJuj03YxrjBVv27hqd/mfOrMvKxzs8PdSusLRo6oH9gkEqdLT79sOqxYfe50G7sdfeB2yqs0pHzI3YBPwtNQ1dPeuL+qu6kjIjKV+Jct6MCt249kXZE7Ufs/5FuJyZdKH/08u6QCP+oRCcR2qaZSux/DfBLyKw6UFlMiw4r0JsPtD3X9zRH//XlasH/WRyqB9S0xFQBJTz6wb9booFCAUtZ8L6gKLUGYtz/0Vssn6aMmRBM7+Kg6b7FHgNRt/tYZx+qEu2PVN89ZRhVysWqcKGHR5ydA="
on:
tags: true
cleanup: false
skip_cleanup: true