Interact with WebAssembly registries.
Project description
wasm-action
Interact with WebAssembly registries.
Features
- Versatile use as GitHub action, CLI or Python library.
- Supported registry types: warg (wa.dev)
- Supported artifact types: wasm
- Supported actions: push, pull
- Supports Python 3.10+ on Linux, MacOS and Windows
Planned
- OCI registry support (a.k.a. Docker registry)
- Convert between formats (wit/wasm)
Usage
Pull from registry
- uses: xelato/wasm-action@main
with:
action: pull
registry: wa.dev
package: component-book:adder
To pull a private package, define your token:
env:
WARG_TOKEN: ${{ secrets.WARG_TOKEN }}
Inputs
| Name | Description | Required | Example |
|---|---|---|---|
| action | Pull from registry | yes | pull |
| registry | Registry domain name | yes | wa.dev |
| package | Package specification | yes | namespace:name@version namespace:name namespace/name namespace/name@version |
| path | Target path to save the download | no | file.wasm |
Outputs:
| Name | Description | Example |
|---|---|---|
| registry | Registry domain name | wa.dev |
| registry-type | Detected registry type | warg |
| package | Package | foo:bar@1.2.3 |
| package-namespace | Package namespace | foo |
| package-name | Package name | bar |
| package-version | Package version | 1.2.3 |
| filename | Download location | foo-bar_1.2.3.wasm |
| digest | File hash | sha256:2afffac0... |
Push to registry
- uses: xelato/wasm-action@main
with:
action: push
registry: wa.dev
package: foo:bar@1.2.3
path: files/foo_bar_1.2.3.wasm
env:
WARG_TOKEN: ${{ secrets.WARG_TOKEN }}
WARG_PRIVATE_KEY: ${{ secrets.WARG_PRIVATE_KEY }}
Key generation
New token registration and push to wa.dev require generation and configuration of a private/public key pair which can be facilitated with:
$ uvx wasm-action key
{
"private": "ecdsa-p256:9y5nigLvFp3KZZQtuvN9DchpGIMUB4bwGAtkIoOCla4=",
"public": "ecdsa-p256:AvspSQWBK65ItTou/uVCi5qC4P+HBCi4R34OIPb3ILRl",
"id": "sha256:c836bd8a3082f2e8d70bdfa48296e580ab847fcdeadb351f448d03f152d44093"
}
# use private key to configure in github or save it elsewhere in a secure manner
$ uvx wasm-action key | jq .private | pbcopy
# use corresponding public key for new token registration at wa.dev
$ pbpaste | uvx wasm-action key | jq .public
CLI
The tool can be run without installing, using uv.
$ uvx wasm-action --help
Usage: wasm-action [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
key Generate private key or read one from stdin
pull Pull from registry
push Push to registry
version Print version
$ uvx wasm-action pull --help
Usage: wasm-action pull [OPTIONS]
Pull from a WebAssembly registry
Options:
--registry TEXT registry domain name [required]
--package TEXT package spec [required]
--path TEXT filename
--warg-token TEXT warg token
--help Show this message and exit.
$ uvx wasm-action pull --registry wa.dev --package wasi:io
registry=wa.dev
registry-type=warg
warg-url=https://warg.wa.dev
package=wasi:io@0.2.0
package-namespace=wasi
package-name=io
package-version=0.2.0
digest=sha256:c33b1dbf050f64229ff4decbf9a3d3420e0643a86f5f0cea29f81054820020a6
filename=wasi:io@0.2.0.wasm
$ file wasi:io@0.2.0.wasm
wasi:io@0.2.0.wasm: WebAssembly (wasm) binary module version 0x1000d
Use as Library
The package is published to the Python Package Index and can be installed/depended-on under the name wasm-action on all supported Python versions.
$ pip install wasm-action
>>> import wasm_action as wa
>>> wa.pull('wa.dev', 'wasi:io')
PackageDownload(namespace='wasi', name='io', version='0.2.0', content='...', digest='sha256:c33b1dbf050f64229ff4decbf9a3d3420e0643a86f5f0cea29f81054820020a6')
However, the library interface is not yet standardised and may (and will!) change.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wasm_action-0.0.8.tar.gz.
File metadata
- Download URL: wasm_action-0.0.8.tar.gz
- Upload date:
- Size: 46.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93bc8780ff78326bbfaac92d450edc41e16fff18ef568d64292d401f54de0337
|
|
| MD5 |
8b1d2b2be457fc599338e270d3cda9eb
|
|
| BLAKE2b-256 |
b6990642a38ad2d175be563ec577c7dcb09697cd12c4fc4b1a7265a4df3b8911
|
Provenance
The following attestation bundles were made for wasm_action-0.0.8.tar.gz:
Publisher:
release.yml on xelato/wasm-action
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wasm_action-0.0.8.tar.gz -
Subject digest:
93bc8780ff78326bbfaac92d450edc41e16fff18ef568d64292d401f54de0337 - Sigstore transparency entry: 865352790
- Sigstore integration time:
-
Permalink:
xelato/wasm-action@12eb97be03dd661295b17e1bbc380a29873ae91f -
Branch / Tag:
refs/tags/v0.0.8 - Owner: https://github.com/xelato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@12eb97be03dd661295b17e1bbc380a29873ae91f -
Trigger Event:
release
-
Statement type:
File details
Details for the file wasm_action-0.0.8-py3-none-any.whl.
File metadata
- Download URL: wasm_action-0.0.8-py3-none-any.whl
- Upload date:
- Size: 110.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
152f071d2b1c317adaf559045a681efc657410a5f9afb971cb1a3b2d184b9e5a
|
|
| MD5 |
ea7f0c6d1ac2a9ac78dd7e48fd299b35
|
|
| BLAKE2b-256 |
ee2811979bb7e62affa451dad71d729b2a2541dc16f509f3020a079b05f17190
|
Provenance
The following attestation bundles were made for wasm_action-0.0.8-py3-none-any.whl:
Publisher:
release.yml on xelato/wasm-action
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wasm_action-0.0.8-py3-none-any.whl -
Subject digest:
152f071d2b1c317adaf559045a681efc657410a5f9afb971cb1a3b2d184b9e5a - Sigstore transparency entry: 865352854
- Sigstore integration time:
-
Permalink:
xelato/wasm-action@12eb97be03dd661295b17e1bbc380a29873ae91f -
Branch / Tag:
refs/tags/v0.0.8 - Owner: https://github.com/xelato
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@12eb97be03dd661295b17e1bbc380a29873ae91f -
Trigger Event:
release
-
Statement type: