Files
droplet/.gitlab-ci.yml
2024-10-26 15:33:11 +11:00

58 lines
1.3 KiB
YAML

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}/rust:1.81.0-bookworm
dependencies:
- build-linux
script:
- 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