Skip to content

Commit

Permalink
devenv: Add make release target
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed May 3, 2024
1 parent 4a8786f commit 27cd03b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion code/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include ../.devcontainer/tools.mk

ESBONIO ?= --pre esbonio

.PHONY: dist dev-deps release-deps
.PHONY: dist dev-deps release-deps release

watch: dev-deps $(NPM)
-test -d dist && rm -r dist
Expand All @@ -16,6 +16,10 @@ dist: release-deps $(NPM)
-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
Expand Down
3 changes: 3 additions & 0 deletions lib/esbonio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ include ../../.devcontainer/tools.mk

dist: $(HATCH)
$(HATCH) build

release: $(TOWNCRIER) $(HATCH) $(PY)
$(PY) ../scripts/make_release.py lsp
11 changes: 7 additions & 4 deletions scripts/make_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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."""
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -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",
),
]
Expand Down

0 comments on commit 27cd03b

Please sign in to comment.