Skip to content

Commit 82e63b6

Browse files
authored
fix precompiled releases attestation (#702)
1 parent d076e01 commit 82e63b6

File tree

5 files changed

+72
-12
lines changed

5 files changed

+72
-12
lines changed

.github/workflows/push_linux_aarch64_gnu.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ jobs:
2626
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727
with:
2828
fetch-depth: 0
29+
30+
# Vendor the attestation patch from rubygems/release-gem (no action execution)
31+
- name: Vendor release-gem patch
32+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33+
with:
34+
repository: rubygems/release-gem
35+
ref: a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
36+
path: .github/_release-gem
2937
- name: Install build dependencies
3038
run: |
3139
sudo apt-get update
@@ -41,25 +49,32 @@ jobs:
4149
libssl-dev \
4250
zlib1g-dev \
4351
libzstd-dev
52+
4453
- name: Cache build-tmp directory
4554
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
4655
with:
4756
path: ext/build-tmp
4857
key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh') }}
58+
4959
- name: Set up Ruby
5060
uses: ruby/setup-ruby@3fee6763234110473bd57dd4595c5199fce2c510 # v1.258.0
5161
with:
5262
ruby-version: '3.4'
5363
bundler-cache: false
64+
5465
- name: Build precompiled librdkafka.so
5566
run: |
5667
cd ext
5768
./build_linux_aarch64_gnu.sh
69+
5870
- name: Configure trusted publishing credentials
5971
uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
60-
- name: Build and push platform-specific gem
72+
73+
- name: Build and push platform-specific gem (with Sigstore attestation)
74+
env:
75+
RUBY_PLATFORM: 'aarch64-linux-gnu'
76+
# Preload the attestation patch so `gem push` generates & attaches the bundle
77+
RUBYOPT: "-r${{ github.workspace }}/.github/_release-gem/rubygems-attestation-patch.rb"
6178
run: |
6279
gem build *.gemspec
6380
gem push *.gem
64-
env:
65-
RUBY_PLATFORM: 'aarch64-linux-gnu'

.github/workflows/push_linux_x86_64_gnu.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ jobs:
2626
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2727
with:
2828
fetch-depth: 0
29+
30+
# Vendor the attestation patch from rubygems/release-gem (no action execution)
31+
- name: Vendor release-gem patch
32+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
33+
with:
34+
repository: rubygems/release-gem
35+
ref: a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
36+
path: .github/_release-gem
2937
- name: Install build dependencies
3038
run: |
3139
sudo apt-get update
@@ -41,25 +49,32 @@ jobs:
4149
libssl-dev \
4250
zlib1g-dev \
4351
libzstd-dev
52+
4453
- name: Cache build-tmp directory
4554
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
4655
with:
4756
path: ext/build-tmp
4857
key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh') }}
58+
4959
- name: Set up Ruby
5060
uses: ruby/setup-ruby@3fee6763234110473bd57dd4595c5199fce2c510 # v1.258.0
5161
with:
5262
ruby-version: '3.4'
5363
bundler-cache: false
64+
5465
- name: Build precompiled librdkafka.so
5566
run: |
5667
cd ext
5768
./build_linux_x86_64_gnu.sh
69+
5870
- name: Configure trusted publishing credentials
5971
uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
60-
- name: Build and push platform-specific gem
72+
73+
- name: Build and push platform-specific gem (with Sigstore attestation)
74+
env:
75+
RUBY_PLATFORM: 'x86_64-linux-gnu'
76+
# Preload the attestation patch so `gem push` generates & attaches the bundle
77+
RUBYOPT: "-r${{ github.workspace }}/.github/_release-gem/rubygems-attestation-patch.rb"
6178
run: |
6279
gem build *.gemspec
6380
gem push *.gem
64-
env:
65-
RUBY_PLATFORM: 'x86_64-linux-gnu'

.github/workflows/push_linux_x86_64_musl.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,21 +59,34 @@ jobs:
5959
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
6060
with:
6161
fetch-depth: 0
62+
63+
# Vendor the attestation patch from rubygems/release-gem (no action execution)
64+
- name: Vendor release-gem patch
65+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
66+
with:
67+
repository: rubygems/release-gem
68+
ref: a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
69+
path: .github/_release-gem
6270
- name: Download precompiled library
6371
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
6472
with:
6573
name: librdkafka-precompiled-musl
6674
path: ext/
75+
6776
- name: Set up Ruby
6877
uses: ruby/setup-ruby@3fee6763234110473bd57dd4595c5199fce2c510 # v1.258.0
6978
with:
7079
ruby-version: '3.4'
7180
bundler-cache: false
81+
7282
- name: Configure trusted publishing credentials
7383
uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
74-
- name: Build and push platform-specific gem
84+
85+
- name: Build and push platform-specific gem (with Sigstore attestation)
86+
env:
87+
RUBY_PLATFORM: 'x86_64-linux-musl'
88+
# Preload the attestation patch so `gem push` generates & attaches the bundle
89+
RUBYOPT: "-r${{ github.workspace }}/.github/_release-gem/rubygems-attestation-patch.rb"
7590
run: |
7691
gem build *.gemspec
7792
gem push *.gem
78-
env:
79-
RUBY_PLATFORM: 'x86_64-linux-musl'

.github/workflows/push_macos_arm64.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,46 @@ jobs:
2525
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626
with:
2727
fetch-depth: 0
28+
29+
# Vendor the attestation patch from rubygems/release-gem (no action execution)
30+
- name: Vendor release-gem patch
31+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
32+
with:
33+
repository: rubygems/release-gem
34+
ref: a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
35+
path: .github/_release-gem
36+
2837
- name: Install Bash 4+ and Kerberos
2938
run: |
3039
brew install bash
3140
brew list krb5 &>/dev/null || brew install krb5
3241
echo "/opt/homebrew/bin" >> $GITHUB_PATH
42+
3343
- name: Cache build-tmp directory
3444
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
3545
with:
3646
path: ext/build-tmp-macos
3747
key: build-tmp-${{ runner.os }}-${{ hashFiles('ext/*.sh', 'ext/Rakefile') }}-v2
48+
3849
- name: Set up Ruby
3950
uses: ruby/setup-ruby@3fee6763234110473bd57dd4595c5199fce2c510 # v1.258.0
4051
with:
4152
ruby-version: '3.4'
4253
bundler-cache: false
54+
4355
- name: Build precompiled librdkafka for macOS ARM64
4456
run: |
4557
cd ext
4658
/opt/homebrew/bin/bash ./build_macos_arm64.sh
59+
4760
- name: Configure trusted publishing credentials
4861
uses: rubygems/configure-rubygems-credentials@bc6dd217f8a4f919d6835fcfefd470ef821f5c44 # v1.0.0
49-
- name: Build and push platform-specific gem
62+
63+
- name: Build and push platform-specific gem (with Sigstore attestation)
64+
env:
65+
RUBY_PLATFORM: 'arm64-darwin'
66+
# Preload the attestation patch so `gem push` generates & attaches the bundle
67+
RUBYOPT: "-r${{ github.workspace }}/.github/_release-gem/rubygems-attestation-patch.rb"
5068
run: |
5169
gem build *.gemspec
5270
gem push *.gem
53-
env:
54-
RUBY_PLATFORM: 'arm64-darwin'

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Rdkafka Changelog
22

33
## 0.23.1 (Unreleased)
4+
- [Enhancement] Improve sigstore attestation for precompiled releases.
45
- [Fix] Fix incorrectly set default SSL certs dir.
56
- [Fix] Disable OpenSSL Heartbeats during compilation.
67

0 commit comments

Comments
 (0)