Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ bundle exec rake push_gem_to_github_package[7.1.0]
**For maintainers only:**

```bash
bundle exec rake build_and_publish_gem
gem build solarwinds_apm.gemspec
gem push solarwinds_apm-{version}.gem
```

Requires `GEM_HOST_API_KEY` environment variable and gem >= 3.0.5.
Expand Down
26 changes: 1 addition & 25 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require 'optparse'
require 'digest'
require 'open-uri'
require 'bundler/setup'
require 'bundler/gem_tasks'
require 'rake/testtask'

Rake::TestTask.new do |t|
Expand Down Expand Up @@ -113,31 +114,6 @@ def docker_cmd_execute(cmd)
end

################ Build Gem Task ################

desc 'Build and publish to Rubygems'
# !!! publishing requires gem >=3.0.5 !!!
# Don't run with Ruby versions < 2.7 they have gem < 3.0.5
task :build_and_publish_gem do
gemspec_file = 'solarwinds_apm.gemspec'
gemspec = Gem::Specification.load(gemspec_file)
gem_file = "#{gemspec.full_name}.gem"

exit 1 unless system('gem', 'build', gemspec_file)

exit 1 if ENV['GEM_HOST_API_KEY'] && !system('gem', 'push', gem_file)
end

desc 'Build and publish to Rubygems (alias for GitHub Actions compatibility)'
task :release do
gemspec_file = 'solarwinds_apm.gemspec'
gemspec = Gem::Specification.load(gemspec_file)
gem_file = "#{gemspec.full_name}.gem"

exit 1 unless system('gem', 'build', gemspec_file)

exit 1 unless system('gem', 'push', gem_file)
end

desc 'Build gem locally for testing'
task :build_gem do
puts "\n=== building for MRI ===\n"
Expand Down