Skip to content

Commit 7b45015

Browse files
committed
[code-infra] Setup workflow to auto publish internal packages
whenever a new commit lands in master.
1 parent 5cac916 commit 7b45015

4 files changed

Lines changed: 57 additions & 15 deletions

File tree

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Publish packages
22

33
on:
4+
push:
5+
branches:
6+
- master
47
workflow_dispatch:
58
inputs:
69
sha:
@@ -26,7 +29,30 @@ on:
2629
permissions: {}
2730

2831
jobs:
32+
publish-internal:
33+
name: Publish internal packages
34+
if: (github.event_name == 'push' && github.event.head_commit.author.name != 'renovate[bot]')
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: write # Required for pushing tags and creating releases
38+
id-token: write # Required for provenance
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
42+
with:
43+
ref: ${{ github.event_name == 'push' && github.sha || inputs.sha }}
44+
fetch-depth: 0 # Fetch full history for proper git operations
45+
- name: Prepare for publishing
46+
uses: mui/mui-public/.github/actions/publish-prepare@48198a7131b2ee621cc13bc7729cc41c72f370e7
47+
- name: Publish packages
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
run: |
51+
pnpm code-infra publish-canary --package @mui/internal-markdown @mui/docs @mui/internal-scripts @mui-internal/api-docs-builder @mui/internal-docs-utils
52+
2953
publish:
54+
if: github.event_name == 'workflow_dispatch'
55+
name: Publish packages to npm
3056
runs-on: ubuntu-latest
3157
permissions:
3258
contents: write # Required for pushing tags and creating releases

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"@mui-internal/api-docs-builder-core": "workspace:^",
9797
"@mui/internal-babel-plugin-minify-errors": "2.0.8-canary.22",
9898
"@mui/internal-bundle-size-checker": "1.0.9-canary.62",
99-
"@mui/internal-code-infra": "0.0.4-canary.0",
99+
"@mui/internal-code-infra": "0.0.4-canary.5",
100100
"@mui/internal-docs-utils": "workspace:^",
101101
"@mui/internal-netlify-cache": "0.0.3-canary.0",
102102
"@mui/internal-scripts": "workspace:^",

packages/markdown/.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.test.*
2+
vitest.config.*

pnpm-lock.yaml

Lines changed: 28 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)