-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
58 lines (54 loc) · 1.27 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
stages:
- build
- test
- publish
build-linux:
stage: build
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/rust:1.81.0-bookworm
script:
- apt-get update -y
- apt-get install yarnpkg -y
- yarnpkg
- yarnpkg build --target x86_64-unknown-linux-gnu
artifacts:
paths:
- index.js
- index.d.ts
- droplet.*.node
build-windows:
stage: build
tags:
- windows
script:
- yarn
- yarn build --target x86_64-pc-windows-msvc
artifacts:
paths:
- index.js
- index.d.ts
- droplet.*.node
# only test on Linux because Windows is a PIA
test-linux:
stage: test
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:lts-bookworm
dependencies:
- build-linux
script:
- yarn
- yarn test
publish:
stage: publish
rules:
- changes:
- package.json # only run if we update the version
dependencies:
- build-linux
- build-windows
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:21
script:
- echo "registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" > .npmrc
- npm config set "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken" ${CI_JOB_TOKEN}
- yarn
- yarn artifacts
- ls -R ./npm
- npm publish