configure_trusted_publisher 0.1.3 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fa9e10544502d63d23b7677b099af4a53e2ae4436cd4cb8e5134cfcd41e541b7
4
- data.tar.gz: f7608581cf5d2cc748630bb8fdf56771e7ce3e6ec8ce93385e30d2f721a7d2e3
3
+ metadata.gz: 75930e6d2a3b492c60737125a7e4a96abf6f50339722b4d454e2641675c4d094
4
+ data.tar.gz: 45b86dc2cea3ac44909fe36e93d4cedd98f8ec06abf6e7af4b0dbc33c2050f07
5
5
  SHA512:
6
- metadata.gz: 71ea60d2723ca3d2c49eb7b1a6d3c1ab2bf1b6a95024e5414efd1ddbe57c71d17e1a54bd6c96d75f4c20b32182bf7dc349c7144105b0a4863c7b0ec73cabd62a
7
- data.tar.gz: aeac3236be08f91c5e479e5fe2151b4a58be1c8f9c59d957204ee5fbe147041f1621b0aa26be99a0fa48063898dbaf0140e48f4b7783a2b90156b38dff52e81f
6
+ metadata.gz: abebcafcae7cd008644fa9e61837e4ea2d298f0ca409c827eed3bf3b90146d6498328d0c02a91f65c373317862962d7faec2a3bb1a524198d51b19119e576507
7
+ data.tar.gz: a2d9ee000971206315bb8bbfea72c583eebcc5f4fe05273567dc4148a920367ccb553079d90a3e821f6700c79e18213dd693de8e584edb7d8441efc28cadd9da
@@ -7,6 +7,7 @@ require "io/console"
7
7
 
8
8
  require "bundler"
9
9
  require "json"
10
+ require "open3"
10
11
  require "rubygems/gemcutter_utilities"
11
12
 
12
13
  Gem.configuration.verbose = true
@@ -143,9 +144,10 @@ module ConfigureTrustedPublisher
143
144
  rubygem_name = gemspec_source.specs.first.name
144
145
  end
145
146
 
146
- unless system("rake", "release", "--dry-run", chdir: repository, exception: false, out: File::NULL,
147
- err: File::NULL)
148
- abort "rake release is not configured for #{rubygem_name} in #{repository}"
147
+ Open3.capture2e("bundle", "exec", "rake", "release", "--dry-run", chdir: repository).then do |output, status|
148
+ unless status.success?
149
+ abort "bundle exec rake release is not configured for #{rubygem_name} in #{repository}:\n#{output}"
150
+ end
149
151
  end
150
152
 
151
153
  puts "Configuring trusted publisher for #{rubygem_name} in #{File.expand_path(repository)} for " \
@@ -242,6 +244,7 @@ module ConfigureTrustedPublisher
242
244
  def write_release_action(repository, rubygem_name)
243
245
  tag = "Automatically when a new tag matching v* is pushed"
244
246
  manual = "Manually by running a GitHub Action"
247
+ puts
245
248
  response = ask_multiple_choice(
246
249
  "How would you like releases for #{rubygem_name} to be triggered?", [
247
250
  tag,
@@ -276,7 +279,7 @@ module ConfigureTrustedPublisher
276
279
 
277
280
  jobs:
278
281
  push:
279
- if: github.repository == 'rubygems/configure_trusted_publisher'
282
+ if: github.repository == '#{github_repository.join('/')}'
280
283
  runs-on: ubuntu-latest
281
284
 
282
285
  permissions:
@@ -321,7 +324,7 @@ module ConfigureTrustedPublisher
321
324
 
322
325
  jobs:
323
326
  push:
324
- if: github.repository == 'rubygems/configure_trusted_publisher'
327
+ if: github.repository == '#{github_repository.join('/')}'
325
328
  runs-on: ubuntu-latest
326
329
 
327
330
  permissions:
@@ -353,6 +356,7 @@ module ConfigureTrustedPublisher
353
356
  def check_action(action_file)
354
357
  return FileUtils.mkdir_p(File.dirname(action_file)) || true unless File.exist?(action_file)
355
358
 
359
+ puts
356
360
  response = ask_multiple_choice(
357
361
  "#{action_file} already exists, overwrite?", { "y" => "Yes", "n" => "No" },
358
362
  default: "n"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConfigureTrustedPublisher
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configure_trusted_publisher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Giddins