Skip to content

fix: publish script to only use root VERSION #268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.1
0.1.2
1 change: 0 additions & 1 deletion packages/config-bundles/polywrap-sys-config-bundle/VERSION

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion packages/plugins/polywrap-ethereum-wallet/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/plugins/polywrap-fs-plugin/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/plugins/polywrap-http-plugin/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-client-config-builder/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-client/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-core/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-manifest/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-msgpack/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-plugin/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-test-cases/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-uri-resolvers/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap-wasm/VERSION

This file was deleted.

1 change: 0 additions & 1 deletion packages/polywrap/VERSION

This file was deleted.

13 changes: 5 additions & 8 deletions scripts/publish_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
logger = ColoredLogger("PackagePublisher")


def extract_major_minor(version: str) -> str:
return ".".join(version.split(".")[:2] + ["0"])


def patch_version(version: str):
with open("pyproject.toml", "r") as f:
pyproject = tomlkit.load(f)
Expand All @@ -26,7 +22,7 @@ def patch_version(version: str):
for dep in list(pyproject["tool"]["poetry"]["dependencies"].keys()):
if dep.startswith("polywrap-"):
pyproject["tool"]["poetry"]["dependencies"].pop(dep)
pyproject["tool"]["poetry"]["dependencies"].add(dep, f"^{extract_major_minor(version)}")
pyproject["tool"]["poetry"]["dependencies"].add(dep, version)

with open("pyproject.toml", "w") as f:
tomlkit.dump(pyproject, f)
Expand Down Expand Up @@ -110,9 +106,10 @@ def publish_package(package: str, version: str) -> None:

root_dir = Path(__file__).parent.parent

with open(root_dir / "VERSION", "r") as f:
version = f.read().strip()

for package_dir in package_build_order():
package = package_dir.name
with ChangeDir(str(package_dir)):
with open("VERSION", "r") as f:
version = f.read().strip()
publish_package(package, version)
publish_package(package, version)