-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: publish WASM web package #224
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,48 @@ | ||
name: Publish WASM | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: New version semver | ||
required: true | ||
type: string | ||
tag: | ||
description: NPM tag | ||
required: false | ||
type: string | ||
default: 'latest' | ||
|
||
jobs: | ||
build-wasm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Install wasm-pack | ||
uses: jetli/[email protected] | ||
|
||
- name: Build WASM | ||
run: | | ||
cd yggdrasilwasm | ||
wasm-pack build --target web --scope unleash | ||
|
||
publish-wasm: | ||
needs: [build-wasm] | ||
uses: Unleash/.github/.github/workflows/[email protected] | ||
with: | ||
version: ${{ github.event.inputs.version }} | ||
tag: ${{ github.event.inputs.tag }} | ||
working-directory: yggdrasilwasm/pkg | ||
setup-command: "echo 'Skipping setup. Already done.'" | ||
secrets: | ||
NPM_ACCESS_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
UNLEASH_BOT_APP_ID: ${{ secrets.UNLEASH_BOT_APP_ID }} | ||
UNLEASH_BOT_PRIVATE_KEY: ${{ secrets.UNLEASH_BOT_PRIVATE_KEY }} |
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,6 +1,6 @@ | ||
[package] | ||
name = "yggdrasil-engine" | ||
version = "0.3.0" | ||
name = "yggdrasil-wasm" | ||
version = "0.3.1-beta.0" | ||
authors = ["sighphyre <[email protected]>"] | ||
repository = "https://github.com/unleash/yggdrasil" | ||
description = "Direct WASM bindings to the Yggdrasil engine" | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea what this works for? That looks pure browser based but node is definitely a thing we need
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we'll find out in practice.
From https://rustwasm.github.io/docs/wasm-pack/commands/build.html
You can read about the different targets here: https://rustwasm.github.io/docs/wasm-bindgen/reference/deployment.html
I believe it should work for both browsers and Node-like runtimes, as long as we don't do browser-specific things in our WASM, which I'm pretty sure we won't.
It already works in our Bun e2e tests, which don't run on a browser environment.