Skip to content

Commit

Permalink
Merge branch 'trunk' into add/interactivity-api-regions-based-client-…
Browse files Browse the repository at this point in the history
…side-navigation
  • Loading branch information
luisherranz committed Aug 21, 2023
2 parents 3cc2e45 + 0a0bc06 commit 79ecdbb
Show file tree
Hide file tree
Showing 454 changed files with 5,103 additions and 10,321 deletions.
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
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: performance-results
path: ${{ env.WP_ARTIFACTS_PATH }}/*.performance-results.json
path: ${{ env.WP_ARTIFACTS_PATH }}/*.performance-results*.json

- name: Publish performance results
if: github.event_name == 'push'
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 }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ build-types
node_modules
gutenberg.zip
coverage
*-performance-results.json
.phpunit.result.cache
.reassure

Expand Down
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

0 comments on commit 79ecdbb

Please sign in to comment.