Skip to content
Merged
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
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was wonderying why the file publish.yml is not npm-publish.yml to match the environment name (npm-publish). It couldn't make sense of why it's different.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No specific reason, I included this after building the whole thing and I think I wanted it to stand out a bit more in the barrage of environments that exist in mui/mui-public.

It'll requiring a manual update of every npm package to change this. Not sure it adds enough value to spend the time on this?

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish packages

on:
workflow_dispatch:
inputs:
sha:
description: 'Commit SHA to release from'
required: true
type: string
dry-run:
description: 'Run in dry-run mode without actually publishing packages'
required: false
type: boolean
default: false
github-release:
description: 'Create a GitHub release after publishing'
required: false
type: boolean
default: true

permissions: {}

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write # Required for pushing tags and creating releases
id-token: write # Required for provenance
environment:
name: npm-publish
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
ref: ${{ inputs.sha }}
fetch-depth: 0 # Fetch full history for proper git operations
- name: Prepare for publishing
uses: mui/mui-public/.github/actions/publish-prepare@master
- name: Publish packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Build common flags
ARGS=""
if [ "${{ inputs.dry-run }}" = "true" ]; then
ARGS="$ARGS --dry-run"
fi
if [ "${{ inputs.github-release }}" = "true" ]; then
ARGS="$ARGS --github-release"
fi

pnpm code-infra publish $ARGS
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"release:version": "lerna version --no-changelog --no-push --no-git-tag-version --no-private --force-publish=@mui/core-downloads-tracker",
"release:build": "lerna run --concurrency 8 --no-private build --skip-nx-cache",
"release:changelog": "node scripts/releaseChangelog.mjs",
"release:publish": "pnpm publish --recursive --tag latest",
"release:publish:dry-run": "pnpm publish --recursive --tag latest --registry=\"http://localhost:4873/\"",
"release:tag": "node scripts/releaseTag.mjs",
"release:pack": "tsx scripts/releasePack.mts",
"docs:api": "rimraf --glob ./docs/pages/**/api-docs ./docs/pages/**/api && pnpm docs:api:build",
Expand Down
2 changes: 0 additions & 2 deletions packages-internal/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,5 @@ It is not meant for general use.
## Scripts

- `build` - transpiles TypeScript files into the build directory.
- `release:publish` - builds the project and publishes it in the npm registry.
- `release:publish:dry-run` - builds the project and publishes it in a local registry accessible on port 4873 (this is the default port of Verdaccio private npm server).
- `test` - runs all the tests.
- `typescript` - checks validity of types.
40 changes: 31 additions & 9 deletions scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
```
4. Generate a GitHub Token at https://github.com/settings/personal-access-tokens/new and add it to your shell rc script (either `.bashrc` or `.zshrc`) as `GITHUB_TOKEN`.

### Releasing a minot version
### Releasing a minor version

A minor release goes like this:

Expand All @@ -40,16 +40,27 @@

#### Release

1. Checkout the last version of the release branch
2. `pnpm install && pnpm release:build` (make sure you have the latest dependencies installed, and build the packages)
3. `pnpm release:publish` (release the versions on npm, you need your 2FA device)
4. `pnpm release:tag` (push the newly created tag)
1. Go to the [publish action](https://github.com/mui/material-ui/actions/workflows/publish.yml).
2. Choose "Run workflow" dropdown

> **Branch:** master
> **Commit SHA to release from:** the commit that contains the merged release on master. This commit is linked to the GitHub release.
> **Run in dry-run mode:** Used for debugging.
> **Create GitHub release:** Keep selected if you want a GitHub release to be automatically created from the changelog.

3. Click "Run workflow"
4. Refresh the page to see the newly created workflow, and click it.
5. The next screen will say "@username requested your review to deploy to npm-publish", click "Review deployments" and authorize your workflow run. **Never approve workflow runs you didn't initiaite.**

Check warning on line 53 in scripts/README.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.Will] Avoid using 'will'. Raw Output: {"message": "[Google.Will] Avoid using 'will'.", "location": {"path": "scripts/README.md", "range": {"start": {"line": 53, "column": 20}}}, "severity": "WARNING"}

#### Documentation

`pnpm docs:deploy` to deploy the documentation (it lives at https://material-ui.netlify.app/) with the latest changes.
Force push if necessary.

#### Publish GitHub release

After the documentation deployment is done, review the draft release that was created, then publish it. At this point the release tag gets created. [GitHub releases page](https://github.com/mui/material-ui/releases)

#### Announce

After the docs is live, follow the instructions in https://mui-org.notion.site/Releases-7490ef9581b4447ebdbf86b13164272d.
Expand Down Expand Up @@ -80,16 +91,27 @@

#### Release

1. Checkout the last version of the release branch
2. `pnpm install && pnpm release:build` (make sure you have the latest dependencies installed, and build the packages)
3. `pnpm release:publish` (release the versions on npm, you need your 2FA device)
4. `pnpm release:tag` (push the newly created tag)
1. Go to the [publish action](https://github.com/mui/material-ui/actions/workflows/publish.yml).
2. Choose "Run workflow" dropdown

> **Branch:** master
> **Commit SHA to release from:** the commit that contains the merged release on master. This commit is linked to the GitHub release.
> **Run in dry-run mode:** Used for debugging.
> **Create GitHub release:** Keep selected if you want a GitHub release to be automatically created from the changelog.

3. Click "Run workflow"
4. Refresh the page to see the newly created workflow, and click it.
5. The next screen shows "@username requested your review to deploy to npm-publish", click "Review deployments" and authorize your workflow run. **Never approve workflow runs you didn't initiaite.**

#### Documentation

Run `git push -f material-ui-docs HEAD:latest` to deploy the documentation (it lives at https://material-ui.netlify.app/) with the latest changes.
Force push if necessary.

#### Publish GitHub release

After the documentation deployment is done, review and then publish the release that was created in draft mode during the release step [GitHub releases page](https://github.com/mui/material-ui/releases)

Check warning on line 113 in scripts/README.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [Google.OxfordComma] Use the Oxford comma in 'After the documentation deployment is done, review and'. Raw Output: {"message": "[Google.OxfordComma] Use the Oxford comma in 'After the documentation deployment is done, review and'.", "location": {"path": "scripts/README.md", "range": {"start": {"line": 113, "column": 1}}}, "severity": "WARNING"}

#### Cleanup

After the release is done, merge the branch back to master. While merging make sure to resolve conflicts considering master may have future changes done in the same files.
Expand Down
Loading