Skip to content

Commit

Permalink
Add some missing bits
Browse files Browse the repository at this point in the history
- rake gem:release does too much
- fix rake gem:install task
- rake git:tag:create needs VERSION
- no need to use sudo
  • Loading branch information
dentarg committed Jun 21, 2024
1 parent 9e4410f commit 8a18691
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:

- uses: rubygems/configure-rubygems-credentials@v1.0.0

# build gem
- run: bundle exec rake gem:release
# ensure gem can be built and installed
- run: bundle exec rake gem:install

# push gem to rubygems.org
- run: gem push --verbose pkg/addressable-${VERSION}.gem
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
1. Create pull request with all that
1. Merge the pull request when CI is green
1. Ensure you have latest changes locally
1. Run `rake git:tag:create` to create tag in git
1. Run`VERSION=x.y.z rake git:tag:create` to create tag in git
1. Push tag to upstream: `git push --tags upstream`
1. Watch GitHub Actions build and push the gem to RubyGems.org
3 changes: 0 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,4 @@ PKG_FILES = FileList[

task :default => "spec"

WINDOWS = (RUBY_PLATFORM =~ /mswin|win32|mingw|bccwin|cygwin/) rescue false
SUDO = WINDOWS ? '' : ('sudo' unless ENV['SUDOLESS'])

Dir['tasks/**/*.rake'].each { |rake| load rake }
4 changes: 2 additions & 2 deletions tasks/gem.rake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace :gem do

desc "Install the gem"
task :install => ["clobber", "gem:package"] do
sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}"
sh "gem install --local ./pkg/#{GEM_SPEC.full_name}.gem"
end

desc "Uninstall the gem"
Expand All @@ -65,7 +65,7 @@ namespace :gem do
if installed_list &&
(installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION))
sh(
"#{SUDO} gem uninstall --version '#{PKG_VERSION}' " +
"gem uninstall --version '#{PKG_VERSION}' " +
"--ignore-dependencies --executables #{PKG_NAME}"
)
end
Expand Down

0 comments on commit 8a18691

Please sign in to comment.