tag-publish 1.3.0.dev10__tar.gz → 1.3.0.dev13__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tag-publish
3
- Version: 1.3.0.dev10
3
+ Version: 1.3.0.dev13
4
4
  Summary: Tools used to publish Python packages, Docker images and Helm charts for GitHub tag and branch
5
5
  License: FreeBSD
6
6
  License-File: LICENSE
@@ -96,7 +96,7 @@ include = [
96
96
  ]
97
97
  requires-python = ">=3.11"
98
98
  dependencies = ["PyYAML<7,>=6", "security-md<2,>=1", "githubkit<1,>=0"]
99
- version = "1.3.0.dev10"
99
+ version = "1.3.0.dev13"
100
100
 
101
101
  [project.optional-dependencies]
102
102
  pypi = ["requests<3,>=2", "twine<7,>=6", "id<2,>=1"]
@@ -294,23 +294,11 @@ def helm(
294
294
  try:
295
295
  chart_path = Path(folder) / "Chart.yaml"
296
296
  with chart_path.open(encoding="utf-8") as open_file:
297
- chart_content = open_file.read()
298
- chart = yaml.load(chart_content, Loader=yaml.SafeLoader)
297
+ chart = yaml.load(open_file, Loader=yaml.SafeLoader)
299
298
  chart_name = chart.get("name", "")
300
- # The version is updated with a targeted replacement to preserve the file formatting and comments
301
- new_chart_content, number_of_substitutions = re.subn(
302
- r"^version:.*$",
303
- f"version: {version}",
304
- chart_content,
305
- count=1,
306
- flags=re.MULTILINE,
307
- )
308
- if number_of_substitutions != 1:
309
- print("::endgroup::")
310
- print(f"::error::Unable to find the 'version' key in '{chart_path}'")
311
- return False
299
+ chart["version"] = version
312
300
  with chart_path.open("w", encoding="utf-8") as open_file:
313
- open_file.write(new_chart_content)
301
+ yaml.dump(chart, open_file, sort_keys=False)
314
302
  for index, dependency in enumerate(chart.get("dependencies", [])):
315
303
  if dependency["repository"].startswith("https://"):
316
304
  subprocess.run(["helm", "repo", "add", str(index), dependency["repository"]], check=True)