kettle-dev 1.0.12 → 1.0.13
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
- checksums.yaml.gz.sig +0 -0
- data/.envrc +1 -1
- data/.github/workflows/coverage.yml +3 -3
- data/CHANGELOG.md +11 -1
- data/lib/kettle/dev/release_cli.rb +107 -0
- data/lib/kettle/dev/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8460f9258aafa37fd7a2c96cdc28e3b1b71feacd427e3ce63bbc7a97dbef5bb2
|
4
|
+
data.tar.gz: 18fb4f0b33e3131fdc8e87449f093f5de6357a6f41022753494343a06bca54f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10cd0166e24755047a3b2cd56de8ecb8c911aa5a4855ce10614130ef9c2ccf08717de78d810e88b3e0fd7dc29772e176726037ab1d91cd1d6b82e5120bf02328
|
7
|
+
data.tar.gz: 43e17065699b2f46988aa5c0bff51e02907343878d9d283f44b06029b4bb64114d1c56ae21cba36f4081a50eef7fdce57db5f8521b224d2a4353c914792d0e3b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/.envrc
CHANGED
@@ -21,7 +21,7 @@ export K_SOUP_COV_DO=true # Means you want code coverage
|
|
21
21
|
export K_SOUP_COV_COMMAND_NAME="Test Coverage"
|
22
22
|
# Available formats are html, xml, rcov, lcov, json, tty
|
23
23
|
export K_SOUP_COV_FORMATTERS="html,xml,rcov,lcov,json,tty"
|
24
|
-
export K_SOUP_COV_MIN_BRANCH=
|
24
|
+
export K_SOUP_COV_MIN_BRANCH=78 # Means you want to enforce X% branch coverage
|
25
25
|
export K_SOUP_COV_MIN_LINE=97 # Means you want to enforce X% line coverage
|
26
26
|
export K_SOUP_COV_MIN_HARD=true # Means you want the build to fail if the coverage thresholds are not met
|
27
27
|
export K_SOUP_COV_MULTI_FORMATTERS=true
|
@@ -7,8 +7,8 @@ permissions:
|
|
7
7
|
|
8
8
|
env:
|
9
9
|
# Lower than local, which is at 100/100, because rubocop-lts isn't installed in the coverage workflow
|
10
|
-
K_SOUP_COV_MIN_BRANCH:
|
11
|
-
K_SOUP_COV_MIN_LINE:
|
10
|
+
K_SOUP_COV_MIN_BRANCH: 73
|
11
|
+
K_SOUP_COV_MIN_LINE: 93
|
12
12
|
K_SOUP_COV_MIN_HARD: true
|
13
13
|
K_SOUP_COV_FORMATTERS: "xml,rcov,lcov,tty"
|
14
14
|
K_SOUP_COV_DO: true
|
@@ -116,7 +116,7 @@ jobs:
|
|
116
116
|
hide_complexity: true
|
117
117
|
indicators: true
|
118
118
|
output: both
|
119
|
-
thresholds: '
|
119
|
+
thresholds: '93 73'
|
120
120
|
continue-on-error: ${{ matrix.experimental != 'false' }}
|
121
121
|
|
122
122
|
- name: Add Coverage PR Comment
|
data/CHANGELOG.md
CHANGED
@@ -24,6 +24,14 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
24
24
|
### Fixed
|
25
25
|
### Security
|
26
26
|
|
27
|
+
## [1.0.13] - 2025-08-28
|
28
|
+
- TAG: [v1.0.13][1.0.13t]
|
29
|
+
- COVERAGE: 41.94% -- 65/155 lines in 6 files
|
30
|
+
- BRANCH COVERAGE: 1.92% -- 1/52 branches in 6 files
|
31
|
+
- 76.03% documented
|
32
|
+
### Added
|
33
|
+
- kettle-release: Create GitHub release from tag & changelog entry
|
34
|
+
|
27
35
|
## [1.0.12] - 2025-08-28
|
28
36
|
- TAG: [v1.0.12][1.0.12t]
|
29
37
|
- COVERAGE: 97.80% -- 1957/2001 lines in 19 files
|
@@ -214,7 +222,7 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
214
222
|
- Selecting will run the selected workflow via `act`
|
215
223
|
- This may move to its own gem in the future.
|
216
224
|
|
217
|
-
[Unreleased]: https://github.com/kettle-rb/kettle-dev/compare/v1.0.
|
225
|
+
[Unreleased]: https://github.com/kettle-rb/kettle-dev/compare/v1.0.13...HEAD
|
218
226
|
[1.0.0]: https://github.com/kettle-rb/kettle-dev/compare/a427c302df09cfe4253a7c8d400333f9a4c1a208...v1.0.0
|
219
227
|
[1.0.0t]: https://github.com/kettle-rb/kettle-dev/releases/tag/v1.0.0
|
220
228
|
[1.0.1]: https://gitlab.com/kettle-rb/kettle-dev/-/compare/v1.0.0...v1.0.1
|
@@ -241,3 +249,5 @@ Please file a bug if you notice a violation of semantic versioning.
|
|
241
249
|
[1.0.11t]: https://github.com/kettle-rb/kettle-dev/releases/tag/v1.0.11
|
242
250
|
[1.0.12]: https://github.com/kettle-rb/kettle-dev/compare/v1.0.11...v1.0.12
|
243
251
|
[1.0.12t]: https://github.com/kettle-rb/kettle-dev/releases/tag/v1.0.12
|
252
|
+
[1.0.13]: https://github.com/kettle-rb/kettle-dev/compare/v1.0.12...v1.0.13
|
253
|
+
[1.0.13t]: https://github.com/kettle-rb/kettle-dev/releases/tag/v1.0.13
|
@@ -202,6 +202,12 @@ module Kettle
|
|
202
202
|
validate_checksums!(version, stage: "after release")
|
203
203
|
end
|
204
204
|
|
205
|
+
# 17. create GitHub release (optional)
|
206
|
+
if @start_step <= 17
|
207
|
+
version ||= detect_version
|
208
|
+
maybe_create_github_release!(version)
|
209
|
+
end
|
210
|
+
|
205
211
|
puts "\nRelease complete. Don't forget to push the checksums commit if needed."
|
206
212
|
end
|
207
213
|
|
@@ -644,6 +650,107 @@ module Kettle
|
|
644
650
|
Digest::SHA256.file(path).hexdigest
|
645
651
|
end
|
646
652
|
end
|
653
|
+
|
654
|
+
# If GITHUB_TOKEN is present, create a GitHub release for the given version tag.
|
655
|
+
# Title: v<version>
|
656
|
+
# Body: the CHANGELOG section for this version, followed by the two link references for this version.
|
657
|
+
def maybe_create_github_release!(version)
|
658
|
+
token = ENV.fetch("GITHUB_TOKEN", "").to_s
|
659
|
+
return if token.strip.empty?
|
660
|
+
|
661
|
+
gh_remote = preferred_github_remote
|
662
|
+
url = remote_url(gh_remote || "origin")
|
663
|
+
owner, repo = parse_github_owner_repo(url)
|
664
|
+
unless owner && repo
|
665
|
+
warn("GITHUB_TOKEN present but could not determine GitHub owner/repo from remotes. Skipping release creation.")
|
666
|
+
return
|
667
|
+
end
|
668
|
+
|
669
|
+
section, compare_ref, tag_ref = extract_changelog_for_version(version)
|
670
|
+
unless section
|
671
|
+
warn("CHANGELOG.md does not contain a section for #{version}. Skipping GitHub release creation.")
|
672
|
+
return
|
673
|
+
end
|
674
|
+
|
675
|
+
body = +""
|
676
|
+
body << section.rstrip
|
677
|
+
body << "\n\n"
|
678
|
+
body << compare_ref if compare_ref
|
679
|
+
body << tag_ref if tag_ref
|
680
|
+
|
681
|
+
tag = "v#{version}"
|
682
|
+
puts "Creating GitHub release #{owner}/#{repo} #{tag}..."
|
683
|
+
ok, msg = github_create_release(owner: owner, repo: repo, token: token, tag: tag, title: tag, body: body)
|
684
|
+
if ok
|
685
|
+
puts "GitHub release created for #{tag}."
|
686
|
+
else
|
687
|
+
warn("GitHub release creation skipped/failed: #{msg}")
|
688
|
+
end
|
689
|
+
end
|
690
|
+
|
691
|
+
# Returns [section_text, compare_ref_line, tag_ref_line]
|
692
|
+
def extract_changelog_for_version(version)
|
693
|
+
path = File.join(@root, "CHANGELOG.md")
|
694
|
+
return [nil, nil, nil] unless File.file?(path)
|
695
|
+
content = File.read(path)
|
696
|
+
lines = content.lines
|
697
|
+
|
698
|
+
# Find section start
|
699
|
+
start_idx = lines.index { |l| l.start_with?("## [#{version}]") }
|
700
|
+
return [nil, nil, nil] unless start_idx
|
701
|
+
i = start_idx + 1
|
702
|
+
# Find next section heading or EOF
|
703
|
+
while i < lines.length && !lines[i].start_with?("## [")
|
704
|
+
i += 1
|
705
|
+
end
|
706
|
+
section = lines[start_idx...(i)].join
|
707
|
+
|
708
|
+
# Find link refs (anywhere after Unreleased or at end; simple global scan acceptable)
|
709
|
+
compare_ref = lines.find { |l| l.start_with?("[#{version}]: ") }
|
710
|
+
tag_ref = lines.find { |l| l.start_with?("[#{version}t]: ") }
|
711
|
+
# Ensure newline termination
|
712
|
+
compare_ref = compare_ref&.end_with?("\n") ? compare_ref : (compare_ref && compare_ref + "\n")
|
713
|
+
tag_ref = tag_ref&.end_with?("\n") ? tag_ref : (tag_ref && tag_ref + "\n")
|
714
|
+
[section, compare_ref, tag_ref]
|
715
|
+
rescue StandardError => e
|
716
|
+
warn("Failed to parse CHANGELOG.md: #{e.class}: #{e.message}")
|
717
|
+
[nil, nil, nil]
|
718
|
+
end
|
719
|
+
|
720
|
+
# POST to GitHub Releases API
|
721
|
+
# Returns [ok(Boolean), message(String)]
|
722
|
+
def github_create_release(owner:, repo:, token:, tag:, title:, body:)
|
723
|
+
uri = URI("https://api.github.com/repos/#{owner}/#{repo}/releases")
|
724
|
+
req = Net::HTTP::Post.new(uri)
|
725
|
+
req["Accept"] = "application/vnd.github+json"
|
726
|
+
req["Authorization"] = "token #{token}"
|
727
|
+
req["User-Agent"] = "kettle-dev-release-cli"
|
728
|
+
req.body = JSON.dump({
|
729
|
+
tag_name: tag,
|
730
|
+
name: title,
|
731
|
+
body: body,
|
732
|
+
draft: false,
|
733
|
+
prerelease: false,
|
734
|
+
})
|
735
|
+
|
736
|
+
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
|
737
|
+
http.request(req)
|
738
|
+
end
|
739
|
+
|
740
|
+
case res
|
741
|
+
when Net::HTTPSuccess, Net::HTTPCreated
|
742
|
+
[true, "created"]
|
743
|
+
else
|
744
|
+
# If release already exists, treat as non-fatal
|
745
|
+
if res.code.to_s == "422" && res.body.to_s.include?("already_exists")
|
746
|
+
[true, "already exists"]
|
747
|
+
else
|
748
|
+
[false, "HTTP #{res.code}: #{res.body}"]
|
749
|
+
end
|
750
|
+
end
|
751
|
+
rescue StandardError => e
|
752
|
+
[false, "#{e.class}: #{e.message}"]
|
753
|
+
end
|
647
754
|
end
|
648
755
|
end
|
649
756
|
end
|
data/lib/kettle/dev/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kettle-dev
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter H. Boling
|
@@ -339,10 +339,10 @@ licenses:
|
|
339
339
|
- MIT
|
340
340
|
metadata:
|
341
341
|
homepage_uri: https://kettle-dev.galtzo.com/
|
342
|
-
source_code_uri: https://github.com/kettle-rb/kettle-dev/tree/v1.0.
|
343
|
-
changelog_uri: https://github.com/kettle-rb/kettle-dev/blob/v1.0.
|
342
|
+
source_code_uri: https://github.com/kettle-rb/kettle-dev/tree/v1.0.13
|
343
|
+
changelog_uri: https://github.com/kettle-rb/kettle-dev/blob/v1.0.13/CHANGELOG.md
|
344
344
|
bug_tracker_uri: https://github.com/kettle-rb/kettle-dev/issues
|
345
|
-
documentation_uri: https://www.rubydoc.info/gems/kettle-dev/1.0.
|
345
|
+
documentation_uri: https://www.rubydoc.info/gems/kettle-dev/1.0.13
|
346
346
|
funding_uri: https://github.com/sponsors/pboling
|
347
347
|
wiki_uri: https://github.com/kettle-rb/kettle-dev/wiki
|
348
348
|
news_uri: https://www.railsbling.com/tags/kettle-dev
|
metadata.gz.sig
CHANGED
Binary file
|