Skip to content

Commit

Permalink
Moved gem build script into release_drafter workflow (#194)
Browse files Browse the repository at this point in the history
* Moved `gem build` script into release_drafter workflow

Signed-off-by: Theo Truong <[email protected]>

* Changed signing condition avoid confusion

Signed-off-by: Theo Truong <[email protected]>

---------

Signed-off-by: Theo Truong <[email protected]>
  • Loading branch information
nhtruong authored Sep 6, 2023
1 parent 912bea8 commit 5b6ed6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
18 changes: 0 additions & 18 deletions .github/build_gem.sh

This file was deleted.

5 changes: 4 additions & 1 deletion .github/workflows/release_drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ jobs:
run: |
aws secretsmanager get-secret-value --secret-id jenkins-opensearchproject-rubygems-private-key --query SecretString --output text > gem-private_key.pem
- name: Build and package gem artifact
run: source .github/build_gem.sh
run: |
gem build opensearch-ruby.gemspec
mkdir dist && mv opensearch-ruby-*.gem dist/
tar -cvf artifacts.tar.gz dist
- name: Draft a release
uses: softprops/action-gh-release@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion opensearch-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ['--charset=UTF-8']

signing_key = File.expand_path('gem-private_key.pem')
if $PROGRAM_NAME.end_with?('gem') && ARGV == ['build', __FILE__] && File.exist?(signing_key)
if $PROGRAM_NAME.end_with?('gem') && ARGV.first == 'build' && File.exist?(signing_key)
s.signing_key = signing_key
s.cert_chain = ['.github/opensearch-rubygems.pem']
end
Expand Down

0 comments on commit 5b6ed6f

Please sign in to comment.