diff --git a/.github/workflows/wadge.yml b/.github/workflows/wadge.yml index 6d7f202..a109c6f 100644 --- a/.github/workflows/wadge.yml +++ b/.github/workflows/wadge.yml @@ -7,10 +7,12 @@ on: branches: - main tags: - - 'crates/passthrough/v[0-9].[0-9]+.[0-9]+' - - 'crates/passthrough/v[0-9].[0-9]+.[0-9]+-*' - - 'crates/sys/v[0-9].[0-9]+.[0-9]+' - - 'crates/sys/v[0-9].[0-9]+.[0-9]+-*' + - 'crates/wadge-passthrough/v[0-9].[0-9]+.[0-9]+' + - 'crates/wadge-passthrough/v[0-9].[0-9]+.[0-9]+-*' + - 'crates/wadge-sys/v[0-9].[0-9]+.[0-9]+' + - 'crates/wadge-sys/v[0-9].[0-9]+.[0-9]+-*' + - 'crates/wadge/v[0-9].[0-9]+.[0-9]+' + - 'crates/wadge/v[0-9].[0-9]+.[0-9]+-*' - 'v[0-9].[0-9]+.[0-9]+' - 'v[0-9].[0-9]+.[0-9]+-*' workflow_dispatch: @@ -241,10 +243,13 @@ jobs: strategy: matrix: include: - - crate: passthrough + - crate: wadge workspace-dependencies: false - - crate: sys + - crate: wadge-passthrough + workspace-dependencies: false + + - crate: wadge-sys workspace-dependencies: true name: publish ${{ matrix.crate }} to crates.io @@ -274,7 +279,7 @@ jobs: if: startsWith(github.ref, format('refs/tags/crates/{0}/v', matrix.crate)) && !steps.ctx.outputs.prerelease continue-on-error: ${{ github.repository_owner != 'wasmCloud' }} run: | - pkgver=$(cargo pkgid | cut -d '@' -f 2) + pkgver=$(cargo pkgid | cut -d '#' -f 2) tagver="${{ steps.ctx.outputs.version }}" if ! [ "$pkgver" = "$tagver" ]; then echo "version mismatch, $pkgver (package) != $tagver (tag)" @@ -345,16 +350,6 @@ jobs: echo "prerelease=true" >> "$GITHUB_OUTPUT" fi - - name: publish wadge to crates.io - run: | - pkgver=$(cargo pkgid | cut -d '#' -f 2) - tagver="${{ steps.ctx.outputs.version }}" - if ! [ "$pkgver" = "$tagver" ]; then - echo "version mismatch, $pkgver (package) != $tagver (tag)" - exit 1 - fi - cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} - - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: path: artifacts diff --git a/Cargo.toml b/Cargo.toml index 03854c1..4ffeefa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,32 +1,6 @@ -[package] -name = "wadge" -version = "0.3.1" -description = "WAdge runtime" - -authors.workspace = true -categories.workspace = true -edition.workspace = true -homepage.workspace = true -license.workspace = true -repository.workspace = true - -exclude = [ - "*.a", - "*.go", - "*.h", - "*.s", - "*.wasm", - ".github", - ".gitignore", - "examples", - "flake.*", - "go.*", - "rust-toolchain.toml", - "tests", -] - [workspace] members = ["crates/*", "tests/components/*"] +resolver = "2" [workspace.package] authors = ["Roman Volosatovs "] @@ -47,30 +21,6 @@ strip = true [profile.release] lto = true -[dependencies] -anyhow = { workspace = true } -http = { workspace = true } -tokio = { workspace = true } -tracing = { workspace = true } -wasi-preview1-component-adapter-provider = { workspace = true } -wasmparser = { workspace = true } -wasmtime = { workspace = true, features = [ - "addr2line", - "component-model", - "coredump", - "cranelift", - "demangle", - "gc", - "parallel-compilation", - "runtime", - "wat", -] } -wasmtime-wasi = { workspace = true } -wasmtime-wasi-http = { workspace = true } -wasmtime-wasi-keyvalue = { workspace = true } -wasmtime-wasi-runtime-config = { workspace = true } -wit-component = { workspace = true } - [workspace.dependencies] anyhow = { version = "1", default-features = false } cbindgen = { version = "0.27", default-features = false } @@ -78,7 +28,7 @@ http = { version = "1", default-features = false } tokio = { version = "1", default-features = false } tracing = { version = "0.1", default-features = false } tracing-subscriber = { version = "0.3", default-features = false } -wadge = { version = "0.3.1", path = "." } +wadge = { version = "0.3.1", path = "./crates/wadge" } wasi-passthrough = { version = "0.3.2", default-features = false } wasi-passthrough-ext = { version = "0.1.4", default-features = false } wasi-passthrough-keyvalue = { version = "0.1.1", default-features = false } diff --git a/crates/generate-header/src/main.rs b/crates/generate-header/src/main.rs index 8dda639..bbb7f7a 100644 --- a/crates/generate-header/src/main.rs +++ b/crates/generate-header/src/main.rs @@ -14,7 +14,7 @@ fn main() -> anyhow::Result<()> { .parent() .context("failed to lookup workspace root directory")?; let bindings = cbindgen::generate_with_config( - crates.join("sys"), + crates.join("wadge-sys"), cbindgen::Config { language: cbindgen::Language::C, ..Default::default() diff --git a/crates/passthrough/Cargo.toml b/crates/wadge-passthrough/Cargo.toml similarity index 100% rename from crates/passthrough/Cargo.toml rename to crates/wadge-passthrough/Cargo.toml diff --git a/crates/passthrough/src/lib.rs b/crates/wadge-passthrough/src/lib.rs similarity index 100% rename from crates/passthrough/src/lib.rs rename to crates/wadge-passthrough/src/lib.rs diff --git a/crates/sys/Cargo.toml b/crates/wadge-sys/Cargo.toml similarity index 100% rename from crates/sys/Cargo.toml rename to crates/wadge-sys/Cargo.toml diff --git a/crates/sys/src/ffi.rs b/crates/wadge-sys/src/ffi.rs similarity index 100% rename from crates/sys/src/ffi.rs rename to crates/wadge-sys/src/ffi.rs diff --git a/crates/sys/src/lib.rs b/crates/wadge-sys/src/lib.rs similarity index 100% rename from crates/sys/src/lib.rs rename to crates/wadge-sys/src/lib.rs diff --git a/crates/wadge/Cargo.toml b/crates/wadge/Cargo.toml new file mode 100644 index 0000000..65d8ca6 --- /dev/null +++ b/crates/wadge/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "wadge" +version = "0.3.1" +description = "WAdge runtime" + +authors.workspace = true +categories.workspace = true +edition.workspace = true +homepage.workspace = true +license.workspace = true +repository.workspace = true + +[dependencies] +anyhow = { workspace = true } +http = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } +wasi-preview1-component-adapter-provider = { workspace = true } +wasmparser = { workspace = true } +wasmtime = { workspace = true, features = [ + "addr2line", + "component-model", + "coredump", + "cranelift", + "demangle", + "gc", + "parallel-compilation", + "runtime", + "wat", +] } +wasmtime-wasi = { workspace = true } +wasmtime-wasi-http = { workspace = true } +wasmtime-wasi-keyvalue = { workspace = true } +wasmtime-wasi-runtime-config = { workspace = true } +wit-component = { workspace = true } diff --git a/src/lib.rs b/crates/wadge/src/lib.rs similarity index 100% rename from src/lib.rs rename to crates/wadge/src/lib.rs diff --git a/crates/wadge/wit b/crates/wadge/wit new file mode 120000 index 0000000..902b548 --- /dev/null +++ b/crates/wadge/wit @@ -0,0 +1 @@ +../../wit \ No newline at end of file