|
1 | 1 | language: node_js |
2 | 2 | sudo: false |
3 | 3 | node_js: |
4 | | -- '6' |
5 | | - |
6 | | -env: |
7 | | -- NPM_CONFIG_LOGLEVEL='warn' |
| 4 | +- 'lts/*' |
| 5 | +install: |
| 6 | +- yarn |
| 7 | +cache: |
| 8 | + yarn: true |
| 9 | + directories: |
| 10 | + - node_modules |
| 11 | + - projects/ngx-openlayers/node_modules |
| 12 | + - dist |
8 | 13 |
|
9 | 14 | jobs: |
10 | 15 | include: |
11 | 16 | - stage: check |
| 17 | + name: next lib linting |
12 | 18 | script: |
13 | | - - npm run lint |
14 | | - - stage: build library |
15 | | - before_script: |
16 | | - - rm -rf lib |
| 19 | + - yarn lint |
| 20 | + |
| 21 | + - stage: build |
| 22 | + name: next lib and demo |
17 | 23 | script: |
| 24 | + - yarn build --prod --base-href "/ngx-openlayers/" --progress false |
| 25 | + |
| 26 | + - stage: release |
| 27 | + name: next lib version on github releases |
| 28 | + if: tag =~ /^\d+.\d+.\d+-next.\d+$/ |
| 29 | + script: 'true' # skips tests |
| 30 | + before_deploy: |
| 31 | + - cd dist/ngx-openlayers |
| 32 | + - cp ../../projects/ngx-openlayers/CHANGELOG.md CHANGELOG.md |
18 | 33 | - npm pack |
19 | | - - mkdir -p lib |
20 | | - - cp *.tgz lib/ |
21 | | - cache: |
22 | | - directories: |
23 | | - - lib |
24 | | - - stage: build demo |
25 | | - before_install: |
26 | | - - cd example |
27 | | - install: |
28 | | - - npm i |
29 | | - script: |
30 | | - - npm un -S ngx-openlayers |
31 | | - - cp -r ../lib . |
32 | | - - npm i -S lib/*.tgz |
33 | | - - npm run build |
34 | | - cache: |
35 | | - directories: |
36 | | - - lib |
37 | | - - stage: deploy library release |
38 | | - script: ignore |
39 | 34 | deploy: |
40 | | - - provider: releases |
41 | | - api_key: $GITHUB_OAUTH_TOKEN |
42 | | - file_glob: true |
43 | | - file: lib/* |
44 | | - skip_cleanup: true |
45 | | - on: |
46 | | - tags: true |
47 | | - - stage: deploy demo pages |
48 | | - script: ignore |
| 35 | + - provider: releases |
| 36 | + prerelease: true |
| 37 | + api_key: $GITHUB_OAUTH_TOKEN |
| 38 | + file_glob: true |
| 39 | + file: '*.tgz' |
| 40 | + skip_cleanup: true |
| 41 | + on: |
| 42 | + tags: true |
| 43 | + |
| 44 | + - stage: release |
| 45 | + name: next demo on github pages |
| 46 | + if: tag =~ /^\d+.\d+.\d+-next.\d+$/ |
| 47 | + script: 'true' # skips tests |
| 48 | + before_deploy: |
| 49 | + - cd dist/demo-ngx-openlayers |
49 | 50 | deploy: |
50 | | - - provider: pages |
51 | | - local_dir: dist |
52 | | - skip_cleanup: true |
53 | | - github_token: $GITHUB_OAUTH_TOKEN |
54 | | - on: |
55 | | - tags: true |
56 | | - - stage: publish library release |
| 51 | + - provider: pages |
| 52 | + local_dir: dist/demo-ngx-openlayers |
| 53 | + skip_cleanup: true |
| 54 | + github_token: $GITHUB_OAUTH_TOKEN |
| 55 | + on: |
| 56 | + tags: true |
| 57 | + |
| 58 | + - stage: deploy |
| 59 | + name: next lib version on npm |
| 60 | + if: tag =~ /^\d+.\d+.\d+-next.\d+$/ |
| 61 | + script: 'true' # skips tests |
| 62 | + before_deploy: |
| 63 | + - cp projects/ngx-openlayers/CHANGELOG.md dist/ngx-openlayers/CHANGELOG.md |
| 64 | + - cd dist/ngx-openlayers |
57 | 65 | deploy: |
58 | | - provider: npm |
| 66 | + - provider: npm |
59 | 67 | email: $NPM_EMAIL |
60 | 68 | api_key: $NPM_TOKEN |
| 69 | + tag: next |
| 70 | + skip_cleanup: true |
61 | 71 | on: |
62 | 72 | tags: true |
63 | | - skip_cleanup: true |
64 | | - |
|
0 commit comments