Skip to content

Commit

Permalink
prep build 08/22
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Aug 22, 2023
2 parents 101df5b + c395242 commit a09c7da
Show file tree
Hide file tree
Showing 832 changed files with 87,565 additions and 47,486 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ module.exports = {
extends: [
'plugin:@wordpress/eslint-plugin/recommended',
'plugin:eslint-comments/recommended',
'plugin:storybook/recommended',
],
globals: {
wp: 'off',
Expand Down
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/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
VERSION: ${{ steps.get_version.outputs.new_version }}
run: |
cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version' package.json) > package.json
cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version' package-lock.json) > package-lock.json
cat <<< $(jq --tab --arg version "${VERSION}" '.version = $version | .packages[""].version = $version' package-lock.json) > package-lock.json
sed -i "s/${{ steps.get_version.outputs.old_version }}/${VERSION}/g" gutenberg.php
- name: Commit the version bump to the release branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-block.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['14']
node: ['16']
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/end2end-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
- name: Running the tests
run: |
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
$( npm bin )/wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --listTests > ~/.jest-e2e-tests
npx wp-scripts test-e2e --config=./packages/e2e-tests/jest.config.js --cacheDirectory="$HOME/.jest-cache" --runTestsByPath $( awk 'NR % ${{ matrix.totalParts }} == ${{ matrix.part }} - 1' < ~/.jest-e2e-tests )
- name: Archive debug artifacts (screenshots, HTML snapshots)
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
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
9 changes: 8 additions & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:
- name: Setup Node.js and install dependencies
uses: ./.github/setup-node

- name: Install NVM
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm -v
- name: Compare performance with trunk
if: github.event_name == 'pull_request'
run: ./bin/plugin/cli.js perf $GITHUB_SHA trunk --tests-branch $GITHUB_SHA
Expand Down Expand Up @@ -80,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 }}
2 changes: 1 addition & 1 deletion .github/workflows/pull-request-automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
if: ${{ github.repository == 'WordPress/gutenberg' }}
strategy:
matrix:
node: ['14']
node: ['16']

steps:
# Checkout defaults to using the branch which triggered the event, which
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: ['14']
node: ['16']

steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
Expand Down
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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
save-exact = true
engine-strict = true
legacy-peer-deps = true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
16
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 a09c7da

Please sign in to comment.