@@ -90,24 +90,26 @@ jobs:
9090 if : ${{ contains(github.ref, 'refs/heads/release/') }}
9191 uses : rust-lang/crates-io-auth-action@v1
9292 id : crates-io-auth
93- - name : Install cargo-overlay-registry
94- if : ${{ contains(github.ref, 'refs/heads/release/') }}
95- run : cargo install cargo-overlay-registry
96- shell : bash
93+
9794 - name : Publish to crates.io
9895 if : ${{ contains(github.ref, 'refs/heads/release/') }}
9996 run : |
10097 set -euxo pipefail
101- rm -Rf ./target/package/tmp-registry
102- cargo overlay-registry \
103- -r crates-io \
104- -r local=./target/package/tmp-registry \
105- -- \
106- cargo +1.92 publish \
107- -p hyperlight-wasm-aot \
108- -p hyperlight-wasm-macro \
109- -p hyperlight-wasm-runtime \
110- -p hyperlight-wasm
98+
99+ publish_if_needed() {
100+ local crate=$1
101+ if curl -sf "https://crates.io/api/v1/crates/$crate/$HYPERLIGHTWASM_VERSION" | jq -e .version > /dev/null 2>&1; then
102+ echo "✅ $crate@$HYPERLIGHTWASM_VERSION already published, skipping."
103+ else
104+ echo "🚀 Publishing $crate@$HYPERLIGHTWASM_VERSION"
105+ cargo +1.92 publish -p "$crate"
106+ fi
107+ }
108+
109+ publish_if_needed hyperlight-wasm-macro
110+ publish_if_needed hyperlight-wasm-runtime
111+ publish_if_needed hyperlight-wasm-aot
112+ publish_if_needed hyperlight-wasm
111113 env :
112114 CARGO_REGISTRY_TOKEN : ${{ steps.crates-io-auth.outputs.token }}
113115 shell : bash
0 commit comments