This patch updates the `publish` NPM script to explicitly run
`wasm-pack pack` to create the NPM package in the `pkg/`
directory. This patch also updates the Github Action workflow for the
`matrix-sdk-crypto-js` release, to create a new Github Release, with
the NPM package attached as an asset file.
This patch adds a new `npm run publish` script that:
1. Run `npm run prepublish` (which runs the `build` and `test` scripts),
2. Run `wasm-pack publish`.
Note 1: The `prepublish` script is using the `$npm_execpath`
environment variable instead of just “`npm`”, so that if someone is
using `yarn` or another JavaScript package manager, it _should_ work
(not tested yet).
Note 2: `wasm-pack publish` is run without running `wasm-pack login`
before that. _But_ we are updating the registry URL in the NPM
configuration file in the Github Action workflow, see below.
This patch then creates a new Github Action workflow that is triggered
when a new tag of the form `matrix-sdk-crypto-js-v[0_9]+.*` is
pushed. This workflow runs `npm run publish` basically, but before
that, it updates the NPM configuration file by setting a value for
`//registry.npmjs.org/:_authToken`. Thus, running `wasm-pack login` is
not necessary.
* feat(crypto-nodejs): Download lib binary in postinstall
* build(crypto-nodejs): Workflow to prebuild napi bindings
* ci(crypto-nodejs): Disable broken target, install without download
* ci(apple-ffi): Don't run for drafts
* ci(coverage): Don't run for draft PRs
* fix(crypto-nodejs): bind to current version for download
* fix(crypto-nodejs): Ignore libs and package
* ci(crypto-nodejs): Build and upload NPM package
* fix(crypto-nodejs): Set proper target list
* ci(crypto-nodejs): Remove FreeBSD from build pipeline
* ci(crypto-nodejs): Linkers for linux cross compile
* ci(crypto-nodejs): Add arm64 build for windows
* ci(crypto-nodejs): Proper linkers for arm and musl
* ci(crypto-nodejs): Correct apt command for musl
* fix(crypto-nodejs): Drop arm64 linux musl support
* ci(crypto-nodejs): Manual Workflow trigger process
* chore(crypto-nodejs): Get Github to pickup our action
* ci(crypto-nodejs): Add i686 Linux built
* ci(crypto-nodejs): Configure cliff for nodejs changelogs
* ci(crypto-nodejs): Proper gcc for i868 targets
* docs(crypto-nodejs): Add supported targets for npm install
* ci(crypto-nodejs): Limit building of binaries to tags
* style: consol.log -> console.info; Improve docs
Co-authored-by: Ivan Enderlin <ivan@mnt.io>
* activate for testing
* fix broken merge
* 0.1.0
* fix(js): put in the proper package name
* activate for PR for testing
* fix(nodejs): getting ready for publishing
* ci(crypto-nodejs): Adding docs and fixing naming for workflows
* typo: missed one
* fixing package name
Co-authored-by: Ivan Enderlin <ivan@mnt.io>