Skip to content
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

add github action to publish to npm if version updated in package.json #38

Open
hanayik opened this issue Dec 28, 2024 · 0 comments
Open
Assignees

Comments

@hanayik
Copy link
Collaborator

hanayik commented Dec 28, 2024

Adding a github action to automatically publish to NPM would be convenient. @neurolabusc , leave this to me. It will be a useful addition, and can potentially apply to some other repos we work with. These are my notes for later.

The same pixi-based github action can also be used to build and publish the conda package (in combination with rattler-build). It would help #33. Note that the conda package would just include the compiled exe, not the wasm package. The wasm package would be published to npm.

This would allow cross platform use of niimath for anyone using conda. This would be great for scientific reproducibility where package managers are used to install analysis environments using conda-forge channels.

I would also recommend that we switch to using sem-ver versioning if we publish niimath to conda-forge. While Date-based versions like 1.0.20241212 do work, they don't convey the same info to downstream developers who rely on version pinning mechanisms.

Steps required for wasm package publishing to npm:

  • setup NPM token as a github secret
  • use a pixi github action
  • install emscripten conda install conda-forge::emscripten (or setup pixi.toml)
  • check version in package.json current_version=$(node -p "require('./package.json').version")
  • check latest version available on npm published_version=$(npm view @niivue/niimath version)
  • check if current_version equals published_version is_latest=$([ "$current_version" = "$published_version" ] && echo 1 || echo 0)
  • use these values in a github action workflow to determine if the NPM package should be built and published
@hanayik hanayik self-assigned this Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant