File tree Expand file tree Collapse file tree 5 files changed +31
-76
lines changed Expand file tree Collapse file tree 5 files changed +31
-76
lines changed Original file line number Diff line number Diff line change 11require 'bundler'
22require 'bundler/gem_tasks'
3- require 'rake/extensiontask'
3+ require 'rubygems/package'
4+ require 'rubygems/security/policies'
45
6+ def signed_gem? ( path_to_gem )
7+ Gem ::Package . new ( path_to_gem , Gem ::Security ::HighSecurity ) . verify
8+ true
9+ rescue Gem ::Security ::Exception => e
10+ false
11+ end
12+
13+ desc 'Compiles the libmongocrypt library'
514task :compile do
6- chdir "ext/libmongocrypt" do
7- ruby "extconf.rb"
15+ chdir 'ext/libmongocrypt' do
16+ ruby 'extconf.rb'
17+ end
18+ end
19+
20+ desc 'Verifies that all built gems in pkg/ are valid'
21+ task :verify do
22+ gems = Dir [ 'pkg/*.gem' ]
23+ if gems . empty?
24+ puts 'There are no gems in pkg/ to verify'
25+ else
26+ gems . each do |gem |
27+ if signed_gem? ( gem )
28+ puts "#{ gem } is signed"
29+ else
30+ abort "#{ gem } is not signed"
31+ end
32+ end
833 end
934end
Original file line number Diff line number Diff line change @@ -17,32 +17,14 @@ VERSION=`ruby -Ilib -r$VERSION_REQUIRE -e "puts $VERSION_CONSTANT_NAME"`
1717echo " Releasing $NAME $VERSION "
1818echo
1919
20- for variant in mri; do
21- docker build -f release/$variant /Dockerfile -t $RELEASE_NAME -$variant .
22-
23- docker kill $RELEASE_NAME -$variant || true
24- docker container rm $RELEASE_NAME -$variant || true
25-
26- docker run -d --name $RELEASE_NAME -$variant -it $RELEASE_NAME -$variant
27-
28- docker exec $RELEASE_NAME -$variant /app/release/$variant /build.sh
29-
30- if test $variant = jruby; then
31- docker cp $RELEASE_NAME -$variant :/app/pkg/$NAME -$VERSION -java.gem .
32- else
33- docker cp $RELEASE_NAME -$variant :/app/pkg/$NAME -$VERSION .gem .
34- fi
35-
36- docker kill $RELEASE_NAME -$variant
37- done
20+ ./release/mri/build.sh
21+ cp pkg/$NAME -$VERSION .gem .
3822
3923echo
4024echo Built: $NAME -$VERSION .gem
41- # echo Built: $NAME-$VERSION-java.gem
4225echo
4326
4427git tag -a v$VERSION -m " Tagging release: $VERSION "
4528git push origin v$VERSION
4629
4730gem push $NAME -$VERSION .gem
48- # gem push $NAME-$VERSION-java.gem
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -6,5 +6,4 @@ rm -f *.lock
66rm -f * .gem pkg/* .gem
77# Uses bundler gem tasks, outputs the built gem file to pkg subdir.
88bundle install
9- bundle exec rake build
10- /app/release/verify-signature.sh pkg/* .gem
9+ bundle exec rake build verify
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments