Skip to content
Open
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
33 changes: 32 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Python SDK & .NET SDK
name: Publish Rust crates, Python SDK & .NET SDK

on:
push:
Expand All @@ -12,6 +12,7 @@ on:
type: choice
options:
- all
- rust
- python
- dotnet
default: all
Expand All @@ -20,6 +21,36 @@ permissions:
contents: read

jobs:
# Publish public Rust crates in workspace dependency order.
rust-publish:
if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'rust') }}
name: Publish Rust crates
runs-on: ubuntu-latest
environment:
name: crates-io
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0
with:
cache-key: release
rustflags: ""

- name: Authenticate with crates.io
uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5
id: crates-io-auth

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token }}
run: |
cargo publish --locked -p hyperlight-sandbox
cargo publish --locked -p hyperlight-wasm-sandbox
cargo publish --locked -p hyperlight-javascript-sandbox

# Build all Python packages on Linux for glibc 2.28 and newer.
build-linux:
if: ${{ !github.event.act && (github.event_name != 'workflow_dispatch' || inputs.publish_target == 'all' || inputs.publish_target == 'python') }}
Expand Down
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ version = "0.6.0"
edition = "2024"
rust-version = "1.94"
license = "Apache-2.0"
repository = "https://github.com/hyperlight-dev/hyperlight-sandbox"
keywords = ["hyperlight", "isolation", "sandbox", "wasm"]
categories = ["virtualization"]

[workspace.dependencies]
hyperlight-sandbox = { path = "src/hyperlight_sandbox" }
hyperlight-javascript-sandbox = { path = "src/javascript_sandbox" }
hyperlight-wasm-sandbox = { path = "src/wasm_sandbox" }
hyperlight-sandbox = { version = "0.6.0", path = "src/hyperlight_sandbox" }
hyperlight-javascript-sandbox = { version = "0.6.0", path = "src/javascript_sandbox" }
hyperlight-wasm-sandbox = { version = "0.6.0", path = "src/wasm_sandbox" }
hyperlight-sandbox-pyo3-common = { path = "src/sdk/python/pyo3_common" }
hyperlight-common = { version = "0.17.0", default-features = false }
hyperlight-component-macro = "0.17.0"
Expand Down
6 changes: 5 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ Bump the version in **all** manifest files. For example, to go from `0.1.0` →

### Rust (Cargo)

- `Cargo.toml` — `[workspace.package] version`
- `Cargo.toml` — `[workspace.package] version` and the versions for local crates in
`[workspace.dependencies]`

All other workspace member crates inherit the version automatically.

Expand Down Expand Up @@ -48,3 +49,6 @@ git push --tags
```

Replace `v0.2.0` with the version you are releasing.

The publish workflow releases the public Rust crates to crates.io in dependency order,
followed independently by the Python and .NET packages.
3 changes: 3 additions & 0 deletions src/hyperlight_sandbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
description = "High-level Rust host library for running sandbox guests across multiple backends."

[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions src/javascript_sandbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
description = "Hyperlight JS guest for hyperlight-sandbox"

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions src/sdk/dotnet/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition.workspace = true
rust-version.workspace = true
license.workspace = true
description = "C-compatible FFI layer for the hyperlight-sandbox .NET SDK"
publish = false

[lib]
# cdylib for the .NET P/Invoke shared library.
Expand Down
1 change: 1 addition & 0 deletions src/sdk/python/hyperlight_js_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition.workspace = true
rust-version.workspace = true
license.workspace = true
description = "HyperlightJS backend bindings for hyperlight-sandbox"
publish = false

[lib]
name = "_native_js"
Expand Down
1 change: 1 addition & 0 deletions src/sdk/python/pyo3_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition.workspace = true
rust-version.workspace = true
license.workspace = true
description = "Shared PyO3 helpers for hyperlight-sandbox backend crates"
publish = false

[dependencies]
pyo3.workspace = true
Expand Down
1 change: 1 addition & 0 deletions src/sdk/python/wasm_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition.workspace = true
rust-version.workspace = true
license.workspace = true
description = "Wasm backend bindings for hyperlight-sandbox"
publish = false

[lib]
name = "_native_wasm"
Expand Down
3 changes: 3 additions & 0 deletions src/wasm_sandbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
description = "Wasm component sandbox backend for hyperlight-sandbox (Python, JavaScript, etc.)"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/wasm_sandbox/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ mod wasi_impl;
type HostBindings = hyperlight_common::component::Negative;

pub(crate) mod bindings {
hyperlight_component_macro::host_bindgen!("wit/sandbox-world.wasm");
hyperlight_component_macro::host_bindgen!(wit: "wit/hyperlight-sandbox.wit");
}

#[derive(Debug, Clone, Copy, Default)]
Expand Down