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
3 changes: 2 additions & 1 deletion .github/workflows/build-plugin-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,11 @@ jobs:
working-directory: main
cache: false

# Not `npm exec`: it exports the tool's .npmrc as npm_config_* variables, which override the release branch's own .npmrc.
- name: Publish packages to npm ("latest" dist-tag)
run: |
cd main
npm ci
npm exec --no release-cli -- npm-latest --semver minor --ci --repository-path ../publish
node tools/release/cli.js npm-latest --semver minor --ci --repository-path ../publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 5 additions & 4 deletions .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@ jobs:
working-directory: cli
cache: false

# Not `npm exec`: it exports the tool's .npmrc as npm_config_* variables, which override the release branch's own .npmrc.
- name: Publish development packages to npm ("next" dist-tag)
if: ${{ github.event.inputs.release_type == 'development' }}
run: |
cd cli
npm ci
npm exec --no release-cli -- npm-next --ci --repository-path ../publish
node tools/release/cli.js npm-next --ci --repository-path ../publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -105,7 +106,7 @@ jobs:
run: |
cd cli
npm ci
npm exec --no release-cli -- npm-latest --semver minor --ci --repository-path ../publish
node tools/release/cli.js npm-latest --semver minor --ci --repository-path ../publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -114,7 +115,7 @@ jobs:
run: |
cd cli
npm ci
npm exec --no release-cli -- npm-bugfix --ci --repository-path ../publish
node tools/release/cli.js npm-bugfix --ci --repository-path ../publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -123,7 +124,7 @@ jobs:
run: |
cd cli
npm ci
npm exec --no release-cli -- npm-wp --wp-version "$WP_VERSION" --ci --repository-path ../publish
node tools/release/cli.js npm-wp --wp-version "$WP_VERSION" --ci --repository-path ../publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
WP_VERSION: ${{ github.event.inputs.wp_version }}
2 changes: 1 addition & 1 deletion tools/release/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const semverOption = [ '--semver <semver>', 'Semantic Versioning', 'patch' ];
const ciOption = [ '-c, --ci', 'Run in CI (non interactive)' ];
const repositoryPathOption = [
'--repository-path <repository-path>',
'Relative path to the git repository.',
'Path to the git repository, relative to the working directory or absolute.',
];

program
Expand Down
5 changes: 2 additions & 3 deletions tools/release/commands/packages.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const path = require( 'path' );
const fs = require( 'fs' );
const readline = require( 'readline' );
const { join } = require( 'path' );
const { command } = require( 'execa' );
const glob = require( 'fast-glob' );
const { inc: semverInc, parse: semverParse } = require( 'semver' );
Expand Down Expand Up @@ -60,7 +59,7 @@ class NpmReleaseVerificationPendingError extends Error {}
* @typedef WPPackagesCommandOptions
*
* @property {boolean} [ci] Disables interactive mode when executed in CI mode.
* @property {string} [repositoryPath] Relative path to the git repository.
* @property {string} [repositoryPath] Path to the git repository, relative to the working directory or absolute.
* @property {SemVer} [semver] The selected semantic versioning. Defaults to `patch`.
* @property {string} [wpVersion] The major WordPress version number, example: `6.0`.
*/
Expand Down Expand Up @@ -2063,7 +2062,7 @@ function getConfig(
abortMessage: 'Aborting!',
distTag,
gitWorkingDirectoryPath:
repositoryPath && join( process.cwd(), repositoryPath ),
repositoryPath && path.resolve( repositoryPath ),
interactive: ! ci,
minimumVersionBump: semver,
npmReleaseBranch,
Expand Down
Loading