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
8 changes: 7 additions & 1 deletion .github/workflows/npm-prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@ on:
- minor
- major

permissions:
contents: read

jobs:
prepare:
name: Prepare a new npm release
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Check out the source code
uses: actions/checkout@v6

- name: Run npm-prepare-release
uses: Automattic/vip-actions/npm-prepare-release@v0.7.3
uses: Automattic/vip-actions/npm-prepare-release@c8022b66e78461df4f802b935dc0dbb8399f96bc # v0.7.4
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
npm-version-type: ${{ inputs.npm-version-type }}
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/npm-publish-prerelease.yml

This file was deleted.

26 changes: 24 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@ name: Publish to npm (if applicable)
on:
pull_request:
types: [closed]
workflow_dispatch:
inputs:
npm_tag:
description: 'NPM tag for prerelease'
default: 'next'

jobs:
publish:
name: Publish to npm
runs-on: ubuntu-latest
environment: npm-publish
if: contains( github.event.pull_request.labels.*.name, '[ Type ] NPM version update' ) && startsWith( github.head_ref, 'release/') && github.event.pull_request.merged == true
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true && contains( github.event.pull_request.labels.*.name, '[ Type ] NPM version update' ) && startsWith( github.head_ref, 'release/')
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: Automattic/vip-actions/npm-publish@v0.7.3
- uses: Automattic/vip-actions/npm-publish@c8022b66e78461df4f802b935dc0dbb8399f96bc # v0.7.4
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USE_TRUSTED_PUBLISHING: 'true'
Expand All @@ -40,3 +45,20 @@ jobs:
needs: publish
secrets:
DOCS_SECRET_TOKEN: ${{ secrets.DOCS_SECRET_TOKEN }}

publish-prerelease:
name: Publish prerelease
runs-on: ubuntu-latest
environment: npm-publish
if: github.event_name == 'workflow_dispatch'
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: Automattic/vip-actions/npm-publish-prerelease@c8022b66e78461df4f802b935dc0dbb8399f96bc # v0.7.4
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
USE_TRUSTED_PUBLISHING: 'true'
PROVENANCE: 'true'
NPM_TAG: ${{ inputs.npm_tag }}