toys-release 0.1.0 → 0.1.1

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: 6f2bad43c37b4109aee66b380e4e0e6497a390d4d7411727ded7b6fb583f2655
4
- data.tar.gz: e9a297a316744b9523bab8976a63b43a7f1728424572f561bc8bde3255cdb932
3
+ metadata.gz: a3ff3cf2eca9706959eddfb418f6b32a26be0b6b38729060daf8eea59b328a22
4
+ data.tar.gz: 7859d5108f62f3cfe45107aaf737ca278866d07edab8d7cdf678ff9e5b6c5124
5
5
  SHA512:
6
- metadata.gz: feee3189f4e0fb77d08c506aefb2130b8a00f46ac53066c5407fd1f2200ed8264acff74ec90facf2ec29e5b2b04e37e908421459528c1d08b486af4ef3b8a597
7
- data.tar.gz: a07912d6c512bf037d71b7394b007af8d918cc9eafb518ef3a5779642c35462c21115ea57e48604c6a3653f59a1781bdaca77321199bcd4dfa1101dc396ba8f5
6
+ metadata.gz: 794cd275768b4a657558527699cb1c5fd1ca628115cf144e30b9f4c2f4ac10ab939381203c1784cc5d92cfaa05c39f9c2999d799c9334140b64765989b7d9850
7
+ data.tar.gz: 18c092ffbfc0489fd064548778350bf22cc3cb2f436aa02bc23c9a4488879768dc3b875b92de8440306c8ef20142c148a46ee331e67e8983703c5efe7ed47fc1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Release History
2
2
 
3
+ ### v0.1.1 / 2025-11-09
4
+
5
+ * FIXED: The gen-gh-pages script now generates the correct redirect paths on a non-monorepo with the default directory structure
6
+ * FIXED: The gen-gh-pages script no longer exits abnormally if no changes were made
7
+
3
8
  ### v0.1.0 / 2025-11-09
4
9
 
5
10
  Initial release of the toys-release gem
@@ -6,6 +6,6 @@ module Toys
6
6
  # Current version of the Toys release system.
7
7
  # @return [String]
8
8
  #
9
- VERSION = "0.1.0"
9
+ VERSION = "0.1.1"
10
10
  end
11
11
  end
@@ -5,21 +5,21 @@
5
5
  </head>
6
6
  <body>
7
7
  <p>
8
- <a href="https://<%= @url_base %>/index.html">Main documentation page</a>
8
+ <a href="https://<%= @comp_info.first.first %>/index.html">Main documentation page</a>
9
9
  </p>
10
10
  </body>
11
11
  <script>
12
- <% @relevant_component_settings.map { |comp| comp.gh_pages_version_var }.uniq.each do |version_var| %> var <%= version_var %> = "0.0.0";
12
+ <% @comp_info.values.uniq.each do |version_var| %> var <%= version_var %> = "0.0.0";
13
13
  <% end %> var location_updated = false;
14
- <% @relevant_component_settings.each do |component_settings| %> if (!location_updated && window.location.href.includes("//<%= @url_base %>/<%= component_settings.gh_pages_directory %>/latest")) {
14
+ <% @comp_info.each do |(url_base, version_var)| %> if (!location_updated && window.location.href.includes("//<%= url_base %>/latest")) {
15
15
  var loc = window.location.href.replace(
16
- "//<%= @url_base %>/<%= component_settings.gh_pages_directory %>/latest",
17
- "//<%= @url_base %>/<%= component_settings.gh_pages_directory %>/v" + <%= component_settings.gh_pages_version_var %>);
16
+ "//<%= url_base %>/latest",
17
+ "//<%= url_base %>/v" + <%= version_var %>);
18
18
  window.location.replace(loc);
19
19
  location_updated = true;
20
20
  }
21
21
  <% end %> if (!location_updated) {
22
- window.location.replace("<%= @default_url %>");
22
+ window.location.replace("https://<%= @comp_info.first.first %>/latest");
23
23
  }
24
24
  </script>
25
25
  </html>
@@ -5,7 +5,7 @@
5
5
  </head>
6
6
  <body>
7
7
  <p>
8
- No releases yet for <%= @component_settings.name %>.
8
+ No releases yet for <%= @name %>.
9
9
  </p>
10
10
  </body>
11
11
  </html>
@@ -16,7 +16,7 @@ jobs:
16
16
  release-request:
17
17
  if: ${{ github.repository == '<%= @settings.repo_path %>' }}
18
18
  env:
19
- ruby_version: "3.3"
19
+ ruby_version: "3.4"
20
20
  runs-on: ubuntu-latest
21
21
  steps:
22
22
  - name: Install Ruby ${{ env.ruby_version }}
data/toys/gen-gh-pages.rb CHANGED
@@ -63,26 +63,28 @@ end
63
63
  def generate_gh_pages
64
64
  relevant_component_settings = @settings.all_component_settings.find_all(&:gh_pages_enabled)
65
65
  url_base = "#{@settings.repo_owner}.github.io/#{@settings.repo_name}"
66
- default_url = "https://#{url_base}/#{relevant_component_settings.first.gh_pages_directory}/latest"
66
+ comp_info = relevant_component_settings.to_h do |comp|
67
+ [
68
+ comp.gh_pages_directory == "." ? url_base : "#{url_base}/#{comp.gh_pages_directory}",
69
+ comp.gh_pages_version_var,
70
+ ]
71
+ end
67
72
 
68
73
  ::Dir.chdir(@gh_pages_dir) do
69
74
  ::File.write(".nojekyll", "")
70
75
  generate_file("gh-pages-gitignore.erb", ".gitignore", {})
71
76
 
72
- data = {
73
- relevant_component_settings: relevant_component_settings,
74
- url_base: url_base,
75
- default_url: default_url,
76
- }
77
- generate_file("gh-pages-404.html.erb", "404.html", data) do |content, old_content|
77
+ generate_file("gh-pages-404.html.erb", "404.html",
78
+ {comp_info: comp_info}) do |content, old_content|
78
79
  update_versions(content, old_content)
79
80
  end
80
81
 
81
- generate_file("gh-pages-index.html.erb", "index.html", {default_url: default_url})
82
+ generate_file("gh-pages-index.html.erb", "index.html",
83
+ {default_url: "https://#{comp_info.first.first}/latest"})
82
84
 
83
85
  relevant_component_settings.each do |component_settings|
84
86
  generate_file("gh-pages-empty.html.erb", "#{component_settings.gh_pages_directory}/v0.0.0/index.html",
85
- {component_settings: component_settings}, remove_dir: true)
87
+ {name: component_settings.name}, remove_dir: true)
86
88
  end
87
89
  end
88
90
  puts "Files generated into #{@gh_pages_dir}", :bold
@@ -90,6 +92,10 @@ end
90
92
 
91
93
  def push_gh_pages
92
94
  ::Dir.chdir(@gh_pages_dir) do
95
+ if @repository.git_clean?
96
+ puts "No changes made to gh-pages.", :yellow, :bold
97
+ return
98
+ end
93
99
  @repository.git_commit("Generated initial gh-pages", signoff: @settings.signoff_commits?)
94
100
  if dry_run
95
101
  puts "DRY RUN: Skipped git push.", :green, :bold
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
@@ -82,10 +82,10 @@ homepage: https://github.com/dazuma/toys
82
82
  licenses:
83
83
  - MIT
84
84
  metadata:
85
- changelog_uri: https://dazuma.github.io/toys/gems/toys-release/v0.1.0/file.CHANGELOG.html
85
+ changelog_uri: https://dazuma.github.io/toys/gems/toys-release/v0.1.1/file.CHANGELOG.html
86
86
  source_code_uri: https://github.com/dazuma/toys/tree/main/toys-release
87
87
  bug_tracker_uri: https://github.com/dazuma/toys/issues
88
- documentation_uri: https://dazuma.github.io/toys/gems/toys-release/v0.1.0
88
+ documentation_uri: https://dazuma.github.io/toys/gems/toys-release/v0.1.1
89
89
  rdoc_options: []
90
90
  require_paths:
91
91
  - lib