multi platform build

This commit is contained in:
DecDuck
2024-10-07 12:38:16 +11:00
parent adeaf3ace7
commit eff2a7f7f7
2 changed files with 36 additions and 5 deletions

View File

@ -2,16 +2,42 @@ stages:
- build
- publish
build:
linux-build:
stage: build
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/rust:1.81.0-bookworm
script:
- rustup toolchain install stable-x86_64-unknown-linux-gnu
- apt-get update -y
- apt-get install yarnpkg -y
- yarnpkg
- yarnpkg build
- yarnpkg build --target x86_64-unknown-linux-gnu
artifacts:
paths:
- index.js
- index.d.ts
- droplet.*.node
- droplet.*.node
windows-build:
stage: build
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/rust:1.81.0-bookworm
script:
- rustup toolchain install stable-x86_64-pc-windows-msvc
- apt-get update -y
- apt-get install yarnpkg -y
- yarnpkg
- yarnpkg build --target x86_64-pc-windows-msvc
artifacts:
paths:
- index.js
- index.d.ts
- droplet.*.node
publish:
stage: publish
dependencies:
- build
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:21
script:
- echo "@drop:registry=https://${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/" > .npmrc
- echo "//${CI_SERVER_HOST}/api/v4/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
- yarn publish

View File

@ -27,5 +27,10 @@
"universal": "napi universal",
"version": "napi version"
},
"packageManager": "yarn@4.5.0"
}
"packageManager": "yarn@4.5.0",
"optionalDependencies": {
"@drop/droplet-win32-x64-msvc": "0.0.0",
"@drop/droplet-darwin-x64": "0.0.0",
"@drop/droplet-linux-x64-gnu": "0.0.0"
}
}