Release System: Auto Update 'Addon Table' URLs & Upload Addon Zips #123

Closed
Nick Alberelli wants to merge 3 commits from (deleted):feature/release-system-atuo-update-table into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
32 changed files with 90 additions and 10 deletions

1
.gitattributes vendored
View File

@ -2,3 +2,4 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored
View File

@ -8,7 +8,6 @@ __pycache__/
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/

View File

@ -0,0 +1 @@
a1794a7d12f2bb2d49302e682099608fb310b62c6873ef5c1e514cbf0be4d6b2 anim_cupboard-0.0.2.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a1794a7d12f2bb2d49302e682099608fb310b62c6873ef5c1e514cbf0be4d6b2
size 23182

View File

@ -0,0 +1 @@
498847bca3ae34f840ac61682352f5e3c4f38ccbdf0f41f5a845ac9fb5c51b08 asset_pipeline-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:498847bca3ae34f840ac61682352f5e3c4f38ccbdf0f41f5a845ac9fb5c51b08
size 102540

View File

@ -0,0 +1 @@
3f35f32efaa935830db5a22d9ee03006b64d613a345194c89f17e3c18ac75b6c blender_kitsu-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3f35f32efaa935830db5a22d9ee03006b64d613a345194c89f17e3c18ac75b6c
size 429579

View File

@ -0,0 +1 @@
65631c02457dc2e90431da92b2ea848722a4e2d7e496e310b24cfee933d137e8 blender_svn-0.2.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65631c02457dc2e90431da92b2ea848722a4e2d7e496e310b24cfee933d137e8
size 332860

View File

@ -0,0 +1 @@
f2d5eb1aa152e0a2b23cadd76003f4845039bc4c1f14bd069785c45ebebfc050 bone_gizmos-0.0.2.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f2d5eb1aa152e0a2b23cadd76003f4845039bc4c1f14bd069785c45ebebfc050
size 30072

View File

@ -0,0 +1 @@
ad08e6c186dae1619d692c049af4c9fd1a529fa7973f31054637d804cd38d7af cache_manager-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ad08e6c186dae1619d692c049af4c9fd1a529fa7973f31054637d804cd38d7af
size 46469

View File

@ -0,0 +1 @@
9b598006dca3489db5949ead90ad181e7cb50b3ec9739bcc6a06b41ec5b34dee contactsheet-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9b598006dca3489db5949ead90ad181e7cb50b3ec9739bcc6a06b41ec5b34dee
size 33473

View File

@ -0,0 +1 @@
84e6a59d9a2381bac5dc85ca504c707560e5d74d4399773b0cf8e5f674a6ac01 easy_weights-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:84e6a59d9a2381bac5dc85ca504c707560e5d74d4399773b0cf8e5f674a6ac01
size 30507

View File

@ -0,0 +1 @@
2f6cadfa3287672ba796e490909da875b0240e7f3174b7c1fefdb18c887443ca geonode_shapekeys-0.0.2.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2f6cadfa3287672ba796e490909da875b0240e7f3174b7c1fefdb18c887443ca
size 225768

View File

@ -0,0 +1 @@
add974faba7c26f7e5342ad0b50e62ec08dc7f7441f71565ddbd95354e60998e grease_converter-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:add974faba7c26f7e5342ad0b50e62ec08dc7f7441f71565ddbd95354e60998e
size 4904

View File

@ -0,0 +1 @@
4e9e25a50c820f38f88979d070834051860b61df96053df68d592b5a1aa052f5 lattice_magic-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4e9e25a50c820f38f88979d070834051860b61df96053df68d592b5a1aa052f5
size 16785

View File

@ -0,0 +1 @@
616a03fed057c5009a7f6382dca1e5cdee6f82f829c8ed7be894b8e2e0ab6afd lighting_overrider-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:616a03fed057c5009a7f6382dca1e5cdee6f82f829c8ed7be894b8e2e0ab6afd
size 28911

View File

@ -0,0 +1 @@
086f6c7723a0ce4c32e58a6c239c8e07f0dca095e8b53742f930362c3ab4204f pose_shape_keys-0.0.2.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:086f6c7723a0ce4c32e58a6c239c8e07f0dca095e8b53742f930362c3ab4204f
size 30784

View File

@ -0,0 +1 @@
ce1aaf7eeb386ad9e0e846f3646d1e5a927b8c6ad65d33494324bf189edb2f6b render_review-0.1.1.zip

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ce1aaf7eeb386ad9e0e846f3646d1e5a927b8c6ad65d33494324bf189edb2f6b
size 42221

View File

@ -5,17 +5,17 @@ Add-ons used by the Blender Studio pipeline. Download the latest addons releases
| Add-on | Description | Version | Checksum |
|---|---|---|---|
|[Anim Cupboard](../addons/anim_cupboard) |Miscellaneous tools for animators. | [v0.0.2](../download/anim_cupboard/anim_cupboard-0.0.2.zip) |[SHA256](../download/anim_cupboard/anim_cupboard-0.0.2.sha256)|
|[Anim Cupboard](../addons/anim_cupboard) |Miscellaneous tools for animators. |[v0.0.2](../download/anim_cupboard/anim_cupboard-0.0.2.zip) |[SHA256](../download/anim_cupboard/anim_cupboard-0.0.2.sha256)|
|[Asset Pipeline](../addons/asset_pipeline ) |Manages the Asset Pipeline, used by Modeling, Shading and Rigging departments. |[v0.1.1](../download/asset_pipeline/asset_pipeline-0.1.1.zip) |[SHA256](../download/asset_pipeline/asset_pipeline-0.1.1.sha256)|
|[Blender Kitsu](../addons/blender_kitsu )|Enforce conventions, build shots, manage production files and update data on kitsu server. |[v0.1.1](../download/blender_kitsu/blender_kitsu-0.1.1.zip) |[SHA256](../download/blender_kitsu/blender_kitsu-0.1.1.sha256)|
|[Blender SVN](../addons/blender_svn ) |UI for the SVN (Subversion) file versioning system. | [v0.2.1](../download/blender_svn/blender_svn-0.2.1.zip) |[SHA256](../download/blender_svn/blender_svn-0.2.1.sha256)|
|[Blender SVN](../addons/blender_svn ) |UI for the SVN (Subversion) file versioning system. |[v0.2.1](../download/blender_svn/blender_svn-0.2.1.zip) |[SHA256](../download/blender_svn/blender_svn-0.2.1.sha256)|
|[Blender Gizmos](../addons/bone_gizmos )|Attempt to prototype a system for using meshes for the manipulation of armatures. |[v0.0.2](../download/bone_gizmos/bone_gizmos-0.0.2.zip) |[SHA256](../download/bone_gizmos/bone_gizmos-0.0.2.sha256)|
|[Cache Manager](../addons/cache_manager ) |Streamline the Alembic cache workflow of assets. |[v0.2.1](../download/cache_manager/cache_manager-0.1.1.zip) |[SHA256](../download/cache_manager/cache_manager-0.1.1.sha256)|
|[Contact Sheet](../addons/contactsheet ) |Create a contactsheet from sequence editor strips. | [v0.1.1](../download/contactsheet/contactsheet-0.1.1.zip) |[SHA256](../download/contactsheet/contactsheet-0.1.1.sha256)|
|[Contact Sheet](../addons/contactsheet ) |Create a contactsheet from sequence editor strips. |[v0.1.1](../download/contactsheet/contactsheet-0.1.1.zip) |[SHA256](../download/contactsheet/contactsheet-0.1.1.sha256)|
|[Easy Weights](../addons/easy_weights ) |Quality of life improvements for weight painting. |[v0.1.1](../download/easy_weights/easy_weights-0.1.1.zip) |[SHA256](../download/easy_wights/easy_wights-0.1.1.sha256)|
|[Geonode Shapekeys](../addons/geonode_shapekeys ) |Enable animators to sculpt on linked and overridden meshes. | [v0.0.2](../download/geonode_shapekeys/geonode_shapekeys-0.0.2.zip) |[SHA256](../download/geonode_shapekeys/geonode_shapekeys-0.0.2.sha256)|
|[Geonode Shapekeys](../addons/geonode_shapekeys ) |Enable animators to sculpt on linked and overridden meshes. |[v0.0.2](../download/geonode_shapekeys/geonode_shapekeys-0.0.2.zip) |[SHA256](../download/geonode_shapekeys/geonode_shapekeys-0.0.2.sha256)|
|[Grease Converter](../addons/grease_converter ) |Convert annotations to Grease Pencil objects and vise versa. |[v0.1.1](../download/grease_converter/grease_converter-0.1.1.zip) |[SHA256](../download/grease_converter/grease_converter-0.1.1.sha256)|
|[Lattice Magic](../addons/lattice_magic ) |Lattice-based utilities. |[v0.1.1](../download/lattice_magic/lattice_magic-0.1.1.zip) |[SHA256](../download/lattice_magic/lattice_magic-0.1.1.sha256)|
|[Lighting Overrider](../addons/lighting_overrider ) |Create, manage and apply python overrides in a flexible and reliable way. | [v0.1.1](../download/lighting_overrider/lighting_overrider-0.1.1.zip) |[SHA256](download/lighting_overrider/lighting_overrider-0.1.1.sha256)|
|[Lighting Overrider](../addons/lighting_overrider ) |Create, manage and apply python overrides in a flexible and reliable way. |[v0.1.1](../download/lighting_overrider/lighting_overrider-0.1.1.zip) |[SHA256](download/lighting_overrider/lighting_overrider-0.1.1.sha256)|
|[Pose Shape Keys](../addons/pose_shape_keys )|Manage and maintain shapekeys for rigging. |[v0.0.2](../download/pose_shape_keys/pose_shape_keys-0.0.2.zip) |[SHA256](../download/pose_shape_keys/pose_shape_keys-0.0.2.sha256)|
|[Render Review](../addons/render_review ) |Review renders from Flamenco with the sequence editor. |[v0.1.1](../download/render_review/render_review-0.1.1.zip) |[SHA256](../download/render_review/render_review-0.1.1.sha256)|

View File

@ -124,6 +124,17 @@ def write_file(file_path: Path, content):
file.close()
def replace_line(file_path: Path, new_line: str, line_number: int):
file = open(
file_path,
)
lines = file.readlines()
lines[line_number] = new_line
out = open(file_path, 'w')
out.writelines(lines)
out.close()
def get_directory(repo_root: Path, folder_name: str) -> Path:
"""Returns directory PATH, creates one if none exists"""
path = repo_root.joinpath(folder_name)
@ -263,6 +274,20 @@ def changelog_file_write(file_path: Path, content: str):
return file_path
def update_release_table(addon_dir: Path, version: str):
table_file = addon_dir.parent.parent.joinpath("README.md")
with open(table_file, 'r') as myFile:
for num, line in enumerate(myFile):
if addon_dir.name in line:
line_to_replace = num
break # Use first line found
splitted_line = line.split("|[v")
version_bump_text = splitted_line[1].replace(splitted_line[1][0:5], version)
new_line = line[: len(splitted_line[0]) + 3] + version_bump_text
replace_line(table_file, new_line, line_to_replace)
return table_file
def addon_package(directory: Path, commit_prefix: str, is_major=False, force=False):
"""
For a give directory, if new commits are found after the commit matching 'commit_prefix',
@ -282,9 +307,11 @@ def addon_package(directory: Path, commit_prefix: str, is_major=False, force=Fal
change_log_file = changelog_file_write(
directory.joinpath("CHANGELOG.md"), change_log
)
table_file = update_release_table(directory, version)
cli_command(f'git reset')
cli_command(f'git stage {change_log_file}')
cli_command(f'git stage {init_file}')
cli_command(f'git stage {table_file}')
subprocess.run(
['git', 'commit', '-m', f"Version Bump: {directory.name} {version}"],
capture_output=True,
@ -352,10 +379,7 @@ def addon_version_bump(directory: Path, is_major: bool):
lines = file.readlines()
version = addon_version_get(lines[version_line], is_major)
repl_str = f' "version": ({version}),\n'
lines[version_line] = repl_str
out = open(init_file, 'w')
out.writelines(lines)
out.close()
replace_line(init_file, repl_str, version_line)
return init_file, version.replace(', ', '.').replace(',', '.')