Skip to content

Commit

Permalink
feat: release 0.2.0 (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
zifeo authored Oct 4, 2023
1 parent 1e61960 commit ecd4f87
Show file tree
Hide file tree
Showing 135 changed files with 481 additions and 456 deletions.
45 changes: 43 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ env:
POETRY_VERSION: "1.4.1"
DENO_VERSION: "1.37.1"
REGISTRY_IMAGE: ghcr.io/${{ github.repository_owner }}/typegate
WASM_TOOLS_VERSION: "1.0.37"
JCO_VERSION: "0.12.1"
WASMEDGE_VERSION: "0.12.1"
WASM_OPT_VERSION: "0.114.1"
PNPM_VERSION: "8.6.11"

jobs:
check-bump:
Expand Down Expand Up @@ -92,20 +97,56 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dsherret/rust-toolchain-file@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: ${{ runner.os }}-rust-${{ hashFiles('**/rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}
- uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ env.POETRY_VERSION }}
- uses: pnpm/[email protected]
with:
version: ${{ env.PNPM_VERSION }}
- uses: denoland/setup-deno@v1
with:
deno-version: ${{ env.DENO_VERSION }}
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- working-directory: typegraph/python
env:
- env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
WASM_FILE: target/release/typegraph_core.wasm
run: |
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -v $WASMEDGE_VERSION
export LD_LIBRARY_PATH="$HOME/.wasmedge/lib:$LD_LIBRARY_PATH"
cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked
cargo install wasm-opt --version $WASM_OPT_VERSION --locked
cargo build -p typegraph_core --target wasm32-unknown-unknown -F wasm --release
wasm-opt -Oz target/wasm32-unknown-unknown/release/typegraph_core.wasm -o $WASM_FILE.opt
wasm-tools component new $WASM_FILE.opt -o $WASM_FILE
poetry install
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen
cd typegraph/python
poetry install --sync
poetry build
poetry publish
cd ../..
cd typegraph/deno/src
deno run -A ../../../dev/publish.ts
cd ../../..
npm install --global @bytecodealliance/jco@$JCO_VERSION
jco transpile $WASM_FILE -o typegraph/deno/src/gen --map "*=../imports.ts"
deno run -A typegraph/deno/dev/fix-declarations.ts
cd typegraph/node
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
pnpm publish
- uses: svenstaro/upload-release-action@v2
with:
tag: ${{ github.ref }}
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ jobs:
run: |
python3 -m venv .venv
source .venv/bin/activate
cd typegraph/python_next
cd typegraph/python
poetry install --sync
cd ../..
Expand All @@ -172,8 +172,8 @@ jobs:
cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked
cargo build -p typegraph_core --target wasm32-unknown-unknown -F wasm
wasm-tools component new target/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE
rm -rf typegraph/python_next/typegraph_next/gen
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python_next/typegraph_next/gen
rm -rf typegraph/python/typegraph/gen
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen
cargo run --locked --package meta-cli -- --help
cargo test --locked --package meta-cli
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
run: |
python3 -m venv .venv
${{ matrix.activate }}
cd typegraph/python_next
cd typegraph/python
poetry install --sync
cd ../..
Expand All @@ -225,8 +225,8 @@ jobs:
cargo install wasm-tools --version $WASM_TOOLS_VERSION --locked
cargo build -p typegraph_core --target wasm32-unknown-unknown -F wasm
wasm-tools component new target/wasm32-unknown-unknown/debug/typegraph_core.wasm -o $WASM_FILE
rm -rf typegraph/python_next/typegraph_next/gen
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python_next/typegraph_next/gen
rm -rf typegraph/python/typegraph/gen
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen
cargo run --locked --package meta-cli -- --help
cargo test --locked --package meta-cli
Expand Down Expand Up @@ -326,8 +326,8 @@ jobs:
rm -rf typegraph/deno/src/gen
jco transpile $WASM_FILE -o typegraph/deno/src/gen --map "*=../imports.ts"
deno run -A typegraph/deno/dev/fix-declarations.ts
rm -rf typegraph/python_next/typegraph_next/gen
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python_next/typegraph_next/gen
rm -rf typegraph/python/typegraph/gen
poetry run python -m wasmtime.bindgen $WASM_FILE --out-dir typegraph/python/typegraph/gen
deno install -A -n deno_bindgen $DENO_BINDGEN_URL
OUT_DIR=target deno_bindgen -- --locked --package native -F deno
Expand Down Expand Up @@ -372,7 +372,7 @@ jobs:
tar -xvf meta.tar
python3 -m venv .venv
source .venv/bin/activate
cd typegraph/python_next
cd typegraph/python
poetry install --sync
cd ../..
cargo test --locked --exclude meta-cli --exclude native --exclude typegraph_core --workspace
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ coverage*

typegraph/node
typegraph/deno/src/gen
typegraph/python_next/typegraph_next/gen
typegraph/python/typegraph/gen

*.egg-info/
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,23 @@ repos:
rev: 3.6.0
hooks:
- id: commitizen
stages: [commit-msg]
stages:
- commit-msg
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
args: ["--locked"]
args:
- "--locked"
- id: clippy
args: ["--locked", "-F", "wasm", "--", "--deny", "warnings"]
args:
- "--locked"
- "-F"
- "wasm"
- "--"
- "--deny"
- "warnings"
- repo: local
hooks:
- id: deno-fmt
Expand Down
14 changes: 7 additions & 7 deletions Cargo.lock

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

12 changes: 7 additions & 5 deletions dev/lock.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dev:
files:
dev/LICENSE-MPL-2.0.md:
- typegraph/python_next/LICENSE.md
- typegraph/python/LICENSE.md
- typegraph/deno/LICENSE.md
lines:
rust-toolchain.toml:
Expand All @@ -17,9 +17,10 @@ dev:
'( WASM_TOOLS_VERSION: ").+(")': WASM_TOOLS_VERSION
'( JCO_VERSION: ").+(")': JCO_VERSION
'( WASMEDGE_VERSION: ").+(")': WASMEDGE_VERSION
typegraph/python_next/typegraph_next/__init__.py:
'( WASM_OPT_VERSION: ").+(")': WASM_OPT_VERSION
typegraph/python/typegraph/__init__.py:
(version = ").+("): METATYPE_VERSION
typegraph/python_next/pyproject.toml:
typegraph/python/pyproject.toml:
(description = ").+("): TAGLINE
'**/Cargo.toml':
(version = ").+("): METATYPE_VERSION
Expand All @@ -32,7 +33,7 @@ dev:
(ARG WASMEDGE_VERSION=).*(): WASMEDGE_VERSION
typegate/src/typegraph/versions.ts:
(const typegraphVersion = ").*(";): TYPEGRAPH_VERSION
typegraph/python_next/typegraph_next/graph/typegraph.py:
typegraph/python/typegraph/graph/typegraph.py:
(typegraph_version = ").*("): TYPEGRAPH_VERSION
typegraph/core/src/typegraph.rs:
'(static TYPEGRAPH_VERSION: &str = ").*(";)': TYPEGRAPH_VERSION
Expand Down Expand Up @@ -69,7 +70,8 @@ dev:
WASMEDGE_VERSION: 0.12.1
TYPEGRAPH_VERSION: 0.0.2
PRISMA_VERSION: 5.4.0-dev.31
METATYPE_VERSION: 0.2.0-alpha.1
METATYPE_VERSION: 0.2.0
WASM_OPT_VERSION: 0.114.1
TAGLINE: >-
Declarative API development platform. Build serverless backends with
zero-trust and less code, no matter where and how your (legacy) systems
Expand Down
2 changes: 1 addition & 1 deletion dev/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ await dnt.build({
packageManager: "pnpm",
package: {
name: "@typegraph/sdk",
version: "0.0.1", //lockfile.dev.lock.METATYPE_VERSION,
version: lockfile.dev.lock.METATYPE_VERSION,
description: lockfile.dev.lock.TAGLINE,
license: "MPL-2.0",
repository: {
Expand Down
8 changes: 4 additions & 4 deletions examples/demo/demo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typegraph_next import typegraph, Policy, t, Graph
from typegraph_next.graph.params import Auth, Rate
from typegraph_next.providers import PrismaRuntime
from typegraph_next.runtimes import DenoRuntime, HttpRuntime, PythonRuntime
from typegraph import typegraph, Policy, t, Graph
from typegraph.graph.params import Auth, Rate
from typegraph.providers import PrismaRuntime
from typegraph.runtimes import DenoRuntime, HttpRuntime, PythonRuntime


@typegraph(
Expand Down
4 changes: 2 additions & 2 deletions examples/templates/python/api/example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typegraph_next import typegraph, Policy, t, Graph
from typegraph_next.runtimes import PythonRuntime
from typegraph import typegraph, Policy, t, Graph
from typegraph.runtimes import PythonRuntime


@typegraph()
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/python/compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
typegate:
image: ghcr.io/metatypedev/typegate:v0.2.0-alpha.1
image: ghcr.io/metatypedev/typegate:v0.2.0
restart: always
ports:
- "7890:7890"
Expand Down
4 changes: 2 additions & 2 deletions examples/templates/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[tool.poetry]
name = "example"
version = "0.2.0-alpha.1"
version = "0.2.0"
description = ""
authors = []
readme = "README.md"

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
typegraph = "0.2.0-alpha.1"
typegraph = "0.2.0"

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 1 addition & 1 deletion libs/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "common"
version = "0.2.0-alpha.1"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion libs/macros/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "macros"
version = "0.2.0-alpha.1"
version = "0.2.0"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion libs/typescript/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "typescript"
version = "0.2.0-alpha.1"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion libs/xtask/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xtask"
version = "0.2.0-alpha.1"
version = "0.2.0"
edition = "2021"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion meta-cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "meta-cli"
version = "0.2.0-alpha.1"
version = "0.2.0"
edition = "2021"

description = "Declarative API development platform. Build serverless backends with zero-trust and less code, no matter where and how your (legacy) systems are."
Expand Down
4 changes: 2 additions & 2 deletions meta-cli/src/tests/typegraphs/codegen.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typegraph_next import typegraph, Policy, t, Graph
from typegraph_next.runtimes import DenoRuntime
from typegraph import typegraph, Policy, t, Graph
from typegraph.runtimes import DenoRuntime


@typegraph()
Expand Down
4 changes: 2 additions & 2 deletions meta-cli/src/tests/typegraphs/enum_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typegraph_next import t, typegraph, Graph
from typegraph_next.runtimes import DenoRuntime
from typegraph import t, typegraph, Graph
from typegraph.runtimes import DenoRuntime


@typegraph()
Expand Down
4 changes: 2 additions & 2 deletions meta-cli/src/tests/typegraphs/union_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typegraph_next import t, typegraph, Graph
from typegraph_next.runtimes import DenoRuntime
from typegraph import t, typegraph, Graph
from typegraph.runtimes import DenoRuntime


@typegraph()
Expand Down
4 changes: 2 additions & 2 deletions meta-cli/tests/e2e/typegraphs/validator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typegraph_next import typegraph, t, Graph
from typegraph_next.runtimes import DenoRuntime
from typegraph import typegraph, t, Graph
from typegraph.runtimes import DenoRuntime


@typegraph()
Expand Down
Loading

0 comments on commit ecd4f87

Please sign in to comment.