Skip to content

Commit 4ebd357

Browse files
committed
Add windows package build
1 parent 3e36c0b commit 4ebd357

File tree

5 files changed

+77
-5
lines changed

5 files changed

+77
-5
lines changed

.semaphore/semaphore.yml

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ global_job_config:
2929
- cd deps/librdkafka
3030
- git fetch origin
3131
- cd ../../
32-
- export MKL_DEBUG=1
32+
- cache clear
3333

3434
blocks:
3535
- name: "Linux amd64 (musl): Build and test"
@@ -303,13 +303,84 @@ blocks:
303303
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
304304
- artifact push workflow "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
305305

306+
- name: "Windows x64: Release"
307+
dependencies: [ ]
308+
# run:
309+
# when: "tag =~ '^v[0-9]\\.'"
310+
task:
311+
agent:
312+
machine:
313+
type: s1-prod-windows
314+
env_vars:
315+
# Disable vcpkg telemetry
316+
- name: VCPKG_DISABLE_METRICS
317+
value: 'yes'
318+
- name: ARCHITECTURE
319+
value: "x64"
320+
- name: PLATFORM
321+
value: "win32"
322+
- name: LIBC
323+
value: "unknown"
324+
prologue:
325+
commands:
326+
- $env:InstalledMajor = (Get-Command node).Version.Major
327+
- $env:InstalledMinor = (Get-Command node).Version.Minor
328+
- $env:InstalledBuild = (Get-Command node).Version.Build
329+
- $env:InstalledVersion = "v${env:InstalledMajor}.${env:InstalledMinor}.${env:InstalledBuild}"
330+
- echo "https://nodejs.org/dist/${env:InstalledVersion}/node-${env:InstalledVersion}-x64.msi"
331+
- Invoke-WebRequest "https://nodejs.org/dist/${env:InstalledVersion}/node-${env:InstalledVersion}-x64.msi" -OutFile node_old.msi
332+
- msiexec /qn /l* node-old-log.txt /uninstall node_old.msi
333+
- cat .\node-old-log.txt
334+
jobs:
335+
- name: "Release: LTS:18"
336+
commands:
337+
- Invoke-WebRequest "https://nodejs.org/download/release/v18.19.0/node-v18.19.0-x64.msi" -OutFile node.msi
338+
- msiexec /qn /l* node-log.txt /i node.msi
339+
- cat .\node-log.txt
340+
- node --version
341+
- pip install setuptools
342+
- $env:NODE_ABI = 108
343+
- $env:ARTIFACT_KEY = "confluent-kafka-javascript-${env:SEMAPHORE_GIT_TAG_NAME}-node-v${env:NODE_ABI}-${env:PLATFORM}-${env:LIBC}-${env:ARCHITECTURE}.tar.gz"
344+
- echo "$env:ARTIFACT_KEY"
345+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
346+
- npx node-pre-gyp package
347+
- ls "build/stage/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}"
348+
- artifact push workflow "build/stage/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}" --destination "releases/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}"
349+
- name: "Release: LTS:20"
350+
commands:
351+
- Invoke-WebRequest "https://nodejs.org/dist/v20.11.0/node-v20.11.0-x64.msi" -OutFile node.msi
352+
- msiexec /qn /l* node-log.txt /i node.msi
353+
- node --version
354+
- pip install setuptools
355+
- $env:NODE_ABI = 115
356+
- $env:ARTIFACT_KEY = "confluent-kafka-javascript-${env:SEMAPHORE_GIT_TAG_NAME}-node-v${env:NODE_ABI}-${env:PLATFORM}-${env:LIBC}-${env:ARCHITECTURE}.tar.gz"
357+
- echo "$env:ARTIFACT_KEY"
358+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
359+
- npx node-pre-gyp package
360+
- ls "build/stage/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}"
361+
- artifact push workflow "build/stage/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}" --destination "releases/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}"
362+
- name: "Release: latest: 21"
363+
commands:
364+
- Invoke-WebRequest "https://nodejs.org/dist/v21.6.1/node-v21.6.1-x64.msi" -OutFile node.msi
365+
- msiexec /qn /l* node-log.txt /i node.msi
366+
- node --version
367+
- pip install setuptools
368+
- $env:NODE_ABI = 120
369+
- $env:ARTIFACT_KEY = "confluent-kafka-javascript-${env:SEMAPHORE_GIT_TAG_NAME}-node-v${env:NODE_ABI}-${env:PLATFORM}-${env:LIBC}-${env:ARCHITECTURE}.tar.gz"
370+
- echo "$env:ARTIFACT_KEY"
371+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
372+
- npx node-pre-gyp package
373+
- ls "build/stage/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}"
374+
- artifact push workflow "build/stage/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}" --destination "releases/${env:SEMAPHORE_GIT_TAG_NAME}/${env:ARTIFACT_KEY}"
375+
306376
- name: 'Packaging: tar all release artifacts'
307377
dependencies:
308378
- 'Linux amd64: Release'
309379
- 'Linux arm64: Release'
310380
- 'Linux amd64 musl: Release'
311381
- 'Linux arm64 musl: Release'
312382
- 'macOS arm64/m1: Release'
383+
- 'Windows x64: Release'
313384
run:
314385
when: "tag =~ '^v[0-9]\\.'"
315386
task:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ The following configurations are supported for this early access preview:
3434
Installation on any of these platforms is meant to be seamless, without any C/C++ compilation required. It can be installed from GitHub:
3535

3636
```bash
37-
$ npm install "git+ssh://[email protected]/confluentinc/confluent-kafka-javascript.git#v0.1.7-devel"
37+
$ npm install "git+ssh://[email protected]/confluentinc/confluent-kafka-javascript.git#v0.1.8-devel"
3838
```
3939

4040
Yarn and pnpm support is experimental.

deps/windows-install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import glob
66

77
with open('../package.json') as f:
8-
librdkafkaVersion = json.load(f)['librdkafka']
8+
librdkafkaVersion = json.load(f)['librdkafka_win']
99
librdkafkaWinSufix = '7' if librdkafkaVersion == '0.11.5' else '';
1010

1111
depsPrecompiledDir = '../deps/precompiled'

lib/client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var util = require('util');
1414
var Kafka = require('../librdkafka.js');
1515
var assert = require('assert');
1616

17-
const bindingVersion = 'v0.1.7-devel';
17+
const bindingVersion = 'v0.1.8-devel';
1818

1919
var LibrdKafkaError = require('./error');
2020

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "confluent-kafka-javascript",
3-
"version": "v0.1.7-devel",
3+
"version": "v0.1.8-devel",
44
"description": "Node.js bindings for librdkafka",
55
"librdkafka": "master",
6+
"librdkafka_win": "2.3.0",
67
"main": "lib/index.js",
78
"types": "types/index.d.ts",
89
"scripts": {

0 commit comments

Comments
 (0)