Skip to content
Merged
Changes from 1 commit
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
Next Next commit
Workflow: Use wp/X.Y branch when publishing to npm for WordPress core
  • Loading branch information
gziolo committed Aug 18, 2023
commit 035eb971e37748039b457edee8b5fd82c7f23034
13 changes: 7 additions & 6 deletions .github/workflows/publish-npm-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ jobs:
- name: Checkout (for CLI)
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
path: main
ref: trunk
path: cli
# Publishing for WP might require different Node and npm versions than trunk so we switch branch to avoid mismatch.
ref: ${{ github.event.inputs.release_type == 'wp' && format( 'wp/{0}', github.event.inputs.wp_version ) || 'trunk' }}

- name: Checkout (for publishing)
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
Expand All @@ -52,13 +53,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 +68,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,7 +77,7 @@ 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 cli
npm ci
./bin/plugin/cli.js npm-wp --wp-version=${{ github.event.inputs.wp_version }} --ci --repository-path ../publish
env:
Expand Down