boringbuilder 0.1.0.alpha.4 → 0.1.0.alpha.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9749414b7c380d6f22d64e9fbf42e16399553dfa0274cd85209becabf2ecb46
4
- data.tar.gz: 2a2b30435de56a0be063cd3b6c73737810005546b51e0bb380884ac3edf76cdf
3
+ metadata.gz: 265bb7643d090142fc6a68cba78809ffabf6dd3d5436e8a605d1e5e69848984c
4
+ data.tar.gz: ac30aa3a7160d742ce7742c4c1f86720deb5061a8c8eb85a4a6c57c7e79c7b13
5
5
  SHA512:
6
- metadata.gz: 8f7692b32065fa078b63d5a6f76e2c6c0c2d99c6dd7fc95513572e45be6d1ed182436cc8fc5a37e7ffff83cf589bca84d75be4d1182a59b66e3f587d5296d1c7
7
- data.tar.gz: 6e0480ec13fb058600d8fdf7b7b8ab50c1c041c8f68d365be65d7273f7089f716c21a3247a96b405d2665eed3a2a7c3f49a8a9b49af7c0ef0e1be523202972dd
6
+ metadata.gz: 1774754066715572ee3d1946642e00e07baa3b5d5f97626e04eb76b45d4e5ec6a226627e8033ead3967591082b41b2cff71cb730320df1026333495e7048ec3f
7
+ data.tar.gz: 391c319a4fd5e8a8c8eb634efc31f45df7bc2ecf4b2357e8a90deae236785c34dc88cdce53d1b4f154bed96950b27b8453cf4bd4e7957ae9a76d6db523c42f86
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0.alpha.5 - 2026-08-28
4
+
5
+ - Record the exact local or BoringCache build result for deployment tools.
6
+ - Finalize Rails runtime metadata without starting the application command.
7
+ - Publish each release with the matching human changelog notes.
8
+
3
9
  ## 0.1.0.alpha.4 - 2026-08-28
4
10
 
5
11
  - Expose the Rails build task as `boring:build`.
data/README.md CHANGED
@@ -85,7 +85,8 @@ See [Caching](docs/caching.md) for custom cached steps and restore-only builds.
85
85
 
86
86
  The default `tar.zst` output is intended for atomic filesystem deployers such as BoringDeploy. Without shared
87
87
  credentials it is written under `dist/`. With BoringCache save credentials it is published as a shared BoringCache
88
- Artifact instead; pass `--output` when a local copy is also wanted.
88
+ Artifact instead; pass `--output` when a local copy is also wanted. Each successful export records its exact result in
89
+ `tmp/builds/boringbuilder.json` so deployment tools can consume the same artifact without guessing.
89
90
 
90
91
  The same build can produce or publish a container image:
91
92
 
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "fileutils"
4
+ require "json"
5
+ require "open3"
6
+ require "pathname"
7
+ require "tempfile"
8
+ require "time"
9
+
10
+ module BoringBuilder
11
+ class BuildReceipt
12
+ RELATIVE_PATH = "tmp/builds/boringbuilder.json"
13
+
14
+ def self.write(root:, result:, clock: Time, command_runner: Open3.method(:capture3))
15
+ return unless result.exported? || result.artifact_published? || result.published?
16
+
17
+ root = Pathname.new(root).expand_path
18
+ path = root.join(RELATIVE_PATH)
19
+ FileUtils.mkdir_p(path.dirname)
20
+ document = {
21
+ schema_version: 1,
22
+ created_at: clock.now.utc.iso8601,
23
+ source_revision: source_revision(root, command_runner),
24
+ result: result.to_h
25
+ }
26
+
27
+ Tempfile.create(["boringbuilder", ".json"], path.dirname) do |file|
28
+ file.write(JSON.pretty_generate(document))
29
+ file.write("\n")
30
+ file.flush
31
+ file.fsync
32
+ File.rename(file.path, path)
33
+ end
34
+
35
+ path
36
+ end
37
+
38
+ def self.source_revision(root, command_runner)
39
+ stdout, _stderr, status = command_runner.call("git", "-C", root.to_s, "rev-parse", "HEAD")
40
+ status.success? ? stdout.strip : nil
41
+ rescue Errno::ENOENT
42
+ nil
43
+ end
44
+
45
+ private_class_method :source_revision
46
+ end
47
+ end
@@ -21,10 +21,12 @@ module BoringBuilder
21
21
  silent: configuration.progress.nil?
22
22
  )
23
23
 
24
- DaggerRuby.connection(dagger_configuration) do |client|
24
+ result = DaggerRuby.connection(dagger_configuration) do |client|
25
25
  container = project.container(client, progress: progress)
26
26
  Exporter.new(project, client, container, runtime: resolved_runtime, progress: progress).call
27
27
  end
28
+ BuildReceipt.write(root: configuration.root, result: result)
29
+ result
28
30
  rescue DaggerRuby::DaggerError => e
29
31
  message = e.message.sub(/\s*\[traceparent:[^\]]+\]\s*\z/, "")
30
32
  raise BuildError, "Dagger build failed: #{message}"
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BoringBuilder
4
+ class ReleaseNotes
5
+ def self.read(path:, version:)
6
+ sections = File.read(path).lines
7
+ heading = /^## #{Regexp.escape(version)} - \d{4}-\d{2}-\d{2}\s*$/
8
+ start = sections.index { |line| line.match?(heading) }
9
+ raise ArgumentError, "CHANGELOG.md has no release notes for #{version}" unless start
10
+
11
+ finish = sections.each_index.find { |index| index > start && sections[index].start_with?("## ") }
12
+ notes = sections[(start + 1)...finish].join.strip
13
+ raise ArgumentError, "CHANGELOG.md release notes for #{version} are empty" if notes.empty?
14
+
15
+ notes
16
+ end
17
+ end
18
+ end
@@ -173,8 +173,9 @@ module BoringBuilder
173
173
  name: "[runtime] RUN mise reshim",
174
174
  workdir: application_path
175
175
  )
176
- container = runtime_metadata(container).with_user(project.application_user)
177
- progress.step("[runtime] Configure image") { container.sync }
176
+ container = container.with_user(project.application_user)
177
+ container = progress.step("[runtime] Configure image") { container.sync }
178
+ runtime_metadata(container)
178
179
  end
179
180
 
180
181
  def install_packages(container, packages, stage:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BoringBuilder
4
- VERSION = "0.1.0.alpha.4"
4
+ VERSION = "0.1.0.alpha.5"
5
5
  end
data/lib/boringbuilder.rb CHANGED
@@ -20,6 +20,7 @@ require_relative "boringbuilder/ruby_build"
20
20
  require_relative "boringbuilder/rails_build"
21
21
  require_relative "boringbuilder/exporter"
22
22
  require_relative "boringbuilder/result"
23
+ require_relative "boringbuilder/build_receipt"
23
24
  require_relative "boringbuilder/builder"
24
25
  require_relative "boringbuilder/cli"
25
26
  require_relative "boringbuilder/railtie" if defined?(Rails::Railtie)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boringbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha.4
4
+ version: 0.1.0.alpha.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - BoringCache
@@ -47,6 +47,7 @@ files:
47
47
  - lib/boringbuilder.rb
48
48
  - lib/boringbuilder/artifact.rb
49
49
  - lib/boringbuilder/boring_cache.rb
50
+ - lib/boringbuilder/build_receipt.rb
50
51
  - lib/boringbuilder/builder.rb
51
52
  - lib/boringbuilder/cli.rb
52
53
  - lib/boringbuilder/config_file.rb
@@ -66,6 +67,7 @@ files:
66
67
  - lib/boringbuilder/project_plan.rb
67
68
  - lib/boringbuilder/rails_build.rb
68
69
  - lib/boringbuilder/railtie.rb
70
+ - lib/boringbuilder/release_notes.rb
69
71
  - lib/boringbuilder/result.rb
70
72
  - lib/boringbuilder/ruby_application.rb
71
73
  - lib/boringbuilder/ruby_build.rb
@@ -78,7 +80,7 @@ licenses:
78
80
  metadata:
79
81
  allowed_push_host: https://rubygems.org
80
82
  homepage_uri: https://github.com/boringcache/builder
81
- source_code_uri: https://github.com/boringcache/builder/tree/v0.1.0.alpha.4
83
+ source_code_uri: https://github.com/boringcache/builder/tree/v0.1.0.alpha.5
82
84
  documentation_uri: https://github.com/boringcache/builder#readme
83
85
  changelog_uri: https://github.com/boringcache/builder/blob/main/CHANGELOG.md
84
86
  bug_tracker_uri: https://github.com/boringcache/builder/issues