toys-release 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +9 -0
- data/docs/guide.md +533 -513
- data/lib/toys/release/version.rb +1 -1
- data/toys/.data/templates/release-hook-on-closed.yml.erb +1 -1
- data/toys/.data/templates/release-hook-on-push.yml.erb +1 -1
- data/toys/.data/templates/release-perform.yml.erb +1 -1
- data/toys/.data/templates/release-request.yml.erb +1 -1
- data/toys/.data/templates/release-retry.yml.erb +1 -1
- data/toys/.toys.rb +1 -1
- data/toys/create-labels.rb +5 -20
- data/toys/gen-gh-pages.rb +1 -1
- data/toys/gen-workflows.rb +3 -2
- metadata +4 -4
data/lib/toys/release/version.rb
CHANGED
data/toys/.toys.rb
CHANGED
data/toys/create-labels.rb
CHANGED
|
@@ -29,12 +29,12 @@ def run
|
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
expected_labels =
|
|
32
|
+
expected_labels = define_expected_labels
|
|
33
33
|
cur_labels = load_existing_labels
|
|
34
34
|
update_labels cur_labels, expected_labels
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
def
|
|
37
|
+
def define_expected_labels
|
|
38
38
|
[
|
|
39
39
|
{
|
|
40
40
|
"name" => @settings.release_pending_label,
|
|
@@ -76,16 +76,7 @@ def update_labels(cur_labels, expected_labels)
|
|
|
76
76
|
create_label(expected)
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
|
-
|
|
80
|
-
@settings.release_pending_label,
|
|
81
|
-
@settings.release_error_label,
|
|
82
|
-
@settings.release_aborted_label,
|
|
83
|
-
@settings.release_complete_label,
|
|
84
|
-
]
|
|
85
|
-
cur_labels.each do |cur|
|
|
86
|
-
next unless release_related_labels.include?(cur["name"])
|
|
87
|
-
delete_label(cur) unless expected_labels.find { |label| label["name"] == cur["name"] }
|
|
88
|
-
end
|
|
79
|
+
puts "GitHub labels updated.", :green, :bold
|
|
89
80
|
end
|
|
90
81
|
|
|
91
82
|
def create_label(label)
|
|
@@ -95,6 +86,7 @@ def create_label(label)
|
|
|
95
86
|
exec(["gh", "api", "repos/#{@settings.repo_path}/labels", "--input", "-",
|
|
96
87
|
"-H", "Accept: application/vnd.github.v3+json"],
|
|
97
88
|
in: [:string, body], out: :null, e: true)
|
|
89
|
+
puts "Created label #{label_name.inspect}", :green
|
|
98
90
|
end
|
|
99
91
|
|
|
100
92
|
def update_label(label)
|
|
@@ -104,12 +96,5 @@ def update_label(label)
|
|
|
104
96
|
exec(["gh", "api", "-XPATCH", "repos/#{@settings.repo_path}/labels/#{label_name}",
|
|
105
97
|
"--input", "-", "-H", "Accept: application/vnd.github.v3+json"],
|
|
106
98
|
in: [:string, body], out: :null, e: true)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def delete_label(label)
|
|
110
|
-
label_name = label["name"]
|
|
111
|
-
return unless yes || confirm("Label \"#{label_name}\" unrecognized. Delete? ", default: true)
|
|
112
|
-
exec(["gh", "api", "-XDELETE", "repos/#{@settings.repo_path}/labels/#{label_name}",
|
|
113
|
-
"-H", "Accept: application/vnd.github.v3+json"],
|
|
114
|
-
out: :null, e: true)
|
|
99
|
+
puts "Updated fields of label #{label_name.inspect}", :green
|
|
115
100
|
end
|
data/toys/gen-gh-pages.rb
CHANGED
|
@@ -115,7 +115,7 @@ def generate_file(template, destination, data, remove_dir: false)
|
|
|
115
115
|
content = erb.result(ErbContext.get(data))
|
|
116
116
|
content = yield(content, old_content) if block_given? && old_content
|
|
117
117
|
::File.write(destination, content)
|
|
118
|
-
puts "Wrote #{destination}."
|
|
118
|
+
puts "Wrote #{destination}.", :green
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def file_generation_confirmations(destination, remove_dir)
|
data/toys/gen-workflows.rb
CHANGED
|
@@ -65,12 +65,13 @@ def generate_all_files
|
|
|
65
65
|
"release-retry.yml",
|
|
66
66
|
]
|
|
67
67
|
files.each { |name| generate_file(name) }
|
|
68
|
+
puts "Workflow files generated.", :green, :bold
|
|
68
69
|
end
|
|
69
70
|
|
|
70
71
|
def generate_file(name)
|
|
71
72
|
destination = ::File.join(workflows_dir, name)
|
|
72
73
|
if ::File.readable?(destination)
|
|
73
|
-
puts "Destination file #{destination} exists.", :yellow
|
|
74
|
+
puts "Destination file #{destination} exists.", :yellow
|
|
74
75
|
return unless yes || confirm("Overwrite? ", default: true)
|
|
75
76
|
else
|
|
76
77
|
return unless yes || confirm("Create file #{destination}? ", default: true)
|
|
@@ -82,6 +83,6 @@ def generate_file(name)
|
|
|
82
83
|
|
|
83
84
|
::File.open(destination, "w") do |file|
|
|
84
85
|
file.write(erb.result(ErbContext.get(@settings)))
|
|
85
|
-
puts "Wrote #{destination}.", :green
|
|
86
|
+
puts "Wrote #{destination}.", :green
|
|
86
87
|
end
|
|
87
88
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: toys-release
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Azuma
|
|
@@ -81,10 +81,10 @@ homepage: https://github.com/dazuma/toys
|
|
|
81
81
|
licenses:
|
|
82
82
|
- MIT
|
|
83
83
|
metadata:
|
|
84
|
-
changelog_uri: https://dazuma.github.io/toys/gems/toys-release/v0.
|
|
84
|
+
changelog_uri: https://dazuma.github.io/toys/gems/toys-release/v0.4.0/file.CHANGELOG.html
|
|
85
85
|
source_code_uri: https://github.com/dazuma/toys/tree/main/toys-release
|
|
86
86
|
bug_tracker_uri: https://github.com/dazuma/toys/issues
|
|
87
|
-
documentation_uri: https://dazuma.github.io/toys/gems/toys-release/v0.
|
|
87
|
+
documentation_uri: https://dazuma.github.io/toys/gems/toys-release/v0.4.0
|
|
88
88
|
rdoc_options: []
|
|
89
89
|
require_paths:
|
|
90
90
|
- lib
|
|
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
99
99
|
- !ruby/object:Gem::Version
|
|
100
100
|
version: '0'
|
|
101
101
|
requirements: []
|
|
102
|
-
rubygems_version:
|
|
102
|
+
rubygems_version: 4.0.3
|
|
103
103
|
specification_version: 4
|
|
104
104
|
summary: Release system using GitHub Actions and Toys
|
|
105
105
|
test_files: []
|