.gitlab-ci.yml 896 Bytes
Newer Older
Ludan Stoecklé's avatar
Ludan Stoecklé committed
1 2 3 4 5 6
stages:
  - build
  - publish

build:
  stage: build
Ludan Stoecklé's avatar
Ludan Stoecklé committed
7
  image: node
Ludan Stoecklé's avatar
Ludan Stoecklé committed
8 9 10 11 12
  cache:
    paths:
      - packages/*/node_modules
    untracked: true
  script:
Ludan Stoecklé's avatar
Ludan Stoecklé committed
13 14
    - npm -v
    - node --version
Ludan Stoecklé's avatar
Ludan Stoecklé committed
15 16 17
    - npm install -g pegjs
    - npm install -g lerna
    - lerna bootstrap --concurrency 8
Ludan Stoecklé's avatar
Ludan Stoecklé committed
18
    - rm packages/rosaenlg/dist/browser/*.js
Ludan Stoecklé's avatar
Ludan Stoecklé committed
19 20 21 22 23 24 25 26 27 28
    - lerna run build
    - lerna run test
  artifacts:
    paths:
      - packages/*/resources_pub
      - packages/*/dist
    expire_in: 1 day

publish_npm:
  stage: publish
Ludan Stoecklé's avatar
Ludan Stoecklé committed
29
  image: node
Ludan Stoecklé's avatar
Ludan Stoecklé committed
30 31
  script:
    - npm install -g lerna
Ludan Stoecklé's avatar
Ludan Stoecklé committed
32 33
    - npm install -g snyk
    - snyk auth $SNYK_TOKEN
Ludan Stoecklé's avatar
Ludan Stoecklé committed
34 35 36 37 38 39 40
    - npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
    - npm config set always-auth=true
    - npm config set email=ludan.stoeckle@rosaenlg.org
    - npm config list
    - npm whoami
    - lerna publish from-package --yes
  only:
41
    - /^v[0-9]+\.[0-9]+\.[0-9]+$/
Ludan Stoecklé's avatar
Ludan Stoecklé committed
42
  when: manual