-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
107 lines (98 loc) · 2.49 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
107 lines (98 loc) · 2.49 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
stages:
- test
- build
- release
variables:
NODE_VERSION: "24-alpine"
NPM_CONFIG_CACHE: "${CI_PROJECT_DIR}/.npm"
GITHUB_OWNER: "Evgene-Kopylov"
GITHUB_REPO: "linux-image-rendering-fix"
cache:
key: "${CI_COMMIT_REF_SLUG}"
paths:
- node_modules/
- .npm/
policy: pull-push
.rules: &rules
rules:
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
unit-tests:
stage: test
<<: *rules
image: node:${NODE_VERSION}
before_script:
- node --version
- npm --version
script:
- npm ci --prefer-offline
- npm test
timeout: 10m
typescript-check:
stage: test
image: node:${NODE_VERSION}
script:
- npm ci --prefer-offline
- npx tsc --noEmit --skipLibCheck
<<: *rules
timeout: 10m
eslint-check:
stage: test
image: node:${NODE_VERSION}
script:
- npm ci --prefer-offline
- npm run lint
<<: *rules
timeout: 10m
plugin-build:
stage: build
image: node:${NODE_VERSION}
<<: *rules
script:
- npm ci --prefer-offline
- npm run build
artifacts:
paths:
- main.js
- manifest.json
expire_in: 1 hour
timeout: 10m
release_to_github:
stage: release
image: alpine:latest
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
variables:
GIT_DEPTH: 0
needs:
- plugin-build
before_script:
- apk update
- apk add --no-cache git curl jq file bash
script: |
git fetch --tags
LATEST_TAG=$(git tag --sort=-v:refname | head -n1)
echo "Последний тег: $LATEST_TAG"
export VERSION="$LATEST_TAG"
chmod +x scripts/release-to-github.sh
./scripts/release-to-github.sh
timeout: 10m
push_to_github:
stage: release
image: alpine:latest
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
needs:
- release_to_github
variables:
GIT_STRATEGY: clone
GIT_DEPTH: 0
REPO_OWNER: "${GITHUB_OWNER}"
REPO_NAME: "${GITHUB_REPO}"
before_script:
- apk update
- apk add --no-cache git curl jq zip
script:
- git remote add github "https://oauth2:${GITHUB_TOKEN}@github.com/${REPO_OWNER}/${REPO_NAME}"
- git push github HEAD:refs/heads/main --force
timeout: 10m