-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
feat(meta): publish @node-core/* packages #7776
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #7776 +/- ##
==========================================
+ Coverage 75.31% 75.34% +0.02%
==========================================
Files 96 96
Lines 7856 7861 +5
Branches 192 192
==========================================
+ Hits 5917 5923 +6
+ Misses 1938 1937 -1
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR adds a GitHub Actions workflow to automatically detect, verify, and publish any @node-core/*
packages in the packages/
directory when changes are merged to main
or manually triggered.
- Introduces
.github/workflows/publish-packages.yml
- Detects which packages changed (or a specific package via input)
- Verifies commit authenticity and merge-queue origin before publishing via
pnpm
Comments suppressed due to low confidence (1)
.github/workflows/publish-packages.yml:38
- [nitpick] Parsing
ls
output can break on directories with spaces or unexpected files. Consider usingfind packages -maxdepth 1 -type d -printf '%f\n'
or verifying each folder contains apackage.json
.
PACKAGES=$(ls -d packages/* | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]')
we should add doc about
|
I've updated the PR with:
|
1b96082
to
a8235b4
Compare
we need a npm token ? |
|
# This ensures we can publish multiple times from the same codebase with unique versions | ||
npm version --no-git-tag-version 0.0.0-$COMMIT_SHA | ||
# Publish the package to the npm registry with public access flag | ||
pnpm publish --access public |
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.
Do we want to generate changelogs too? With Conventional Changelogs?
I think we should publish git-tags and versions here based on our commits. We already use (or somewhat use) conventional commits.
We can do this in a follow-up PR, so feel free to open an issue to address that.
- name: Publish | ||
working-directory: packages/${{ matrix.package }} | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
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.
Did you get the token already or do you still need a token?
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.
I didn't request one, no.
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.
LGTM
env: | ||
PACKAGE: ${{ github.event.inputs.package }} | ||
EVENT_NAME: ${{ github.event_name }} | ||
run: | |
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.
Nice
I've opened this issue: nodejs/admin#971 And thanks, @avivkeller for the work here <3 |
The current vote on importing
@node-core/*
intoapi-docs-tooling
stands at 8/0/0 in favor of publishing the@node-core/*
packages. Given the lack of opposition in broader discussions, this outcome is unlikely to change.As a result, this PR publishes the following packages to the npm registry:
@node-core/ui-components
@node-core/website-i18n
@node-core/rehype-shiki
packages/
directoryThese packages will be published on any commit that modifies their directories, provided the following conditions are met:
push
tomain
, or the workflow is manually triggered.main
).Publishing requires a
publish
secrets.NPM_TOKEN
for the@node-core
scope, similar to the one used for Caritat.