Skip to content

Commit

Permalink
Prepare for release of 8.0.5 (#5662)
Browse files Browse the repository at this point in the history
* version bump

* check for signed gems without resorting to Docker
  • Loading branch information
jamis authored Jul 11, 2023
1 parent 87c7d9a commit c7807f0
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 77 deletions.
25 changes: 25 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ $: << File.join(ROOT, 'spec/shared/lib')
require "rake"
require "rspec/core/rake_task"
require 'mrss/spec_organizer'
require 'rubygems/package'
require 'rubygems/security/policies'

def signed_gem?(path_to_gem)
Gem::Package.new(path_to_gem, Gem::Security::HighSecurity).verify
true
rescue Gem::Security::Exception => e
false
end

$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "mongoid/version"
Expand Down Expand Up @@ -103,3 +112,19 @@ namespace :release do
end
end
end

desc 'Verifies that all built gems in pkg/ are valid'
task :verify do
gems = Dir['pkg/*.gem']
if gems.empty?
puts 'There are no gems in pkg/ to verify'
else
gems.each do |gem|
if signed_gem?(gem)
puts "#{gem} is signed"
else
abort "#{gem} is not signed"
end
end
end
end
2 changes: 1 addition & 1 deletion lib/mongoid/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Mongoid
VERSION = "8.0.4"
VERSION = "8.0.5"
end
22 changes: 2 additions & 20 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,32 +17,14 @@ VERSION=`ruby -Ilib -r$VERSION_REQUIRE -e "puts $VERSION_CONSTANT_NAME"`
echo "Releasing $NAME $VERSION"
echo

for variant in mri; do
docker build -f release/$variant/Dockerfile -t $RELEASE_NAME-$variant .

docker kill $RELEASE_NAME-$variant || true
docker container rm $RELEASE_NAME-$variant || true

docker run -d --name $RELEASE_NAME-$variant -it $RELEASE_NAME-$variant

docker exec $RELEASE_NAME-$variant /app/release/$variant/build.sh

if test $variant = jruby; then
docker cp $RELEASE_NAME-$variant:/app/pkg/$NAME-$VERSION-java.gem .
else
docker cp $RELEASE_NAME-$variant:/app/pkg/$NAME-$VERSION.gem .
fi

docker kill $RELEASE_NAME-$variant
done
./release/mri/build.sh
cp pkg/$NAME-$VERSION.gem .

echo
echo Built: $NAME-$VERSION.gem
#echo Built: $NAME-$VERSION-java.gem
echo

git tag -a v$VERSION -m "Tagging release: $VERSION"
git push origin v$VERSION

gem push $NAME-$VERSION.gem
#gem push $NAME-$VERSION-java.gem
11 changes: 0 additions & 11 deletions release/mri/Dockerfile

This file was deleted.

5 changes: 1 addition & 4 deletions release/mri/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ set -e

rm -f *.lock
rm -f *.gem pkg/*.gem
bundle install --without=test
# Uses bundler gem tasks, outputs the built gem file to pkg subdir.
rake build
/app/release/verify-signature.sh pkg/*.gem
rake build verify
41 changes: 0 additions & 41 deletions release/verify-signature.sh

This file was deleted.

0 comments on commit c7807f0

Please sign in to comment.