Publishes a Rust web assembly to an npm registry.
steps:
- uses: actions/checkout@v4
- uses: giancosta86/aurora-github/actions/publish-rust-wasm@v8
with:
npm-token: ${{ secrets.NPM_TOKEN }}
wasm-pack-version: 0.13.1
npm-scope: your-npm-scope
Please, note: this action is designed for publication only - not for verification: you might want to use verify-rust-wasm for that.
-
Invoke the install-wasm-pack action, passing all the matching inputs, to install the
wasm-pack
command. -
Invoke generate-wasm-target to generate the NodeJS package source files in the pkg subdirectory.
-
If a
.npmrc
configuration file exists inproject-directory
, copy it to pkg -
Call publish-npm-package on the pkg directory - passing all the matching inputs - to publish the npm package.
-
the
nodejs-version
input is required for the build process; optionally, you can set thepnpm-version
input as well, in order to request a specific pnpm version. -
npm-token
is mandatory - unlessdry-run
is enabled -
The requirements for publish-npm-package.
-
The requirements for publish-github-pages if
website-directory
references an existing directory. -
Before the first publication, running with
dry-run
set to true is recommended.
Name | Type | Description | Default value |
---|---|---|---|
dry-run |
boolean | Run a simulated publication via --dry-run |
false |
npm-token |
string | The secret token for publishing to the registry | |
wasm-pack-version |
string | The wasm-pack version to install |
|
npm-scope |
string | The npm package scope or <ROOT> |
|
nodejs-version |
string | The engines / node version within package.json |
|
pnpm-version |
string | The packageManager reference to pnpm within package.json |
|
wasm-target |
string | The target of the wasm-pack build command |
web |
website-directory |
string | Relative directory containing the project website | website |
enforce-branch-version |
inject ,check ,skip |
How the branch version should be enforced | inject |
project-directory |
string | The directory containing Cargo.toml |
. |