.gitlab-ci.yml 1.35 KB
Newer Older
Lorenz Brun's avatar
Lorenz Brun committed
1 2 3
stages:
  - build-deps
  - build
Timon Stampfli's avatar
Timon Stampfli committed
4
  - publish
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

build-dev:
  except:
    - tags
  stage: build
  image: node:12
  script:
    - node ./setversion 0.0.0-$CI_COMMIT_SHORT_SHA
    - npm ci
    - npm run build-package
    - mv soicode-*.vsix soicode-dev-$CI_COMMIT_SHORT_SHA.vsix
  dependencies:
    - build-helper
  artifacts:
    untracked: false
    paths:
      - soicode-dev-$CI_COMMIT_SHORT_SHA.vsix
    expire_in: 30 day

build-release:
  only:
    - tags
Lorenz Brun's avatar
Lorenz Brun committed
27
  stage: build
Timon Stampfli's avatar
Timon Stampfli committed
28
  image: node:12
Lorenz Brun's avatar
Lorenz Brun committed
29
  script:
30
    - node ./setversion $CI_COMMIT_TAG
Timon Stampfli's avatar
Timon Stampfli committed
31
    - npm ci
Lorenz Brun's avatar
Lorenz Brun committed
32
    - npm run build-package
Lorenz Brun's avatar
Lorenz Brun committed
33 34
  dependencies:
    - build-helper
Lorenz Brun's avatar
Lorenz Brun committed
35 36 37
  artifacts:
    untracked: false
    paths:
38
      - soicode-$CI_COMMIT_TAG.vsix
Lorenz Brun's avatar
Lorenz Brun committed
39 40
    expire_in: 30 days

Timon Stampfli's avatar
Timon Stampfli committed
41 42 43 44 45 46
publish:
  only:
    - tags
  stage: publish
  image: node:10
  script:
47
    - npx vsce publish -p $PUBLISHING_TOKEN --packagePath soicode-$CI_COMMIT_TAG.vsix
Timon Stampfli's avatar
Timon Stampfli committed
48
  dependencies:
49
    - build-release
Timon Stampfli's avatar
Timon Stampfli committed
50

Lorenz Brun's avatar
Lorenz Brun committed
51
build-helper:
Lorenz Brun's avatar
Lorenz Brun committed
52
  stage: build-deps
Timon Stampfli's avatar
Timon Stampfli committed
53
  image: golang:1.13
Lorenz Brun's avatar
Lorenz Brun committed
54
  variables:
Lorenz Brun's avatar
Lorenz Brun committed
55
    GO111MODULE: "on"
Lorenz Brun's avatar
Lorenz Brun committed
56
  script:
Timon Stampfli's avatar
Timon Stampfli committed
57 58 59
    - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ./dist/helper-linux-amd64 ./helper
    - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ./dist/helper-windows-amd64.exe ./helper
    - CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ./dist/helper-darwin-amd64 ./helper
Lorenz Brun's avatar
Lorenz Brun committed
60 61 62
  artifacts:
    untracked: false
    paths:
Timon Stampfli's avatar
Timon Stampfli committed
63
      - dist/helper*
Lorenz Brun's avatar
Lorenz Brun committed
64
    expire_in: 1 day