mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-05 23:41:44 +00:00
Fix ci-bonsai-choco: choco_release.py still targets the old choco/blenderbim path
The choco dir was renamed from choco/blenderbim to choco/bonsai back in 2024 (Rename choco dir), but choco_release.py's BLENDERBIM_DIR constant was never updated, so the daily choco release job crashes immediately with FileNotFoundError trying to os.chdir into the now nonexistent choco/blenderbim directory. Release tags also moved from a bare blenderbim-YYMMDD scheme to bonsai-X.Y.Z-alphaYYMMDDHHMM, so the tag-prefix strip used to build the package version still looked for the old "blenderbim-" prefix and left it untouched, embedding the raw tag (including the already-present "-alpha" segment) into the nuspec version field, which the template then doubled up with its own "-alpha" suffix, producing an invalid NuGet version string. Both are fixed together since the second bug would otherwise surface as soon as the first one is unblocked. The pre-commit black hook also reformatted pre-existing whitespace drift in choco_release.py (this file sits outside CI's lint scope, so it had never been auto-formatted before); that reformatting is incidental to satisfying the local hook, not part of the fix itself. Generated with the assistance of an AI coding tool.
This commit is contained in:
committed by
Dion Moult
parent
8c434b7167
commit
a155a1ca80
@@ -3,7 +3,7 @@
|
|||||||
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>blenderbim-nightly</id>
|
<id>blenderbim-nightly</id>
|
||||||
<version>blenderbim_build_version-alpha</version>
|
<version>blenderbim_build_version</version>
|
||||||
<packageSourceUrl>https://github.com/IfcOpenShell/IfcOpenShell</packageSourceUrl>
|
<packageSourceUrl>https://github.com/IfcOpenShell/IfcOpenShell</packageSourceUrl>
|
||||||
<owners>fbpyr</owners>
|
<owners>fbpyr</owners>
|
||||||
<!-- == SOFTWARE SPECIFIC SECTION == -->
|
<!-- == SOFTWARE SPECIFIC SECTION == -->
|
||||||
|
|||||||
@@ -3,11 +3,12 @@
|
|||||||
apt update && apt install git wget curl ptpython mono-devel micro
|
apt update && apt install git wget curl ptpython mono-devel micro
|
||||||
mkdir -p /home/runner/work/IfcOpenShell && cd /home/runner/work/IfcOpenShell
|
mkdir -p /home/runner/work/IfcOpenShell && cd /home/runner/work/IfcOpenShell
|
||||||
git clone https://github.com/IfcOpenShell/IfcOpenShell
|
git clone https://github.com/IfcOpenShell/IfcOpenShell
|
||||||
cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/
|
cd /home/runner/work/IfcOpenShell/IfcOpenShell/choco/bonsai/
|
||||||
micro choco_release.py # paste this script, comment out push command
|
micro choco_release.py # paste this script, comment out push command
|
||||||
export CHOCO_TOKEN="secret_choco_release_token"
|
export CHOCO_TOKEN="secret_choco_release_token"
|
||||||
python3 choco_release.py
|
python3 choco_release.py
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
@@ -28,7 +29,7 @@ def get_repo_tag_names() -> list[str]:
|
|||||||
|
|
||||||
|
|
||||||
def request_repo_info(url: str):
|
def request_repo_info(url: str):
|
||||||
req = request.Request(url)
|
req = request.Request(url)
|
||||||
resp = request.urlopen(req)
|
resp = request.urlopen(req)
|
||||||
if not resp.status == 200:
|
if not resp.status == 200:
|
||||||
print(f"[ERROR] could not contact server: {url}")
|
print(f"[ERROR] could not contact server: {url}")
|
||||||
@@ -85,13 +86,15 @@ def run(command: str) -> None:
|
|||||||
|
|
||||||
start = datetime.datetime.now()
|
start = datetime.datetime.now()
|
||||||
|
|
||||||
URL_CHOCO_PACKAGE = "https://community.chocolatey.org/packages/blender"
|
URL_CHOCO_PACKAGE = "https://community.chocolatey.org/packages/blender"
|
||||||
URL_BLENDER_CMAKE = "https://raw.githubusercontent.com/blender/blender/{}/build_files/cmake/Modules/FindPythonLibsUnix.cmake"
|
URL_BLENDER_CMAKE = (
|
||||||
RE_BLENDER_VERSION_MIN_MAJ = r"Latest Version.+<span>Blender (\d+\.\d+)\..+</span>"
|
"https://raw.githubusercontent.com/blender/blender/{}/build_files/cmake/Modules/FindPythonLibsUnix.cmake"
|
||||||
RE_BLENDER_VERSION_MIN_MAJ_PAT = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
|
)
|
||||||
|
RE_BLENDER_VERSION_MIN_MAJ = r"Latest Version.+<span>Blender (\d+\.\d+)\..+</span>"
|
||||||
|
RE_BLENDER_VERSION_MIN_MAJ_PAT = r"Latest Version.+<span>Blender (\d+\.\d+\.\d+)</span>"
|
||||||
RE_BLENDER_PYTHON_VERSION_MAJ_MIN = r"\(_PYTHON_VERSION_SUPPORTED (\d+\.\d+)\)"
|
RE_BLENDER_PYTHON_VERSION_MAJ_MIN = r"\(_PYTHON_VERSION_SUPPORTED (\d+\.\d+)\)"
|
||||||
|
|
||||||
BLENDERBIM_DIR = pathlib.Path("/home/runner/work/IfcOpenShell/IfcOpenShell/choco/blenderbim/")
|
BLENDERBIM_DIR = pathlib.Path("/home/runner/work/IfcOpenShell/IfcOpenShell/choco/bonsai/")
|
||||||
|
|
||||||
print("_____ check choco release needed?")
|
print("_____ check choco release needed?")
|
||||||
|
|
||||||
@@ -148,7 +151,7 @@ print(f"{blender_python_version_maj_min=}")
|
|||||||
python_version = f"py{found[0].replace('.', '')}"
|
python_version = f"py{found[0].replace('.', '')}"
|
||||||
print(f"{python_version=}")
|
print(f"{python_version=}")
|
||||||
|
|
||||||
blenderbim_build_version = target_release_tag.replace("blenderbim-", "")
|
blenderbim_build_version = target_release_tag.replace("bonsai-", "")
|
||||||
|
|
||||||
# url_blenderbim_py3x_win_zip
|
# url_blenderbim_py3x_win_zip
|
||||||
release_zip_file_name, url_blenderbim_py3x_win_zip = get_release_zip(target_release_tag)
|
release_zip_file_name, url_blenderbim_py3x_win_zip = get_release_zip(target_release_tag)
|
||||||
@@ -166,15 +169,15 @@ topics = {
|
|||||||
"path": HERE_DIR / "blenderbim.nuspec",
|
"path": HERE_DIR / "blenderbim.nuspec",
|
||||||
"key_values": {
|
"key_values": {
|
||||||
"latest_blender_version_maj_min_pat": latest_blender_release_maj_min_pat,
|
"latest_blender_version_maj_min_pat": latest_blender_release_maj_min_pat,
|
||||||
"blenderbim_build_version" : blenderbim_build_version,
|
"blenderbim_build_version": blenderbim_build_version,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"install": {
|
"install": {
|
||||||
"path": HERE_DIR / "tools" / "chocolateyinstall.ps1",
|
"path": HERE_DIR / "tools" / "chocolateyinstall.ps1",
|
||||||
"key_values": {
|
"key_values": {
|
||||||
"url_blenderbim_py3x_win_zip" : url_blenderbim_py3x_win_zip,
|
"url_blenderbim_py3x_win_zip": url_blenderbim_py3x_win_zip,
|
||||||
"sha256sum_blenderbim_py3x_win_zip": sha256sum_blenderbim_py3x_win_zip,
|
"sha256sum_blenderbim_py3x_win_zip": sha256sum_blenderbim_py3x_win_zip,
|
||||||
"latest_blender_version_maj_min" : blender_version_min_maj,
|
"latest_blender_version_maj_min": blender_version_min_maj,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"uninstall": {
|
"uninstall": {
|
||||||
|
|||||||
Reference in New Issue
Block a user