Skip to content

Commit

Permalink
Prepare release for Mongoid 8.1.1 (#5663)
Browse files Browse the repository at this point in the history
* version bump

* check for signed gems without resorting to Docker

* MONGOID-5689 fix documentation error in 8.1 release notes
  • Loading branch information
jamis authored Jul 11, 2023
1 parent 597e7ad commit 9b7505a
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 79 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
4 changes: 2 additions & 2 deletions docs/release-notes/mongoid-8.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ Added ``:replace`` option to ``#upsert``
----------------------------------------

Mongoid 8.1 adds the ``:replace`` option to the ``#upsert`` method. This option
is ``false`` by default.
is ``true`` by default.

In Mongoid 8 and earlier, and in Mongoid 8.1 when passing ``replace: true``
(the default) the upserted document will overwrite the current document in the
Expand Down Expand Up @@ -396,7 +396,7 @@ Added ``none_of`` Query Method
------------------------------

With the addition of ``none_of``, Mongoid 8.1 allows queries to exclude
conditions in bulk. The emitted query will encapsulate the specified
conditions in bulk. The emitted query will encapsulate the specified
criteria in a ``$nor`` operation. For example:

.. code:: ruby
Expand Down
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.1.0"
VERSION = "8.1.1"
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 9b7505a

Please sign in to comment.