Skip to content
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
26 changes: 18 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:
types: [published]

permissions:
contents: read
id-token: write # Required for OIDC trusted publishing to PyPI
contents: write # Required for creating releases

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -77,13 +76,23 @@ jobs:
echo "✅ bindings/wasm/package.json: $NPM_VERSION"
fi

# Check Cargo.lock
LOCK_VERSION=$(grep -A1 '^name = "kya-validator"$' Cargo.lock | grep '^version =' | head -1 | sed 's/.*"\(.*\)".*/\1/')
if [ "$LOCK_VERSION" != "$RELEASE_VERSION" ]; then
echo "❌ Cargo.lock: $LOCK_VERSION (expected $RELEASE_VERSION)"
ERRORS=1
else
echo "✅ Cargo.lock: $LOCK_VERSION"
fi

if [ $ERRORS -eq 1 ]; then
echo ""
echo "⚠️ Version mismatch detected!"
echo "Please update all manifest files before creating release:"
echo " - Cargo.toml"
echo " - pyproject.toml"
echo " - bindings/wasm/package.json"
echo " - Cargo.lock (run: cargo update -p kya-validator)"
exit 1
fi

Expand Down Expand Up @@ -173,16 +182,14 @@ jobs:
echo "Package: https://www.npmjs.com/package/@open-kya/kya-validator-wasm" >> $GITHUB_STEP_SUMMARY

# Publish Python wheels to PyPI (Linux + macOS ARM64)
# Uses token-based authentication (PYPI_TOKEN secret)
publish-pypi:
name: Publish to PyPI (${{ matrix.os }})
needs: prepare
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
environment:
name: pypi
url: https://pypi.org/p/kya-validator
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -206,9 +213,12 @@ jobs:
uv run maturin build --release

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: target/wheels
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
uv pip install twine
uv run twine upload target/wheels/*.whl

- name: Summary
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[package]
name = "kya-validator"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
description = "Rust core KYA (Know Your Agent) validator with Python bindings, TEE support, and blockchain integration"
license = "MPL-2.0"
Expand Down
44 changes: 43 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# kya-validator/Makefile
PYTHON ?= $(shell (pyenv which python >/dev/null 2>&1 && pyenv which python) || which python3)

.PHONY: build test fmt lint python release verify demo-install demo-backend demo-frontend run fix-verify install-tools clean get-lastest-schema install
.PHONY: build test fmt lint python release verify demo-install demo-backend demo-frontend run fix-verify install-tools clean get-lastest-schema install check-version sync-version

# Schema URL (raw content URL for downloading)
# TODO: Update this URL when the Open KYA standard repo is available
Expand Down Expand Up @@ -38,6 +38,48 @@ release: build
install-tools:
uv tool install maturin

# Check that all version files are synchronized
check-version:
@echo "Checking version consistency across all manifest files..."
@CARGO_VERSION=$$(grep '^version =' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/'); \
PYPROJECT_VERSION=$$(grep '^version =' pyproject.toml | head -1 | sed 's/.*"\(.*\)".*/\1/'); \
NPM_VERSION=$$(grep '"version":' bindings/wasm/package.json | head -1 | sed 's/.*: *"\([^"]*\)".*/\1/'); \
LOCK_VERSION=$$(grep -A1 '^name = "kya-validator"$$' Cargo.lock | grep '^version =' | head -1 | sed 's/.*"\(.*\)".*/\1/'); \
ERRORS=0; \
echo ""; \
echo "Cargo.toml: $$CARGO_VERSION"; \
echo "pyproject.toml: $$PYPROJECT_VERSION"; \
echo "package.json: $$NPM_VERSION"; \
echo "Cargo.lock: $$LOCK_VERSION"; \
echo ""; \
if [ "$$CARGO_VERSION" != "$$PYPROJECT_VERSION" ]; then \
echo "❌ Cargo.toml != pyproject.toml"; \
ERRORS=1; \
fi; \
if [ "$$CARGO_VERSION" != "$$NPM_VERSION" ]; then \
echo "❌ Cargo.toml != package.json"; \
ERRORS=1; \
fi; \
if [ "$$CARGO_VERSION" != "$$LOCK_VERSION" ]; then \
echo "❌ Cargo.toml != Cargo.lock (run: make sync-version)"; \
ERRORS=1; \
fi; \
if [ $$ERRORS -eq 1 ]; then \
echo ""; \
echo "⚠️ Version mismatch detected!"; \
echo "Run 'make sync-version' to sync Cargo.lock"; \
echo "Manually update Cargo.toml, pyproject.toml, and package.json to match"; \
exit 1; \
fi; \
echo "✅ All versions match: $$CARGO_VERSION"

# Sync Cargo.lock with Cargo.toml version
sync-version:
@echo "Syncing Cargo.lock..."
@cargo update -p kya-validator
@echo "✅ Cargo.lock updated"
@$(MAKE) check-version

demo-install:
$(MAKE) -C apps/demo_backend install

Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@open-kya/kya-validator-wasm",
"version": "0.2.2",
"version": "0.2.3",
"description": "WebAssembly bindings for KYA (Know Your Agent) Validator - browser and Node.js",
"keywords": [
"kya",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# kya-validator/pyproject.toml
[project]
name = "kya-validator"
version = "0.2.2"
version = "0.2.3"
description = "Rust core KYA (Know Your Agent) validator with Python bindings, TEE support, and blockchain integration"
authors = [{name = "KYA Contributors", email = "lkl@cph.ai"}]
readme = "README.md"
Expand Down