Skip to content

Conversation

@Alenar
Copy link
Collaborator

@Alenar Alenar commented Oct 27, 2025

Content

This PR includes several enhancements and clarifications on the npm publications github actions workflows.

publish-npm-package composite workflow:

  • rename input package to package_dir as it was already used as a such, this make it clear that it's not the actual package name in the npm registry
  • extract the published package name from {package_dir}/package.json, this have two benifits: first this name include the scope so this allow its removal from the workflow parameters, second combined with the previous change this allow for packages that have a different directory name and published package name
  • use actions/setup-node@v6:
    • it allow to simplify auth as when setting the registry-url of this action, it setup a project level .npmrc and set up auth to read in from env.NODE_AUTH_TOKEN, allowing to replace the npm set calls (see usage doc).
    • I configured it to retrieve the latest lts, as it will be needed if we want to use trusted publisher later (support for it was added for node 24, ubuntu-24.04 runner base image include node 20)
  • add a "dry run" version of the promote step: the command used, npm dist-tag have no dry-run option so this induce repeating code, but this ensure that something is output in the log in all cases (previously in 'promote' mode the workflow would stop after the "List package" job).
  • clarify and correct some steps names and logs prints (i.e. pre-release from publish-wasm-test to publish-next-wasm-package)

Pre-submit checklist

  • Branch
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • No new TODOs introduced

Issue(s)

Relates to #2745

@Alenar Alenar self-assigned this Oct 27, 2025
@Alenar Alenar force-pushed the djo/2745/ci-enhance-npm-publish branch from 901a0b7 to be934c7 Compare October 27, 2025 11:59
@github-actions
Copy link

github-actions bot commented Oct 27, 2025

Test Results

    4 files  ±0    168 suites  ±0   21m 41s ⏱️ - 2m 30s
2 264 tests ±0  2 264 ✅ ±0  0 💤 ±0  0 ❌ ±0 
6 999 runs  ±0  6 999 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 72e15c5. ± Comparison against base commit 3063c3e.

♻️ This comment has been updated with latest results.

@Alenar Alenar temporarily deployed to testing-preview October 27, 2025 12:21 — with GitHub Actions Inactive
- rename input `package` to `package_dir`, this is mostly a semantic
  change since it was already used as such
- extract the package name from the `package.json` file (this have the
  additionnal advantage of retrieving the scope since it's included in
  the name)
- use `working-directory: ${{ inputs.package_dir }}` instead of doing
  manual `cd` where applicable
- fix console prints that were talking about `crates.io` which is
  incorrect since everything is done against `npmjs.com` in this
  workflow
Since it's already in the package.json name, we do not need to
re-specify it so it can be removed from the ci workflows.
@Alenar Alenar force-pushed the djo/2745/ci-enhance-npm-publish branch from be934c7 to ae85ba1 Compare October 27, 2025 12:34
@Alenar Alenar temporarily deployed to testing-preview October 27, 2025 12:52 — with GitHub Actions Inactive
This induce repeating code but will at least ensure that something is
written to the console in all cases.
@Alenar Alenar temporarily deployed to testing-preview October 27, 2025 14:42 — with GitHub Actions Inactive
Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Collaborator

@turmelclem turmelclem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

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

Successfully merging this pull request may close these issues.

4 participants