Skip to content

Commit

Permalink
Switch target to Node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Apr 3, 2024
1 parent 350f10a commit 4958337
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/js_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
tags:
- js-v*
workflow_dispatch:

defaults:
run:
Expand All @@ -13,6 +14,8 @@ defaults:
jobs:
publish:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

steps:
- uses: actions/checkout@v4
Expand All @@ -22,16 +25,20 @@ jobs:
with:
toolchain: stable
override: true

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20.6.1"

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh -s -- -f

- name: Build
run: |
wasm-pack build
sed -i 's/"name": "ainu-utils-js"/"name": "ainu-utils"/' pkg/package.json
wasm-pack build --target nodejs
cd ./pkg
npm pkg set name="ainu-utils"
- name: Publish
run: wasm-pack publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 3 additions & 2 deletions ainu-utils-js/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[package]
name = "ainu-utils-js"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
description = "A collection of utilities for the Ainu language"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "ainu_utils"
crate-type = ["cdylib", "rlib"]

[dependencies]
ainu-utils = { path = "../ainu-utils" }
wasm-bindgen = "0.2.89"
wasm-bindgen = "0.2.92"

0 comments on commit 4958337

Please sign in to comment.