Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,22 @@ jobs:
- name: Copy LICENSE into package
run: cp LICENSE.md wasm-edge/pkg/LICENSE.md

- name: Set package name
# wasm-pack derives the npm name from the crate name, ignoring any custom package.json.
# Patch the generated pkg/package.json to use the correct published name.
- name: Set package name and version
# wasm-pack derives the npm name and version from the crate — patch both so the
# published package always matches the git tag (e.g. refs/tags/v0.1.5 → 0.1.5).
run: |
TAG_VERSION="${GITHUB_REF_NAME#v}"
node -e "
const fs = require('fs');
const path = 'wasm-edge/pkg/package.json';
const pkg = JSON.parse(fs.readFileSync(path, 'utf8'));
pkg.name = 'recached-edge';
pkg.version = process.env.TAG_VERSION;
fs.writeFileSync(path, JSON.stringify(pkg, null, 2) + '\n');
console.log('Package name set to:', pkg.name);
console.log('Package:', pkg.name, pkg.version);
"
env:
TAG_VERSION: ${{ github.ref_name }}

- name: Publish to NPM
env:
Expand Down
Loading