From 5523a75fc379d2d4554e7edd80490454181b6a69 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 9 Oct 2019 10:55:44 -0700 Subject: [PATCH] Fixes to release scripts (#238) --- .kokoro/release.cfg | 41 +++++++++++++++++++++++++++++++++++++++++ Gemfile | 2 ++ Rakefile | 9 +++++---- 3 files changed, 48 insertions(+), 4 deletions(-) diff --git a/.kokoro/release.cfg b/.kokoro/release.cfg index 2ec59ed..ec95571 100644 --- a/.kokoro/release.cfg +++ b/.kokoro/release.cfg @@ -17,6 +17,37 @@ before_action { } } +# Fetch magictoken to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "releasetool-magictoken" + backend_type: FASTCONFIGPUSH + } + } +} + +# Fetch api key to use with Magic Github Proxy +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "magic-github-proxy-api-key" + backend_type: FASTCONFIGPUSH + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 73713 + keyname: "docuploader_service_account" + } + } +} + # Download resources for system tests (service account key, etc.) gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/google-cloud-ruby" @@ -37,6 +68,11 @@ env_vars: { value: "github/google-auth-library-ruby/.kokoro/build.sh" } +env_vars: { + key: "TRAMPOLINE_SCRIPT" + value: "trampoline_v1.py" +} + env_vars: { key: "JOB_TYPE" value: "release" @@ -51,3 +87,8 @@ env_vars: { key: "REPO_DIR" value: "github/google-auth-library-ruby" } + +env_vars: { + key: "PACKAGE" + value: "googleauth" +} diff --git a/Gemfile b/Gemfile index 93840b8..0964a39 100755 --- a/Gemfile +++ b/Gemfile @@ -23,3 +23,5 @@ platforms :jruby do group :development do end end + +gem "gems", "~> 1.2" diff --git a/Rakefile b/Rakefile index 0b5c311..4f71c3c 100755 --- a/Rakefile +++ b/Rakefile @@ -1,4 +1,5 @@ # -*- ruby -*- +require "json" require "bundler/gem_tasks" task :ci do @@ -7,12 +8,12 @@ task :ci do sh "bundle exec rspec" end -task :release, :tag do |_t, args| +task :release_gem, :tag do |_t, args| tag = args[:tag] raise "You must provide a tag to release." if tag.nil? # Verify the tag format "vVERSION" - m = tag.match(/v(?\S*)/) + m = tag.match(/google-auth-library-ruby\/v(?\S*)/) raise "Tag #{tag} does not match the expected format." if m.nil? version = m[:version] @@ -33,7 +34,7 @@ task :release, :tag do |_t, args| sh "bundle exec rake build" end - path_to_be_pushed = "pkg/#{version}.gem" + path_to_be_pushed = "pkg/googleauth-#{version}.gem" if File.file? path_to_be_pushed begin ::Gems.push File.new(path_to_be_pushed) @@ -75,7 +76,7 @@ namespace :kokoro do .first.split("(").last.split(")").first || "0.1.0" end Rake::Task["kokoro:load_env_vars"].invoke - Rake::Task["release"].invoke "v/#{version}" + Rake::Task["release_gem"].invoke "google-auth-library-ruby/v#{version}" end end