diff --git a/code/Makefile b/code/Makefile index 27f0bbf69..f6c8aef9d 100644 --- a/code/Makefile +++ b/code/Makefile @@ -2,20 +2,24 @@ include ../.devcontainer/tools.mk ESBONIO ?= --pre esbonio -.PHONY: dist dev-deps release-deps +.PHONY: dist dev-deps release-deps changelog release watch: dev-deps - -[ -d dist ] && rm -r dist + -test -d dist && rm -r dist $(NPM) run watch compile: dev-deps - -[ -d dist ] && rm -r dist + -test -d dist && rm -r dist $(NPM) run compile dist: release-deps - -[ -d dist ] && rm -r dist + -test -d dist && rm -r dist $(NPM) run package +release: $(TOWNCRIER) $(HATCH) $(PY) + $(PY) ../scripts/make_release.py lsp + $(PY) ../scripts/make_release.py vscode + # Ensures the version of esbonio in ../lib/esbonio is used. dev-deps: node_modules/.installed bundled/libs/.installed -test -d bundled/libs/esbonio-*.dist-info && rm -r bundled/libs/esbonio-*.dist-info diff --git a/lib/esbonio/Makefile b/lib/esbonio/Makefile index 66cdc77a3..358390165 100644 --- a/lib/esbonio/Makefile +++ b/lib/esbonio/Makefile @@ -4,3 +4,6 @@ include ../../.devcontainer/tools.mk dist: $(HATCH) $(HATCH) build + +release: $(TOWNCRIER) $(HATCH) $(PY) + $(PY) ../scripts/make_release.py lsp diff --git a/scripts/make_release.py b/scripts/make_release.py index ff7e201a8..c036b6813 100755 --- a/scripts/make_release.py +++ b/scripts/make_release.py @@ -6,6 +6,7 @@ - Commit, tag and push the new version (if it's a release) - Export the tag name and release date for use later on in the pipeline. """ + import argparse import io import json @@ -27,6 +28,8 @@ ENV = os.environ.get("GITHUB_ENV", "") STEP_SUMMARY = os.environ.get("GITHUB_STEP_SUMMARY", "") +REPO = pathlib.Path(__file__).parent.parent.resolve() + class Output: """An output destination that can be logged to. @@ -78,7 +81,7 @@ class Component(TypedDict): """The prefix to give to version bump commit messages for this component.""" src: str - """The directory containing the component, relative to repo root.""" + """The directory containing the component.""" tag_prefix: str """The prefix to give to tagged versions of this component.""" @@ -93,7 +96,7 @@ class Component(TypedDict): bump_minor="minor", bump_patch="patch", commit_prefix="Esbonio Extensions Release v", - src="lib/esbonio-extensions", + src=str(REPO / "lib/esbonio-extensions"), tag_prefix="esbonio-extensions-v", ), Component( @@ -103,7 +106,7 @@ class Component(TypedDict): bump_minor="b", bump_patch="b", commit_prefix="Esbonio Language Server Release v", - src="lib/esbonio", + src=str(REPO / "lib/esbonio"), tag_prefix="esbonio-language-server-v", ), Component( @@ -113,7 +116,7 @@ class Component(TypedDict): bump_minor="minor", bump_patch="patch", commit_prefix="Esbonio VSCode Extension Release v", - src="code", + src=str(REPO / "code"), tag_prefix="esbonio-vscode-extension-v", ), ]