Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Publish packages

on:
push:
branches:
- master
workflow_dispatch:
inputs:
sha:
Expand All @@ -26,7 +29,30 @@ on:
permissions: {}

jobs:
publish-internal:
name: Publish internal packages
if: (github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.event.head_commit.author.name != 'renovate[bot]'))
runs-on: ubuntu-latest
permissions:
contents: write # Required for pushing tags and creating releases
id-token: write # Required for provenance
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event_name == 'push' && github.sha || inputs.sha }}
fetch-depth: 0 # Fetch full history for proper git operations
- name: Prepare for publishing
uses: mui/mui-public/.github/actions/publish-prepare@48198a7131b2ee621cc13bc7729cc41c72f370e7
- name: Publish packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
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'
Copy link
Member

Choose a reason for hiding this comment

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

What if we want to use workflow_dispatch to test the canary publishing?

Copy link
Contributor Author

@brijeshb42 brijeshb42 Mar 11, 2026

Choose a reason for hiding this comment

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

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.

Copy link
Member

Choose a reason for hiding this comment

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

I believe with workflow_dispatch it's possible to test a change in a PR without merging first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

name: Publish packages to npm
runs-on: ubuntu-latest
permissions:
contents: write # Required for pushing tags and creating releases
Expand Down
2 changes: 2 additions & 0 deletions packages/markdown/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.test.*
vitest.config.*
Loading