[code-infra] Setup workflow to publish internal packages#47952
[code-infra] Setup workflow to publish internal packages#47952brijeshb42 wants to merge 18 commits intomui:masterfrom
Conversation
Netlify deploy preview
Bundle size report
|
2fd2464 to
fd5cbe6
Compare
.github/workflows/publish.yml
Outdated
| pnpm code-infra publish-canary --package @mui/internal-markdown @mui/docs @mui/internal-scripts @mui-internal/api-docs-builder @mui/internal-docs-utils | ||
|
|
||
| publish: | ||
| if: github.event_name == 'workflow_dispatch' |
There was a problem hiding this comment.
What if we want to use workflow_dispatch to test the canary publishing?
There was a problem hiding this comment.
you mean for the new job publish-internal ? I can add the workflow_dispatch check there as well if desired. I don't see the need.
As soon as this PR gets merged, it'll trigger a publish anyways and can be tested there. And you cannot trigger manually from a branch anyways for testing.
I have explicitly kept workflow_dispatch check in the previous publish job since I also added the on.push.branches trigger.
There was a problem hiding this comment.
I believe with workflow_dispatch it's possible to test a change in a PR without merging first.
There was a problem hiding this comment.
Hmm. Seems for that this needs to exist first in the main branch then we can trigger for next PR. I'll add the check.
There was a problem hiding this comment.
No. Because you choose the workflow to trigger from github actions page list first. It'll be shown as two separate items in the workflow list.
There was a problem hiding this comment.
Are you sure, that's not my experience when trying the "Publish packages" workflow_dispatch in mui-public. Maybe I'm looking at the wrong thing.
Also, when we're calling this from CLI, won't it also trigger canary publishing along side regular publishing?
There was a problem hiding this comment.
Now I am not sure. I am moving this to its own file just to make sure there is no scenario of what you mention. I can verify after merge from the Actions UI, what it shows.
There was a problem hiding this comment.
I am moving this to its own file
That's not possible, trusted publishing needs to be configured with a workflow file to publish from, and only one file can be configured.
There was a problem hiding this comment.
Then looks like one more input is needed from user side on the workflow to decide which job to trigger.
fd5cbe6 to
d24760e
Compare
7b45015 to
96c38da
Compare
96c38da to
0fd3e57
Compare
47bf6be to
eda494a
Compare
| description: 'Run in dry-run mode without actually publishing packages' | ||
| required: false | ||
| type: boolean | ||
| default: false |
There was a problem hiding this comment.
removing github release since its not relevant here and tag input since it'll always be canary.
eda494a to
096e04b
Compare
.github/workflows/publish.yml
Outdated
| required: false | ||
| type: string | ||
| default: 'latest' | ||
| internal-packages-only: |
There was a problem hiding this comment.
Nitpick, but the name seems to imply that when this is false, both internal and public are published.
|
Now I remember what the problem was, we've set up a github actions environment that mandates a manual approval. This is configured in trusted publishing as well. |
|
Do we want to add the environment for internal packages as well ? I don't see it configured for |
096e04b to
484dcca
Compare
edit 2: ok, I was talking nonsense, hadn't taken my shower yet. I was operating under the assumption |
484dcca to
484eeb9
Compare
This means that we need to filter out the internal/docs ones from the normal release flow so that these packages don't have two releases. I'll check what needs to be changed to filter out specific packages from the |
Yep, otherwise one of the publishes for that double package will fail due to publishing from a different environment than configured. |
b0b05a5 to
f100d09
Compare
d58d586 to
bca55c7
Compare
5ecf54f to
418d03e
Compare
d6761c8 to
6ef2713
Compare
|
|
||
| jobs: | ||
| publish-internal: | ||
| # Keeping it manual trigger only for now. Will update to also include ` || (github.event_name == 'push' && github.event.head_commit.author.name != 'renovate[bot]')` once we are ready to publish internal packages on push as well. |
6ef2713 to
bd43270
Compare
whenever a new commit lands in master.
…ackages-internal/` - Rename package: `@mui/docs` → `@mui/internal-core-docs` - Move directory: `packages/mui-docs/` → `packages-internal/mui-internal-core-docs/` - Update all import references across docs/, packages/, and config files - Update tsconfig.json, babel.config.mjs, eslint.config.mjs path aliases - Update .github/workflows/publish.yml filter flags - Update tsconfig.build.json references to use correct relative paths from new location - Run pnpm install to register new workspace package location
The wildcard "./*" only resolves to index.ts files, so the non-index `src/ApiPage/private.ts` entry-point was missing from the generated build/package.json, causing the docs production build to fail.
…kages-internal/markdown`
…ackages-internal/waterfall`
…kages-internal/`
… `packages-internal/`
…`packages-internal/` - Add `@mui-internal/api-docs-builder` and `@mui-internal/api-docs-builder-core` path aliases to root tsconfig.json (used by docs and other consumers) - Add explicit `@mui/internal-markdown/prism` alias pointing to prism.d.mts (not found via wildcard due to .mts extension) - Add self-referencing path aliases in api-docs-builder's own tsconfig.json to resolve `@mui-internal/api-docs-builder` internally under nodenext resolution
bd43270 to
b70b06d
Compare
whenever a new commit lands in master.
Currently, kept it manual with
workflow_dispatchcheck. Don't want to publish packages as soon as it gets merged. I'll trigger it manually to do some testing and then after some time, check the check to also include push check.One other major change - Renamed
@mui/docsto@mui/internal-core-docsand moved this and other internal packages topackages-internal.