-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: automate tlsn-wasm build + store artifact for tags + manual workflow for npm release + Improved package: add description, repo information etc
- Loading branch information
Showing
7 changed files
with
92 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish tlsn-wasm to NPM | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to publish to NPM' | ||
required: true | ||
default: '0.1.0-alpha.8-pre' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ github.event.inputs.tag }}-tlsn-wasm-pkg | ||
path: tlsn-wasm-pkg | ||
|
||
- name: NPM Publish for tlsn-wasm | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
cd tlsn-wasm-pkg | ||
npm publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
# TLSNotary WASM bindings | ||
# TLSNotary WASM Bindings | ||
|
||
## Build | ||
This crate provides a WebAssembly package for TLSNotary, offering core functionality for the TLSNotary attestation protocol along with useful TypeScript types. | ||
|
||
This crate must be built using the nightly rust compiler with the following flags: | ||
|
||
```bash | ||
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory,+mutable-globals' \ | ||
rustup run nightly \ | ||
wasm-pack build --target web . -- -Zbuild-std=panic_abort,std | ||
``` | ||
For most use cases, you may prefer to use the `tlsn-js` package instead: [tlsn-js on npm](https://www.npmjs.com/package/tlsn-js). | ||
|
||
## Links | ||
|
||
- [Website](https://tlsnotary.org) | ||
- [Documentation](https://docs.tlsnotary.org) | ||
- [API Docs](https://tlsnotary.github.io/tlsn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,27 @@ | ||
RUSTFLAGS='-C target-feature=+atomics,+bulk-memory,+mutable-globals' \ | ||
rustup run nightly \ | ||
wasm-pack build --target web . -- -Zbuild-std=panic_abort,std | ||
#!/bin/sh | ||
|
||
# This crate must be built using the nightly Rust compiler with specific flags. | ||
# This script automates the build process. | ||
|
||
set -e | ||
|
||
# Clean up older builds | ||
rm -rf pkg | ||
|
||
# Build tlsn_wasm package | ||
wasm-pack build --target web . | ||
|
||
# Patch tlsn_wasm.js import in workerHelpers.worker.js | ||
file=$(find ./pkg/snippets -name "workerHelpers.worker.js" -print -quit) | ||
if [ -z "$file" ]; then | ||
echo "Error: workerHelpers.worker.js not found" | ||
find pkg | ||
exit 1 | ||
fi | ||
temp=$(mktemp) | ||
sed 's|../../../|../../../tlsn_wasm.js|' "$file" >"$temp" && mv "$temp" "$file" | ||
|
||
# Add snippets directory to package.json | ||
file="pkg/package.json" | ||
temp=$(mktemp) | ||
jq '.files += ["snippets/"]' "$file" >"$temp" && mv "$temp" "$file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
[toolchain] | ||
channel = "nightly" | ||
components = ["rust-src"] | ||
targets = ["wasm32-unknown-unknown"] |