Skip to content

Commit

Permalink
ci(build): Release 0.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fangyinc committed Nov 4, 2024
1 parent e89f26a commit b6dd817
Show file tree
Hide file tree
Showing 12 changed files with 150 additions and 26 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/release-python-task.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Release Python Packages

on:
release:
types: [published]
push:
branches:
- main
- master
pull_request:
# release:
# types: [published]
# push:
# branches:
# - main
# - master
# pull_request:
workflow_dispatch:

permissions:
Expand Down
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ default-members = [
]

[workspace.package]
version = "0.1.2"
version = "0.1.3"
authors = ["fangyinc <[email protected]>"]
edition = "2021"
homepage = "https://github.com/fangyinc/lyric"
Expand Down Expand Up @@ -44,8 +44,8 @@ tokio-stream = { version = "0.1.16", features = ["io-util"] }
pyo3 = { version = "0.22.5" }
python3-dll-a = "0.2.10"

lyric = { version = "0.1.2", path = "crates/lyric", default-features = false }
lyric-utils = { version = "0.1.2", path = "crates/lyric-utils", default-features = false }
lyric-rpc = { version = "0.1.2", path = "crates/lyric-rpc", default-features = false }
lyric-wasm-runtime = { version = "0.1.2", path = "crates/lyric-wasm-runtime", default-features = false }
lyric-py = { version = "0.1.2", path = "bindings/python/lyric-py", default-features = false }
lyric = { version = "0.1.3", path = "crates/lyric", default-features = false }
lyric-utils = { version = "0.1.3", path = "crates/lyric-utils", default-features = false }
lyric-rpc = { version = "0.1.3", path = "crates/lyric-rpc", default-features = false }
lyric-wasm-runtime = { version = "0.1.3", path = "crates/lyric-wasm-runtime", default-features = false }
lyric-py = { version = "0.1.3", path = "bindings/python/lyric-py", default-features = false }
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ A Rust-powered secure sandbox for multi-language code execution, leveraging WebA
**Install Lyric via pip:**

```bash
pip install lyric-py
pip install "lyric-py>=0.1.3"
```

**Install default Python webassembly worker:**

```bash
pip install lyric-py-worker
pip install "lyric-py-worker>=0.1.3"
```

**Install default JavaScript webassembly worker:**

```bash
pip install lyric-js-worker
pip install "lyric-js-worker>=0.1.3"
```

### Basic Usage
Expand Down
59 changes: 59 additions & 0 deletions bindings/python/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
.DEFAULT_GOAL := help

# Define subproject paths
PY_WORKER_DIR = lyric-py-worker
JS_WORKER_DIR = lyric-js-worker
TASK_WORKER_DIR = lyric-task

.PHONY: all
all: build ## Build all subprojects

.PHONY: build
build: build-task build-py-worker build-js-worker ## Build all subprojects

.PHONY: build-task
build-task: ## Build the task dependency
@echo "Building task..."
$(MAKE) -C $(TASK_WORKER_DIR) build

.PHONY: build-py-worker
build-py-worker: ## Build the Python worker
@echo "Building Python worker..."
$(MAKE) -C $(PY_WORKER_DIR) build


.PHONY: build-js-worker
build-js-worker: ## Build the JavaScript worker
@echo "Building JavaScript worker..."
$(MAKE) -C $(JS_WORKER_DIR) build

.PHONY: clean
clean: ## Clean all projects
@echo "Cleaning all projects..."
rm -rf dist


.PHONY: publish-pypi
publish-pypi: build ## Publish all packages to PyPI
@echo "Publishing to PyPI..."
@if [ -z "$(TWINE_USERNAME)" ] || [ -z "$(TWINE_PASSWORD)" ]; then \
echo "Error: TWINE_USERNAME and TWINE_PASSWORD environment variables must be set"; \
exit 1; \
fi
@echo "Uploading all distributions from dist/"
twine upload dist/*

.PHONY: publish-testpypi
publish-testpypi: build ## Publish all packages to TestPyPI
@echo "Publishing to TestPyPI..."
@if [ -z "$(TWINE_USERNAME)" ] || [ -z "$(TWINE_PASSWORD)" ]; then \
echo "Error: TWINE_USERNAME and TWINE_PASSWORD environment variables must be set"; \
exit 1; \
fi
@echo "Uploading all distributions from dist/"
rye run twine upload --repository testpypi dist/*

.PHONY: help
help: ## Display this help screen
@echo "Available commands:"
@grep -E '^[a-z.A-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}' | sort
2 changes: 1 addition & 1 deletion bindings/python/lyric-js-worker/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lyric-js-worker"
version = "0.1.2-rc1"
version = "0.1.3"
description = "Add your description here"
authors = [
{ name = "Fangyin Cheng", email = "[email protected]" },
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/lyric-py-worker/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lyric-py-worker"
version = "0.1.2-rc1"
version = "0.1.3"
description = "Add your description here"
authors = [
{ name = "Fangyin Cheng", email = "[email protected]" },
Expand Down
5 changes: 5 additions & 0 deletions bindings/python/lyric-task/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DEFAULT_GOAL := help

.PHONY: build
build:
rye build
2 changes: 1 addition & 1 deletion bindings/python/lyric-task/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "lyric-task"
version = "0.1.2-rc1"
version = "0.1.3"
description = "Add your description here"
authors = [
{ name = "Fangyin Cheng", email = "[email protected]" },
Expand Down
5 changes: 3 additions & 2 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "python"
version = "0.1.2"
version = "0.1.3"
description = "Add your description here"
authors = [
{ name = "Fangyin Cheng", email = "[email protected]" }
Expand All @@ -19,7 +19,8 @@ dev-dependencies = [
"pytest>=7.0.0",
"black>=23.0.0",
"isort>=5.0.0",
"maturin>=1.7,<2.0"
"maturin>=1.7,<2.0",
"twine"
]

[tool.rye.workspace]
Expand Down
53 changes: 53 additions & 0 deletions bindings/python/requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,90 @@
-e file:lyric-task
# via lyric-py
# via lyric-py-worker
backports-tarfile==1.2.0
# via jaraco-context
black==24.10.0
certifi==2024.8.30
# via requests
charset-normalizer==3.4.0
# via requests
click==8.1.7
# via black
cloudpickle==3.1.0
# via lyric-py
componentize-py==0.15.2
docutils==0.21.2
# via readme-renderer
exceptiongroup==1.2.2
# via pytest
idna==3.10
# via requests
importlib-metadata==8.5.0
# via keyring
# via twine
iniconfig==2.0.0
# via pytest
isort==5.13.2
jaraco-classes==3.4.0
# via keyring
jaraco-context==6.0.1
# via keyring
jaraco-functools==4.1.0
# via keyring
keyring==25.5.0
# via twine
markdown-it-py==3.0.0
# via rich
maturin==1.7.4
mdurl==0.1.2
# via markdown-it-py
more-itertools==10.5.0
# via jaraco-classes
# via jaraco-functools
msgpack==1.1.0
# via lyric-py
mypy-extensions==1.0.0
# via black
nh3==0.2.18
# via readme-renderer
packaging==24.1
# via black
# via pytest
pathspec==0.12.1
# via black
pip==24.3.1
pkginfo==1.10.0
# via twine
platformdirs==4.3.6
# via black
pluggy==1.5.0
# via pytest
pygments==2.18.0
# via readme-renderer
# via rich
pytest==8.3.3
readme-renderer==44.0
# via twine
requests==2.32.3
# via requests-toolbelt
# via twine
requests-toolbelt==1.0.0
# via twine
rfc3986==2.0.0
# via twine
rich==13.9.4
# via twine
tomli==2.0.2
# via black
# via maturin
# via pytest
tomli-w==1.1.0
twine==5.1.1
typing-extensions==4.12.2
# via black
# via rich
urllib3==2.2.3
# via requests
# via twine
zipp==3.20.2
# via importlib-metadata
6 changes: 6 additions & 0 deletions crates/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ publish:
cargo publish --allow-dirty --registry crates-io -p lyric-rpc
sleep 20

cargo publish --allow-dirty --registry crates-io -p lyric-wasm-runtime
sleep 20

cargo publish --allow-dirty --registry crates-io -p lyric
sleep 20

Expand All @@ -33,5 +36,8 @@ publish-dry-run:
cargo publish --dry-run --allow-dirty --registry crates-io -p lyric-rpc
sleep 20

cargo publish --dry-run --allow-dirty --registry crates-io -p lyric-wasm-runtime
sleep 20

cargo publish --dry-run --allow-dirty --registry crates-io -p lyric
sleep 20

0 comments on commit b6dd817

Please sign in to comment.