Skip to content

Commit 9ccb5ba

Browse files
committed
Add alpine build: WIP
1 parent 27245a7 commit 9ccb5ba

File tree

3 files changed

+133
-28
lines changed

3 files changed

+133
-28
lines changed

.semaphore/build-docker.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
apk add -U ca-certificates openssl ncurses coreutils python3 make gcc g++ libgcc linux-headers grep util-linux binutils findutils perl patch musl-dev bash
4+
cd /v
5+
npm install
6+
npx node-pre-gyp package

.semaphore/semaphore.yml

Lines changed: 126 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,46 +35,68 @@ global_job_config:
3535

3636

3737
blocks:
38-
- name: "Linux arm64: Build and test"
38+
- name: "Linux amd64 (musl): Build and test"
3939
dependencies: [ ]
4040
task:
4141
agent:
4242
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
43+
type: s1-prod-ubuntu20-04-amd64-2
5644
jobs:
57-
- name: 'Build from source and test'
45+
- name: "Build from source and test for musl"
5846
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
47+
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker.sh
6148

62-
- name: "Linux amd64: Build, test, lint"
49+
- name: "Linux arm64 (musl): Build and test"
6350
dependencies: [ ]
6451
task:
6552
agent:
6653
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.
54+
type: s1-prod-ubuntu20-04-arm64-1
7155
jobs:
72-
- name: "Test"
73-
commands:
74-
- make test
75-
- name: "ESLint"
56+
- name: "Build from source and test for musl"
7657
commands:
77-
- npx eslint lib/kafkajs
58+
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker.sh
59+
60+
# - name: "Linux arm64: Build and test"
61+
# dependencies: [ ]
62+
# task:
63+
# agent:
64+
# machine:
65+
# type: s1-prod-ubuntu20-04-arm64-1
66+
# jobs:
67+
# - name: "Build from source and test"
68+
# commands:
69+
# - 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.
70+
# - make test
71+
72+
# - name: 'macOS arm64/m1: Build and test'
73+
# dependencies: []
74+
# task:
75+
# agent:
76+
# machine:
77+
# type: s1-prod-macos-arm64
78+
# jobs:
79+
# - name: 'Build from source and test'
80+
# commands:
81+
# - 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.
82+
# - make test
83+
84+
# - name: "Linux amd64: Build, test, lint"
85+
# dependencies: [ ]
86+
# task:
87+
# agent:
88+
# machine:
89+
# type: s1-prod-ubuntu20-04-amd64-2
90+
# prologue:
91+
# commands:
92+
# - 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.
93+
# jobs:
94+
# - name: "Test"
95+
# commands:
96+
# - make test
97+
# - name: "ESLint"
98+
# commands:
99+
# - npx eslint lib/kafkajs
78100

79101

80102
- name: "Linux amd64: Release"
@@ -164,6 +186,83 @@ blocks:
164186
- npx node-pre-gyp package
165187
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
166188
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
189+
190+
- name: "Linux amd64 musl: Release"
191+
dependencies: [ ]
192+
run:
193+
when: "tag =~ '^v[0-9]\\.'"
194+
task:
195+
agent:
196+
machine:
197+
type: s1-prod-ubuntu20-04-amd64-1
198+
env_vars:
199+
- name: ARCHITECTURE
200+
value: "x64"
201+
- name: PLATFORM
202+
value: "linux"
203+
- name: LIBC
204+
value: "musl"
205+
jobs:
206+
- name: "Release: LTS:18"
207+
commands:
208+
- export NODE_ABI=108
209+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-linux-${LIBC}-${ARCHITECTURE}.tar.gz"
210+
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker.sh
211+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
212+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
213+
- name: "Release: LTS:20"
214+
commands:
215+
- export NODE_ABI=115
216+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-linux-${LIBC}-${ARCHITECTURE}.tar.gz"
217+
- docker run -v "$(pwd):/v" node:20-alpine /v/.semaphore/build-docker.sh
218+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
219+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
220+
- name: "Release: latest: 21"
221+
commands:
222+
- export NODE_ABI=120
223+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-linux-${LIBC}-${ARCHITECTURE}.tar.gz"
224+
- docker run -v "$(pwd):/v" node:21-alpine /v/.semaphore/build-docker.sh
225+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
226+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
227+
228+
- name: "Linux arm64 musl: Release"
229+
dependencies: [ ]
230+
run:
231+
when: "tag =~ '^v[0-9]\\.'"
232+
task:
233+
agent:
234+
machine:
235+
type: s1-prod-ubuntu20-04-arm64-1
236+
env_vars:
237+
- name: ARCHITECTURE
238+
value: "arm64"
239+
- name: PLATFORM
240+
value: "linux"
241+
- name: LIBC
242+
value: "musl"
243+
jobs:
244+
- name: "Release: LTS:18"
245+
commands:
246+
- export NODE_ABI=108
247+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-linux-${LIBC}-${ARCHITECTURE}.tar.gz"
248+
- docker run -v "$(pwd):/v" node:18-alpine /v/.semaphore/build-docker.sh
249+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
250+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
251+
- name: "Release: LTS:20"
252+
commands:
253+
- export NODE_ABI=115
254+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-linux-${LIBC}-${ARCHITECTURE}.tar.gz"
255+
- docker run -v "$(pwd):/v" node:20-alpine /v/.semaphore/build-docker.sh
256+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
257+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
258+
- name: "Release: latest: 21"
259+
commands:
260+
- export NODE_ABI=120
261+
- export ARTIFACT_KEY="confluent-kafka-js-${SEMAPHORE_GIT_TAG_NAME}-node-v${NODE_ABI}-linux-${LIBC}-${ARCHITECTURE}.tar.gz"
262+
- docker run -v "$(pwd):/v" node:21-alpine /v/.semaphore/build-docker.sh
263+
- ls build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}
264+
- artifact push project "build/stage/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}" --destination "releases/${SEMAPHORE_GIT_TAG_NAME}/${ARTIFACT_KEY}"
265+
167266
- name: "macOS arm64/m1: Release"
168267
dependencies: [ ]
169268
run:

deps/librdkafka

0 commit comments

Comments
 (0)