-
Notifications
You must be signed in to change notification settings - Fork 269
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
chore(crypto-js): Add a release workflow for crypto-js
#966
Conversation
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.
The differences with #900 are:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I have some questions...
Codecov Report
@@ Coverage Diff @@
## main #966 +/- ##
=======================================
Coverage 80.35% 80.35%
=======================================
Files 110 110
Lines 15809 15809
=======================================
Hits 12704 12704
Misses 3105 3105 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
…ched. 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:npm run prepublish
(which runs thebuild
andtest
scripts),wasm-pack publish
.Note 1: The
prepublish
script is using the$npm_execpath
environment variable instead of just “
npm
”, so that if someone isusing
yarn
or another JavaScript package manager, it should work(not tested yet).
Note 2:
wasm-pack publish
is run without runningwasm-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]+.*
ispushed. This workflow runs
npm run publish
basically, but beforethat, it updates the NPM configuration file by setting a value for
//registry.npmjs.org/:_authToken
. Thus, runningwasm-pack login
isnot necessary.
Supersedes and closes #900. Fixes #794.
Edit 🆕:
This patch updates the
publish
NPM script to explicitly runwasm-pack pack
to create the NPM package in thepkg/
directory. This patch also updates the Github Action workflow for the
matrix-sdk-crypto-js
release, to create a new Github Release, withthe NPM package attached as an asset file.