rdkafka 0.22.0.beta1-x86_64-linux-gnu

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. checksums.yaml +7 -0
  2. data/.github/CODEOWNERS +3 -0
  3. data/.github/FUNDING.yml +1 -0
  4. data/.github/workflows/ci_linux_x86_64_gnu.yml +249 -0
  5. data/.github/workflows/ci_linux_x86_64_musl.yml +205 -0
  6. data/.github/workflows/ci_macos_arm64.yml +306 -0
  7. data/.github/workflows/push_linux_x86_64_gnu.yml +64 -0
  8. data/.github/workflows/push_linux_x86_64_musl.yml +77 -0
  9. data/.github/workflows/push_macos_arm64.yml +54 -0
  10. data/.github/workflows/push_ruby.yml +37 -0
  11. data/.github/workflows/verify-action-pins.yml +16 -0
  12. data/.gitignore +14 -0
  13. data/.rspec +2 -0
  14. data/.ruby-gemset +1 -0
  15. data/.ruby-version +1 -0
  16. data/.yardopts +2 -0
  17. data/CHANGELOG.md +247 -0
  18. data/Gemfile +5 -0
  19. data/MIT-LICENSE +22 -0
  20. data/README.md +178 -0
  21. data/Rakefile +96 -0
  22. data/docker-compose.yml +25 -0
  23. data/ext/README.md +19 -0
  24. data/ext/Rakefile +131 -0
  25. data/ext/build_common.sh +361 -0
  26. data/ext/build_linux_x86_64_gnu.sh +306 -0
  27. data/ext/build_linux_x86_64_musl.sh +763 -0
  28. data/ext/build_macos_arm64.sh +550 -0
  29. data/ext/librdkafka.so +0 -0
  30. data/lib/rdkafka/abstract_handle.rb +116 -0
  31. data/lib/rdkafka/admin/acl_binding_result.rb +51 -0
  32. data/lib/rdkafka/admin/config_binding_result.rb +30 -0
  33. data/lib/rdkafka/admin/config_resource_binding_result.rb +18 -0
  34. data/lib/rdkafka/admin/create_acl_handle.rb +28 -0
  35. data/lib/rdkafka/admin/create_acl_report.rb +24 -0
  36. data/lib/rdkafka/admin/create_partitions_handle.rb +27 -0
  37. data/lib/rdkafka/admin/create_partitions_report.rb +6 -0
  38. data/lib/rdkafka/admin/create_topic_handle.rb +29 -0
  39. data/lib/rdkafka/admin/create_topic_report.rb +24 -0
  40. data/lib/rdkafka/admin/delete_acl_handle.rb +30 -0
  41. data/lib/rdkafka/admin/delete_acl_report.rb +23 -0
  42. data/lib/rdkafka/admin/delete_groups_handle.rb +28 -0
  43. data/lib/rdkafka/admin/delete_groups_report.rb +24 -0
  44. data/lib/rdkafka/admin/delete_topic_handle.rb +29 -0
  45. data/lib/rdkafka/admin/delete_topic_report.rb +24 -0
  46. data/lib/rdkafka/admin/describe_acl_handle.rb +30 -0
  47. data/lib/rdkafka/admin/describe_acl_report.rb +24 -0
  48. data/lib/rdkafka/admin/describe_configs_handle.rb +33 -0
  49. data/lib/rdkafka/admin/describe_configs_report.rb +54 -0
  50. data/lib/rdkafka/admin/incremental_alter_configs_handle.rb +33 -0
  51. data/lib/rdkafka/admin/incremental_alter_configs_report.rb +54 -0
  52. data/lib/rdkafka/admin.rb +833 -0
  53. data/lib/rdkafka/bindings.rb +566 -0
  54. data/lib/rdkafka/callbacks.rb +415 -0
  55. data/lib/rdkafka/config.rb +398 -0
  56. data/lib/rdkafka/consumer/headers.rb +79 -0
  57. data/lib/rdkafka/consumer/message.rb +86 -0
  58. data/lib/rdkafka/consumer/partition.rb +51 -0
  59. data/lib/rdkafka/consumer/topic_partition_list.rb +169 -0
  60. data/lib/rdkafka/consumer.rb +653 -0
  61. data/lib/rdkafka/error.rb +101 -0
  62. data/lib/rdkafka/helpers/oauth.rb +58 -0
  63. data/lib/rdkafka/helpers/time.rb +14 -0
  64. data/lib/rdkafka/metadata.rb +115 -0
  65. data/lib/rdkafka/native_kafka.rb +139 -0
  66. data/lib/rdkafka/producer/delivery_handle.rb +40 -0
  67. data/lib/rdkafka/producer/delivery_report.rb +46 -0
  68. data/lib/rdkafka/producer/partitions_count_cache.rb +216 -0
  69. data/lib/rdkafka/producer.rb +430 -0
  70. data/lib/rdkafka/version.rb +7 -0
  71. data/lib/rdkafka.rb +54 -0
  72. data/rdkafka.gemspec +65 -0
  73. data/renovate.json +92 -0
  74. data/spec/rdkafka/abstract_handle_spec.rb +117 -0
  75. data/spec/rdkafka/admin/create_acl_handle_spec.rb +56 -0
  76. data/spec/rdkafka/admin/create_acl_report_spec.rb +18 -0
  77. data/spec/rdkafka/admin/create_topic_handle_spec.rb +52 -0
  78. data/spec/rdkafka/admin/create_topic_report_spec.rb +16 -0
  79. data/spec/rdkafka/admin/delete_acl_handle_spec.rb +85 -0
  80. data/spec/rdkafka/admin/delete_acl_report_spec.rb +72 -0
  81. data/spec/rdkafka/admin/delete_topic_handle_spec.rb +52 -0
  82. data/spec/rdkafka/admin/delete_topic_report_spec.rb +16 -0
  83. data/spec/rdkafka/admin/describe_acl_handle_spec.rb +85 -0
  84. data/spec/rdkafka/admin/describe_acl_report_spec.rb +73 -0
  85. data/spec/rdkafka/admin_spec.rb +770 -0
  86. data/spec/rdkafka/bindings_spec.rb +223 -0
  87. data/spec/rdkafka/callbacks_spec.rb +20 -0
  88. data/spec/rdkafka/config_spec.rb +258 -0
  89. data/spec/rdkafka/consumer/headers_spec.rb +73 -0
  90. data/spec/rdkafka/consumer/message_spec.rb +139 -0
  91. data/spec/rdkafka/consumer/partition_spec.rb +57 -0
  92. data/spec/rdkafka/consumer/topic_partition_list_spec.rb +248 -0
  93. data/spec/rdkafka/consumer_spec.rb +1274 -0
  94. data/spec/rdkafka/error_spec.rb +89 -0
  95. data/spec/rdkafka/metadata_spec.rb +79 -0
  96. data/spec/rdkafka/native_kafka_spec.rb +130 -0
  97. data/spec/rdkafka/producer/delivery_handle_spec.rb +45 -0
  98. data/spec/rdkafka/producer/delivery_report_spec.rb +25 -0
  99. data/spec/rdkafka/producer/partitions_count_cache_spec.rb +359 -0
  100. data/spec/rdkafka/producer_spec.rb +1052 -0
  101. data/spec/spec_helper.rb +195 -0
  102. metadata +276 -0
@@ -0,0 +1,306 @@
1
+ name: CI macOS ARM64
2
+
3
+ concurrency:
4
+ group: ${{ github.workflow }}-${{ github.ref }}
5
+ cancel-in-progress: true
6
+
7
+ on:
8
+ pull_request:
9
+ branches: [ main, master ]
10
+ push:
11
+ branches: [ main, master ]
12
+ schedule:
13
+ - cron: '0 1 * * *'
14
+
15
+ permissions:
16
+ contents: read
17
+
18
+ env:
19
+ BUNDLE_RETRY: 6
20
+ BUNDLE_JOBS: 4
21
+ # Renovate can track and update this version
22
+ CONFLUENT_VERSION: "8.0.0"
23
+
24
+ jobs:
25
+ build_install:
26
+ timeout-minutes: 30
27
+ runs-on: macos-latest
28
+ steps:
29
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30
+ with:
31
+ fetch-depth: 0
32
+ - name: Install Bash 4+ and Kerberos
33
+ run: |
34
+ brew install bash
35
+ brew list krb5 &>/dev/null || brew install krb5
36
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
37
+ - name: Set up Ruby
38
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
39
+ with:
40
+ ruby-version: '3.4' # Use one Ruby version for building
41
+ bundler-cache: false
42
+ - name: Build gem with mini_portile
43
+ run: |
44
+ set -e
45
+ bundle install
46
+ cd ext && bundle exec rake
47
+ cd ..
48
+ - name: Upload built gem and bundle
49
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
50
+ with:
51
+ name: rdkafka-built-gem-macos
52
+ path: |
53
+ vendor/bundle/
54
+ .bundle/
55
+ ext/
56
+ lib/
57
+ retention-days: 1
58
+
59
+ specs_install:
60
+ timeout-minutes: 30
61
+ runs-on: macos-latest
62
+ needs: build_install
63
+ strategy:
64
+ fail-fast: false
65
+ matrix:
66
+ ruby:
67
+ - '3.5.0-preview1'
68
+ - '3.4'
69
+ - '3.3'
70
+ - '3.2'
71
+ - '3.1'
72
+ include:
73
+ - ruby: '3.4'
74
+ coverage: 'true'
75
+ steps:
76
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
77
+ with:
78
+ fetch-depth: 0
79
+ - name: Download built gem
80
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
81
+ with:
82
+ name: rdkafka-built-gem-macos
83
+ path: ./
84
+ - name: Install Bash 4+ and Kerberos
85
+ run: |
86
+ brew install bash
87
+ brew list krb5 &>/dev/null || brew install krb5
88
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
89
+ - name: Set up Ruby
90
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
91
+ with:
92
+ ruby-version: ${{matrix.ruby}}
93
+ bundler-cache: false
94
+ - name: Install and Start Confluent Community Kafka (KRaft)
95
+ run: |
96
+ brew install openjdk@17
97
+ export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
98
+ export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
99
+
100
+ curl -O "https://packages.confluent.io/archive/8.0/confluent-community-${CONFLUENT_VERSION}.tar.gz"
101
+ tar -xzf "confluent-community-${CONFLUENT_VERSION}.tar.gz"
102
+
103
+ export CONFLUENT_HOME="$(pwd)/confluent-${CONFLUENT_VERSION}"
104
+ export PATH="$CONFLUENT_HOME/bin:$PATH"
105
+ cd "$CONFLUENT_HOME"
106
+
107
+ # Find the correct server config
108
+ KRAFT_CONFIG=""
109
+ for config in "etc/kafka/kraft/server.properties" "config/kraft/server.properties" "etc/kafka/server.properties"; do
110
+ if [ -f "$config" ]; then
111
+ KRAFT_CONFIG="$config"
112
+ echo "Found config: $KRAFT_CONFIG"
113
+ break
114
+ fi
115
+ done
116
+
117
+ if [ -z "$KRAFT_CONFIG" ]; then
118
+ echo "❌ No server config found"
119
+ exit 1
120
+ fi
121
+
122
+ # Configure KRaft for single-node setup
123
+ cat >> "$KRAFT_CONFIG" << 'EOF'
124
+
125
+ # KRaft mode configuration for single-node setup
126
+ process.roles=broker,controller
127
+ node.id=1
128
+ controller.quorum.voters=1@127.0.0.1:9093
129
+ listeners=PLAINTEXT://127.0.0.1:9092,CONTROLLER://127.0.0.1:9093
130
+ controller.listener.names=CONTROLLER
131
+ inter.broker.listener.name=PLAINTEXT
132
+ log.dirs=/tmp/kraft-combined-logs
133
+
134
+ # Enable simple ACL authorization for testing
135
+ authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
136
+ super.users=User:ANONYMOUS
137
+ allow.everyone.if.no.acl.found=true
138
+ EOF
139
+
140
+ echo "Updated KRaft configuration"
141
+
142
+ CLUSTER_ID=$(bin/kafka-storage random-uuid)
143
+ bin/kafka-storage format -t "$CLUSTER_ID" -c "$KRAFT_CONFIG"
144
+ bin/kafka-server-start "$KRAFT_CONFIG" &
145
+
146
+ sleep 20
147
+
148
+ for i in {1..30}; do
149
+ if bin/kafka-topics --bootstrap-server 127.0.0.1:9092 --list >/dev/null 2>&1; then
150
+ echo "✅ Confluent Community ${CONFLUENT_VERSION} (KRaft) is ready!"
151
+ break
152
+ fi
153
+ [ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
154
+ sleep 2
155
+ done
156
+ - name: Install remaining dependencies
157
+ env:
158
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
159
+ run: |
160
+ # Only install gems that aren't Ruby-version specific
161
+ bundle install
162
+ - name: Run all specs
163
+ env:
164
+ GITHUB_COVERAGE: ${{matrix.coverage}}
165
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
166
+ run: |
167
+ bundle exec rspec
168
+
169
+ build_precompiled:
170
+ timeout-minutes: 45
171
+ runs-on: macos-latest
172
+ steps:
173
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
174
+ with:
175
+ fetch-depth: 0
176
+ - name: Install Bash 4+ and Kerberos
177
+ run: |
178
+ brew install bash
179
+ brew list krb5 &>/dev/null || brew install krb5
180
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
181
+ - name: Cache build-tmp directory
182
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
183
+ with:
184
+ path: ext/build-tmp-macos
185
+ key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
186
+ - name: Build precompiled librdkafka for macOS ARM64
187
+ run: |
188
+ cd ext
189
+ /opt/homebrew/bin/bash ./build_macos_arm64.sh
190
+ - name: Upload precompiled library
191
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
192
+ with:
193
+ name: librdkafka-precompiled-macos
194
+ path: ext/
195
+ retention-days: 1
196
+
197
+ specs_precompiled:
198
+ timeout-minutes: 30
199
+ runs-on: macos-latest
200
+ needs: build_precompiled
201
+ strategy:
202
+ fail-fast: false
203
+ matrix:
204
+ ruby:
205
+ - '3.5.0-preview1'
206
+ - '3.4'
207
+ - '3.3'
208
+ - '3.2'
209
+ - '3.1'
210
+ include:
211
+ - ruby: '3.4'
212
+ coverage: 'true'
213
+ steps:
214
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
215
+ with:
216
+ fetch-depth: 0
217
+ - name: Download precompiled library
218
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
219
+ with:
220
+ name: librdkafka-precompiled-macos
221
+ path: ext/
222
+ - name: Set up Ruby
223
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
224
+ with:
225
+ ruby-version: ${{ matrix.ruby }}
226
+ bundler-cache: false
227
+ - name: Install Bash 4+ and Kerberos
228
+ run: |
229
+ brew install bash
230
+ brew list krb5 &>/dev/null || brew install krb5
231
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
232
+ - name: Install and Start Confluent Community Kafka (KRaft)
233
+ run: |
234
+ brew install openjdk@17
235
+ export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
236
+ export JAVA_HOME="/opt/homebrew/opt/openjdk@17"
237
+
238
+ curl -O "https://packages.confluent.io/archive/8.0/confluent-community-${CONFLUENT_VERSION}.tar.gz"
239
+ tar -xzf "confluent-community-${CONFLUENT_VERSION}.tar.gz"
240
+
241
+ export CONFLUENT_HOME="$(pwd)/confluent-${CONFLUENT_VERSION}"
242
+ export PATH="$CONFLUENT_HOME/bin:$PATH"
243
+ cd "$CONFLUENT_HOME"
244
+
245
+ # Find the correct server config
246
+ KRAFT_CONFIG=""
247
+ for config in "etc/kafka/kraft/server.properties" "config/kraft/server.properties" "etc/kafka/server.properties"; do
248
+ if [ -f "$config" ]; then
249
+ KRAFT_CONFIG="$config"
250
+ echo "Found config: $KRAFT_CONFIG"
251
+ break
252
+ fi
253
+ done
254
+
255
+ if [ -z "$KRAFT_CONFIG" ]; then
256
+ echo "❌ No server config found"
257
+ exit 1
258
+ fi
259
+
260
+ # Configure KRaft for single-node setup
261
+ cat >> "$KRAFT_CONFIG" << 'EOF'
262
+
263
+ # KRaft mode configuration for single-node setup
264
+ process.roles=broker,controller
265
+ node.id=1
266
+ controller.quorum.voters=1@127.0.0.1:9093
267
+ listeners=PLAINTEXT://127.0.0.1:9092,CONTROLLER://127.0.0.1:9093
268
+ controller.listener.names=CONTROLLER
269
+ inter.broker.listener.name=PLAINTEXT
270
+ log.dirs=/tmp/kraft-combined-logs
271
+
272
+ # Enable simple ACL authorization for testing
273
+ authorizer.class.name=org.apache.kafka.metadata.authorizer.StandardAuthorizer
274
+ super.users=User:ANONYMOUS
275
+ allow.everyone.if.no.acl.found=true
276
+ EOF
277
+
278
+ echo "Updated KRaft configuration"
279
+
280
+ CLUSTER_ID=$(bin/kafka-storage random-uuid)
281
+ bin/kafka-storage format -t "$CLUSTER_ID" -c "$KRAFT_CONFIG"
282
+ bin/kafka-server-start "$KRAFT_CONFIG" &
283
+
284
+ sleep 20
285
+
286
+ for i in {1..30}; do
287
+ if bin/kafka-topics --bootstrap-server 127.0.0.1:9092 --list >/dev/null 2>&1; then
288
+ echo "✅ Confluent Community ${CONFLUENT_VERSION} (KRaft) is ready!"
289
+ break
290
+ fi
291
+ [ $i -eq 30 ] && { echo "❌ Kafka failed to start"; exit 1; }
292
+ sleep 2
293
+ done
294
+ - name: Install bundle with precompiled library
295
+ env:
296
+ GITHUB_COVERAGE: ${{ matrix.coverage }}
297
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
298
+ run: |
299
+ bundle install
300
+ echo "Bundle install completed with precompiled library"
301
+ - name: Run specs with precompiled library
302
+ env:
303
+ GITHUB_COVERAGE: ${{ matrix.coverage }}
304
+ RDKAFKA_EXT_PATH: ${{ github.workspace }}/ext
305
+ run: |
306
+ bundle exec rspec
@@ -0,0 +1,64 @@
1
+ name: Push Linux x86_64 GNU Platform Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ env:
12
+ BUNDLE_RETRY: 6
13
+ BUNDLE_JOBS: 4
14
+
15
+ jobs:
16
+ push:
17
+ if: github.repository_owner == 'karafka'
18
+ timeout-minutes: 30
19
+ runs-on: ubuntu-latest
20
+ environment: deployment
21
+ permissions:
22
+ contents: write
23
+ id-token: write
24
+ steps:
25
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26
+ with:
27
+ fetch-depth: 0
28
+ - name: Install build dependencies
29
+ run: |
30
+ sudo apt-get update
31
+ sudo apt-get install -y --no-install-recommends \
32
+ build-essential \
33
+ gcc \
34
+ make \
35
+ patch \
36
+ tar \
37
+ wget \
38
+ ca-certificates \
39
+ libsasl2-dev \
40
+ libssl-dev \
41
+ zlib1g-dev \
42
+ libzstd-dev
43
+ - name: Cache build-tmp directory
44
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
45
+ with:
46
+ path: ext/build-tmp
47
+ key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh') }}
48
+ - name: Set up Ruby
49
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
50
+ with:
51
+ ruby-version: '3.4'
52
+ bundler-cache: false
53
+ - name: Build precompiled librdkafka.so
54
+ run: |
55
+ cd ext
56
+ ./build_linux_x86_64_gnu.sh
57
+ - name: Configure trusted publishing credentials
58
+ uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
59
+ - name: Build and push platform-specific gem
60
+ run: |
61
+ gem build *.gemspec
62
+ gem push *.gem
63
+ env:
64
+ RUBY_PLATFORM: 'x86_64-linux-gnu'
@@ -0,0 +1,77 @@
1
+ name: Push Linux x86_64 musl Platform Gem
2
+ on:
3
+ push:
4
+ tags:
5
+ - v*
6
+ permissions:
7
+ contents: read
8
+ env:
9
+ BUNDLE_RETRY: 6
10
+ BUNDLE_JOBS: 4
11
+ jobs:
12
+ build:
13
+ if: github.repository_owner == 'karafka'
14
+ timeout-minutes: 30
15
+ runs-on: ubuntu-latest
16
+ environment: deployment
17
+ container:
18
+ image: alpine:3.22@sha256:8a1f59ffb675680d47db6337b49d22281a139e9d709335b492be023728e11715
19
+ steps:
20
+ - name: Install dependencies
21
+ run: |
22
+ apk add --no-cache git curl ca-certificates build-base linux-headers \
23
+ pkgconf perl autoconf automake libtool bison flex file bash wget zstd-dev \
24
+ openssl-dev cyrus-sasl-dev cyrus-sasl cyrus-sasl-login \
25
+ cyrus-sasl-crammd5 cyrus-sasl-digestmd5 cyrus-sasl-gssapiv2 cyrus-sasl-scram \
26
+ krb5-libs openssl zlib zlib-dev zstd-libs
27
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28
+ with:
29
+ fetch-depth: 0
30
+ - name: Configure git safe directory
31
+ run: git config --global --add safe.directory /__w/karafka-rdkafka/karafka-rdkafka
32
+ - name: Cache build-tmp directory
33
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
34
+ with:
35
+ path: ext/build-tmp-musl
36
+ key: build-tmp-musl-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
37
+ - name: Build precompiled librdkafka.so
38
+ run: |
39
+ cd ext
40
+ bash ./build_linux_x86_64_musl.sh
41
+ - name: Upload precompiled library
42
+ uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
43
+ with:
44
+ name: librdkafka-precompiled-musl
45
+ path: ext/
46
+ retention-days: 1
47
+ push:
48
+ if: github.repository_owner == 'karafka'
49
+ timeout-minutes: 30
50
+ runs-on: ubuntu-latest
51
+ needs: build
52
+ environment: deployment
53
+ permissions:
54
+ contents: write
55
+ id-token: write
56
+ steps:
57
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58
+ with:
59
+ fetch-depth: 0
60
+ - name: Download precompiled library
61
+ uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
62
+ with:
63
+ name: librdkafka-precompiled-musl
64
+ path: ext/
65
+ - name: Set up Ruby
66
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
67
+ with:
68
+ ruby-version: '3.4'
69
+ bundler-cache: false
70
+ - name: Configure trusted publishing credentials
71
+ uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
72
+ - name: Build and push platform-specific gem
73
+ run: |
74
+ gem build *.gemspec
75
+ gem push *.gem
76
+ env:
77
+ RUBY_PLATFORM: 'x86_64-linux-musl'
@@ -0,0 +1,54 @@
1
+ name: Push macOS ARM64 Platform Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ env:
12
+ BUNDLE_RETRY: 6
13
+ BUNDLE_JOBS: 4
14
+
15
+ jobs:
16
+ push:
17
+ if: github.repository_owner == 'karafka'
18
+ timeout-minutes: 30
19
+ runs-on: macos-latest
20
+ environment: deployment
21
+ permissions:
22
+ contents: write
23
+ id-token: write
24
+ steps:
25
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
26
+ with:
27
+ fetch-depth: 0
28
+ - name: Install Bash 4+ and Kerberos
29
+ run: |
30
+ brew install bash
31
+ brew list krb5 &>/dev/null || brew install krb5
32
+ echo "/opt/homebrew/bin" >> $GITHUB_PATH
33
+ - name: Cache build-tmp directory
34
+ uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
35
+ with:
36
+ path: ext/build-tmp-macos
37
+ key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
38
+ - name: Set up Ruby
39
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
40
+ with:
41
+ ruby-version: '3.4'
42
+ bundler-cache: false
43
+ - name: Build precompiled librdkafka for macOS ARM64
44
+ run: |
45
+ cd ext
46
+ /opt/homebrew/bin/bash ./build_macos_arm64.sh
47
+ - name: Configure trusted publishing credentials
48
+ uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
49
+ - name: Build and push platform-specific gem
50
+ run: |
51
+ gem build *.gemspec
52
+ gem push *.gem
53
+ env:
54
+ RUBY_PLATFORM: 'arm64-darwin'
@@ -0,0 +1,37 @@
1
+ name: Push Ruby Platform Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository_owner == 'karafka'
14
+ runs-on: ubuntu-latest
15
+ environment: deployment
16
+
17
+ permissions:
18
+ contents: write
19
+ id-token: write
20
+
21
+ steps:
22
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
28
+ with:
29
+ bundler-cache: false
30
+
31
+ - name: Build rdkafka-ruby
32
+ run: |
33
+ set -e
34
+ bundle install
35
+ cd ext && bundle exec rake
36
+
37
+ - uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
@@ -0,0 +1,16 @@
1
+ name: Verify Action Pins
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - '.github/workflows/**'
6
+ jobs:
7
+ verify:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
11
+ - name: Check SHA pins
12
+ run: |
13
+ if grep -E -r "uses: .*/.*@(v[0-9]+|main|master)($|[[:space:]]|$)" --include="*.yml" --include="*.yaml" .github/workflows/ | grep -v "#"; then
14
+ echo "::error::Actions should use SHA pins, not tags or branch names"
15
+ exit 1
16
+ fi
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ # Ignore bundler config.
2
+ /.bundle
3
+
4
+ Gemfile.lock
5
+ ext/ports
6
+ ext/tmp
7
+ ext/librdkafka.*
8
+ *.gem
9
+ .yardoc
10
+ doc
11
+ coverage
12
+ vendor
13
+ .idea/
14
+ out/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --require spec_helper
2
+ --format documentation
data/.ruby-gemset ADDED
@@ -0,0 +1 @@
1
+ rdkafka-ruby
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.4
data/.yardopts ADDED
@@ -0,0 +1,2 @@
1
+ --no-private
2
+ --markup=markdown