Skip to content

Commit 256cea7

Browse files
committed
Everything, all at once
1 parent af6e124 commit 256cea7

File tree

5 files changed

+176
-62
lines changed

5 files changed

+176
-62
lines changed

.semaphore/semaphore.yml

Lines changed: 165 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,58 @@ global_job_config:
2525
prologue:
2626
commands:
2727
- checkout
28+
- git submodule update --init --recursive
29+
- cd deps/librdkafka
30+
- git fetch origin
31+
- git checkout dev_libdir_fix_for_zstd_zlib
32+
- cd ../../
33+
- export MKL_DEBUG=1
34+
2835

29-
# blocks:
30-
# - name: "Linux amd64: Build and test"
31-
# dependencies: [ ]
32-
# task:
33-
# agent:
34-
# machine:
35-
# type: s1-prod-ubuntu20-04-amd64-2
36-
# prologue:
37-
# commands:
38-
# - sem-version node 18.19.0
39-
# - node --version
40-
# - npm --version
41-
# - npx --version
42-
# - sudo apt-get update -q
43-
# - git submodule update --init --recursive
44-
# - sudo apt install -y libcurl4-openssl-dev libcrypto++-dev libssl-dev libzstd-dev
45-
# - npm install # this will actually not build anything if we have a release, but rather, fetch things using node-pre-gyp - so change this later.
46-
# jobs:
47-
# - name: "Test"
48-
# commands:
49-
# - make test
50-
# - name: "ESLint"
51-
# commands:
52-
# - npx eslint lib/kafkajs
5336

5437
blocks:
38+
- name: "Linux arm64: Build and test"
39+
dependencies: [ ]
40+
task:
41+
agent:
42+
machine:
43+
type: s1-prod-ubuntu20-04-arm64-1
44+
jobs:
45+
- name: "Build from source and test"
46+
commands:
47+
- npm install # this will actually not build anything if we have a release, but rather, fetch things using node-pre-gyp - so change this later.
48+
- make test
49+
50+
- name: 'macOS arm64/m1: Build and test'
51+
dependencies: []
52+
task:
53+
agent:
54+
machine:
55+
type: s1-prod-macos-arm64
56+
jobs:
57+
- name: 'Build from source and test'
58+
commands:
59+
- npm install # this will actually not build anything if we have a release, but rather, fetch things using node-pre-gyp - so change this later.
60+
- make test
61+
62+
- name: "Linux amd64: Build, test, lint"
63+
dependencies: [ ]
64+
task:
65+
agent:
66+
machine:
67+
type: s1-prod-ubuntu20-04-amd64-2
68+
prologue:
69+
commands:
70+
- npm install # this will actually not build anything if we have a release, but rather, fetch things using node-pre-gyp - so change this later.
71+
jobs:
72+
- name: "Test"
73+
commands:
74+
- make test
75+
- name: "ESLint"
76+
commands:
77+
- npx eslint lib/kafkajs
78+
79+
5580
- name: "Linux amd64: Release"
5681
dependencies: [ ]
5782
run:
@@ -60,41 +85,125 @@ blocks:
6085
agent:
6186
machine:
6287
type: s1-prod-ubuntu20-04-amd64-2
63-
prologue:
64-
commands:
65-
- sem-version node 18.19.0
66-
- node --version
67-
- npm --version
68-
- npx --version
69-
- sudo apt-get update -q
70-
- git submodule update --init --recursive
71-
- sudo apt install -y libcurl4-openssl-dev libcrypto++-dev libssl-dev libzstd-dev
88+
env_vars:
89+
- name: ARCHITECTURE
90+
value: "x64"
91+
- name: PLATFORM
92+
value: "linux"
93+
- name: LIBC
94+
value: "glibc"
7295
jobs:
73-
- name: "Release"
96+
- name: "Release: LTS:18"
7497
commands:
75-
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v108-linux-x64.tar.gz"
98+
- sem-version node 18.19.0
99+
- export NODE_ABI=108
100+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
76101
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
77102
- npx node-pre-gyp package
78103
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
79-
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${ARTIFACT_KEY}"
80-
81-
# - name: 'OSX arm64/m1'
82-
# dependencies: []
83-
# task:
84-
# agent:
85-
# machine:
86-
# type: s1-prod-macos-arm64
87-
# prologue:
88-
# commands:
89-
# - sem-version node 18.19.0
90-
# - node --version
91-
# - npm --version
92-
# - npx --version
93-
# - git submodule update --init --recursive
94-
# jobs:
95-
# - name: 'Build from source and test'
96-
# commands:
97-
# - npm install # this will actually not build anything if we have a release, but rather, fetch things using node-pre-gyp - so change this later.
98-
# - make test
99-
104+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
105+
- name: "Release: LTS:20"
106+
commands:
107+
- sem-version node 20.10.0
108+
- export NODE_ABI=115
109+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
110+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
111+
- npx node-pre-gyp package
112+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
113+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
114+
- name: "Release: latest: 21"
115+
commands:
116+
- sem-version node 21.4.0
117+
- export NODE_ABI=120
118+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
119+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
120+
- npx node-pre-gyp package
121+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
122+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
100123

124+
- name: "Linux arm64: Release"
125+
dependencies: [ ]
126+
run:
127+
when: "tag =~ '^v[0-9]\\.'"
128+
task:
129+
agent:
130+
machine:
131+
type: s1-prod-ubuntu20-04-arm64-1
132+
env_vars:
133+
- name: ARCHITECTURE
134+
value: "arm64"
135+
- name: PLATFORM
136+
value: "linux"
137+
- name: LIBC
138+
value: "glibc"
139+
jobs:
140+
- name: "Release: LTS:18"
141+
commands:
142+
- sem-version node 18.19.0
143+
- export NODE_ABI=108
144+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
145+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
146+
- npx node-pre-gyp package
147+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
148+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
149+
- name: "Release: LTS:20"
150+
commands:
151+
- sem-version node 20.10.0
152+
- export NODE_ABI=115
153+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
154+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
155+
- npx node-pre-gyp package
156+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
157+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
158+
- name: "Release: latest: 21"
159+
commands:
160+
- sem-version node 21.4.0
161+
- export NODE_ABI=120
162+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
163+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
164+
- npx node-pre-gyp package
165+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
166+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
167+
- name: "macOS arm64/m1: Release"
168+
dependencies: [ ]
169+
run:
170+
when: "tag =~ '^v[0-9]\\.'"
171+
task:
172+
agent:
173+
machine:
174+
type: s1-prod-macos-arm64
175+
env_vars:
176+
- name: ARCHITECTURE
177+
value: "arm64"
178+
- name: PLATFORM
179+
value: "darwin"
180+
- name: LIBC
181+
value: "unknown"
182+
jobs:
183+
- name: "Release: LTS:18"
184+
commands:
185+
- sem-version node 18.19.0
186+
- export NODE_ABI=108
187+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
188+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
189+
- npx node-pre-gyp package
190+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
191+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
192+
- name: "Release: LTS:20"
193+
commands:
194+
- sem-version node 20.10.0
195+
- export NODE_ABI=115
196+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
197+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
198+
- npx node-pre-gyp package
199+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
200+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
201+
- name: "Release: latest: 21"
202+
commands:
203+
- sem-version node 21.4.0
204+
- export NODE_ABI=120
205+
- export ARTIFACT_KEY="node-librdkafka-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-${PLATFORM}-${LIBC}-${ARCHITECTURE}.tar.gz"
206+
- npm install # node-pre-gyp will fallback to build here, because new tag implies no release yet.
207+
- npx node-pre-gyp package
208+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
209+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"

deps/librdkafka

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "confluent-kafka-js",
3-
"version": "v0.1.0-devel",
3+
"version": "v0.1.2-devel",
44
"description": "Node.js bindings for librdkafka",
55
"librdkafka": "2.3.0",
66
"main": "lib/index.js",
@@ -16,7 +16,7 @@
1616
"binary": {
1717
"module_name": "node-librdkafka",
1818
"module_path": "./build/{configuration}/",
19-
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz",
19+
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz",
2020
"host": "https://github.com/confluentinc/confluent-kafka-js/releases/download/",
2121
"remote_path": "v{version}"
2222
},

util/configure.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ var path = require('path');
77

88
var baseDir = path.resolve(__dirname, '../');
99
var releaseDir = path.join(baseDir, 'build', 'deps');
10+
// var command = './configure --install-deps --source-deps-only --disable-lz4-ext --enable-static --enable-strip --disable-gssapi';
11+
// if (!process.env.IS_ON_CI) {
12+
var command = './configure --install-deps --source-deps-only --disable-lz4-ext --enable-static --enable-strip --disable-gssapi --prefix=' + releaseDir + ' --libdir=' + releaseDir;
13+
// }
1014

1115
var isWin = /^win/.test(process.platform);
1216

@@ -19,7 +23,8 @@ if (isWin) {
1923
var childProcess = require('child_process');
2024

2125
try {
22-
childProcess.execSync('./configure --install-deps --source-deps-only --disable-lz4-ext --enable-static --enable-strip --disable-gssapi --prefix=' + releaseDir + ' --libdir=' + releaseDir, {
26+
process.stderr.write("Running: " + command + 'on working directory = ' + baseDir + '\n');
27+
childProcess.execSync(command, {
2328
cwd: baseDir,
2429
stdio: [0,1,2]
2530
});

0 commit comments

Comments
 (0)