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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75930e6d2a3b492c60737125a7e4a96abf6f50339722b4d454e2641675c4d094
|
4
|
+
data.tar.gz: 45b86dc2cea3ac44909fe36e93d4cedd98f8ec06abf6e7af4b0dbc33c2050f07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
147
|
-
|
148
|
-
|
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 == '
|
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 == '
|
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"
|