Skip to content

Commit

Permalink
Merge changes published in the Gutenberg plugin "release/16.6" branch
Browse files Browse the repository at this point in the history
  • Loading branch information
gutenbergplugin committed Aug 31, 2023
1 parent 78a288d commit 4c9455a
Show file tree
Hide file tree
Showing 507 changed files with 9,695 additions and 6,085 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Documentation
/docs @ajitbohra @ryanwelcher @juanmaguitar @fabiankaegy @ndiego
/packages/interactivity/docs @juanmaguitar

# Schemas
/schemas/json @ajlende
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/enforce-pr-labels.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Enforce labels on Pull Request
on:
pull_request_target:
types: [opened, labeled, unlabeled, synchronize]
types: [labeled, unlabeled, ready_for_review, review_requested]
jobs:
type-related-labels:
runs-on: ubuntu-latest
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Checkout (for CLI)
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: main
path: cli
ref: trunk

- name: Checkout (for publishing)
Expand All @@ -52,13 +52,13 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version-file: 'main/.nvmrc'
node-version-file: 'cli/.nvmrc'
registry-url: 'https://registry.npmjs.org'

- name: Publish development packages to npm ("next" dist-tag)
if: ${{ github.event.inputs.release_type == 'development' }}
run: |
cd main
cd cli
npm ci
./bin/plugin/cli.js npm-next --ci --repository-path ../publish
env:
Expand All @@ -67,7 +67,7 @@ jobs:
- name: Publish packages to npm with bug fixes ("latest" dist-tag)
if: ${{ github.event.inputs.release_type == 'bugfix' }}
run: |
cd main
cd cli
npm ci
./bin/plugin/cli.js npm-bugfix --ci --repository-path ../publish
env:
Expand All @@ -76,8 +76,8 @@ jobs:
- name: Publish packages to npm for WP major ("wp/${{ github.event.inputs.wp_version || 'X.Y' }}" dist-tag)
if: ${{ github.event.inputs.release_type == 'wp' && github.event.inputs.wp_version }}
run: |
cd main
cd publish
npm ci
./bin/plugin/cli.js npm-wp --wp-version=${{ github.event.inputs.wp_version }} --ci --repository-path ../publish
npx lerna publish patch --dist-tag wp-${{ github.event.inputs.wp_version }} --no-private --yes --no-verify-access
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
65 changes: 49 additions & 16 deletions bin/plugin/commands/packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const {
findPluginReleaseBranchName,
} = require( './common' );
const { join } = require( 'path' );
const pluginConfig = require( '../config' );

/**
* Release type names.
Expand Down Expand Up @@ -99,7 +100,7 @@ async function checkoutNpmReleaseBranch( {
* `trunk` commits from within the past week.
*/
await SimpleGit( gitWorkingDirectoryPath )
.fetch( npmReleaseBranch, [ '--depth=100' ] )
.fetch( 'origin', npmReleaseBranch, [ '--depth=100' ] )
.checkout( npmReleaseBranch );
log(
'>> The local npm release branch ' +
Expand Down Expand Up @@ -411,13 +412,27 @@ async function publishPackagesToNpm( {
);
} else if ( [ 'bugfix', 'wp' ].includes( releaseType ) ) {
log( '>> Publishing modified packages to npm.' );
await command(
`npx lerna publish ${ minimumVersionBump } --dist-tag ${ distTag } --no-private ${ yesFlag } ${ noVerifyAccessFlag }`,
{
cwd: gitWorkingDirectoryPath,
stdio: 'inherit',
}
);
try {
await command(
`npx lerna publish ${ minimumVersionBump } --dist-tag ${ distTag } --no-private ${ yesFlag } ${ noVerifyAccessFlag }`,
{
cwd: gitWorkingDirectoryPath,
stdio: 'inherit',
}
);
} catch {
log(
'>> Trying to finish failed publishing of modified npm packages.'
);
await SimpleGit( gitWorkingDirectoryPath ).reset( 'hard' );
await command(
`npx lerna publish from-package --dist-tag ${ distTag } ${ yesFlag } ${ noVerifyAccessFlag }`,
{
cwd: gitWorkingDirectoryPath,
stdio: 'inherit',
}
);
}
} else {
log(
'>> Bumping version of public packages changed since the last release.'
Expand All @@ -431,13 +446,27 @@ async function publishPackagesToNpm( {
);

log( '>> Publishing modified packages to npm.' );
await command(
`npx lerna publish from-package ${ yesFlag } ${ noVerifyAccessFlag }`,
{
cwd: gitWorkingDirectoryPath,
stdio: 'inherit',
}
);
try {
await command(
`npx lerna publish from-package ${ yesFlag } ${ noVerifyAccessFlag }`,
{
cwd: gitWorkingDirectoryPath,
stdio: 'inherit',
}
);
} catch {
log(
'>> Trying to finish failed publishing of modified npm packages.'
);
await SimpleGit( gitWorkingDirectoryPath ).reset( 'hard' );
await command(
`npx lerna publish from-package ${ yesFlag } ${ noVerifyAccessFlag }`,
{
cwd: gitWorkingDirectoryPath,
stdio: 'inherit',
}
);
}
}

const afterCommitHash = await SimpleGit( gitWorkingDirectoryPath ).revparse(
Expand Down Expand Up @@ -530,7 +559,11 @@ async function runPackagesRelease( config, customMessages ) {
config.abortMessage,
async () => {
log( '>> Cloning the Git repository' );
await SimpleGit( gitPath ).clone( config.gitRepositoryURL );
await SimpleGit().clone(
pluginConfig.gitRepositoryURL,
gitPath,
[ '--depth=1', '--no-single-branch' ]
);
log( ` >> successfully clone into: ${ gitPath }` );
}
);
Expand Down
Loading

1 comment on commit 4c9455a

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 4c9455a.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6035381671
📝 Reported issues:

Please sign in to comment.