-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
69 lines (62 loc) · 1.93 KB
/
.gitlab-ci.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
69
image: node:20
stages:
- build
- deploy
- publish
variables:
GITLAB_PACKAGE_REGISTRY: "registry.gitlab.com"
GITLAB_PROJECT_PATH: "@backlogic/UI/service-builder-vscode" # Replace with your actual GitLab project path
GITHUB_ACCESS_TOKEN: "$GITHUB_ACCESS_TOKEN"
VSCE_PERSONAL_ACCESS_TOKEN: "$VSCE_PERSONAL_ACCESS_TOKEN"
.pipeline_rules:
rules:
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
build:
extends:
- .pipeline_rules
stage: build
before_script:
- apt-get update -qy
# - apt-get install -y nodejs npm jq
- apt-get install -y jq
- npm install -g @vscode/vsce
- npm install -g typescript
- npm i --save-dev @types/node
- npm i --save-dev @types/mocha
- export VSCE_EXTENSION_NAME=$(cat package.json | jq -r .name)
- export VSCE_EXTENSION_VERSION=$(cat package.json | jq -r .version)
- export VSCE_PACKAGE_NAME=$VSCE_EXTENSION_NAME-v$VSCE_EXTENSION_VERSION.vsix
- echo "VSCE_PACKAGE_NAME=$VSCE_PACKAGE_NAME" >> build.env
- tsc
script:
- npm install
- vsce package -o ./$VSCE_PACKAGE_NAME
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file $VSCE_PACKAGE_NAME "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/service-builder-vscode/$VSCE_EXTENSION_VERSION/$VSCE_PACKAGE_NAME"'
artifacts:
reports:
dotenv: build.env
publish-to-github:
extends:
- .pipeline_rules
stage: publish
before_script:
- git --version
- git status
script:
- git push -u https://bklogic:[email protected]/bklogic/ServiceBuilder.git HEAD:main
# when: manual
publish-to-marketplace:
extends:
- .pipeline_rules
stage: publish
before_script:
- npm install -g @vscode/vsce
- npm install -g typescript
- npm i --save-dev @types/node
- npm i --save-dev @types/mocha
- tsc
script:
- npm install
- vsce publish -p $VSCE_PERSONAL_ACCESS_TOKEN
when: manual