From b48a1f29cd12a0cacc205f269a4e47365b9a4b64 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:29:26 -0400 Subject: [PATCH 1/9] CI: Remove obsolete React Native mobile workflows --- .../workflows/gradle-wrapper-validation.yml | 22 ---- .github/workflows/rnmobile-android-runner.yml | 106 ---------------- .github/workflows/rnmobile-ios-runner.yml | 116 ------------------ 3 files changed, 244 deletions(-) delete mode 100644 .github/workflows/gradle-wrapper-validation.yml delete mode 100644 .github/workflows/rnmobile-android-runner.yml delete mode 100644 .github/workflows/rnmobile-ios-runner.yml diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml deleted file mode 100644 index b2493268d2ec66..00000000000000 --- a/.github/workflows/gradle-wrapper-validation.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Validate Gradle Wrapper' -on: [push, pull_request] - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - validation: - name: 'Validation' - runs-on: 'ubuntu-24.04' - permissions: - contents: read - steps: - - name: Checkout repository - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - - name: Validate checksums - uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2 diff --git a/.github/workflows/rnmobile-android-runner.yml b/.github/workflows/rnmobile-android-runner.yml deleted file mode 100644 index d70ebf9565c4cf..00000000000000 --- a/.github/workflows/rnmobile-android-runner.yml +++ /dev/null @@ -1,106 +0,0 @@ -name: React Native E2E Tests (Android) - -on: - pull_request: - push: - branches: [trunk] - -# Cancels all previous workflow runs for pull requests that have not completed. -concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests - # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - test: - runs-on: macos-13 - permissions: - contents: read - if: false - #if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} - strategy: - matrix: - native-test-name: [gutenberg-editor-rendering] - api-level: [29] - - steps: - - name: checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - - name: Use desired version of Java - uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 - with: - distribution: 'corretto' - java-version: '17' - - - name: Setup Node.js and install dependencies - uses: ./.github/setup-node - - - name: Restore tests setup cache - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: | - ~/.appium - key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} - - - name: Prepare tests setup - run: npm run native test:e2e:setup - - - name: Gradle cache - uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2 - - # AVD cache disabled as it caused emulator termination to hang indefinitely. - # https://github.com/ReactiveCircus/android-emulator-runner/issues/385 - # - name: AVD cache - # uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - # id: avd-cache - # with: - # path: | - # ~/.android/avd/* - # ~/.android/adb* - # key: avd-${{ matrix.api-level }} - # - # - name: Create AVD and generate snapshot for caching - # if: steps.avd-cache.outputs.cache-hit != 'true' - # uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 - # with: - # api-level: ${{ matrix.api-level }} - # force-avd-creation: false - # emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - # disable-animations: false - # arch: x86_64 - # profile: Nexus 6 - # script: echo "Generated AVD snapshot for caching." - - - name: Run tests - uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d # v2.33.0 - env: - NATIVE_TEST_NAME: ${{ matrix.native-test-name }} - with: - api-level: ${{ matrix.api-level }} - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: true - arch: x86_64 - profile: Nexus 6 - script: npm run native test:e2e:android:local "$NATIVE_TEST_NAME" - - - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: always() - with: - name: android-screen-recordings - path: packages/react-native-editor/android-screen-recordings - - - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: always() - with: - name: appium-logs - path: packages/react-native-editor/appium-out.log diff --git a/.github/workflows/rnmobile-ios-runner.yml b/.github/workflows/rnmobile-ios-runner.yml deleted file mode 100644 index 745898ef18909f..00000000000000 --- a/.github/workflows/rnmobile-ios-runner.yml +++ /dev/null @@ -1,116 +0,0 @@ -name: React Native E2E Tests (iOS) - -on: - pull_request: - push: - branches: [trunk] - -# Cancels all previous workflow runs for pull requests that have not completed. -concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests - # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - test: - runs-on: macos-13 - permissions: - contents: read - if: false - #if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }} - strategy: - matrix: - xcode: ['14.2'] - device: ['iPhone 14'] - native-test-name: [gutenberg-editor-rendering] - - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - - uses: ruby/setup-ruby@1287d2b408066abada82d5ad1c63652e758428d9 # v1.214.0 - with: - # `.ruby-version` file location - working-directory: packages/react-native-editor/ios - - - name: Switch Xcode version to ${{ matrix.xcode }} - env: - VERSION: ${{ matrix.xcode }} - run: sudo xcode-select --switch "/Applications/Xcode_${VERSION}.app" - - - name: Launch simulator - env: - DEVICE: ${{ matrix.device }} - run: (open -a Simulator && xcrun simctl boot "${DEVICE}") & - - - name: Setup Node.js and install dependencies - uses: ./.github/setup-node - - - name: Restore tests setup cache - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: | - ~/.appium - key: ${{ runner.os }}-tests-setup-${{ hashFiles('package-lock.json') }} - - - name: Prepare tests setup - run: npm run native test:e2e:setup - - - name: Prepare build cache key - run: find package-lock.json packages/react-native-editor/ios packages/react-native-aztec/ios packages/react-native-bridge/ios -type f -print0 | sort -z | xargs -0 shasum | tee ios-checksums.txt - - - name: Restore build cache - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: | - packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app - packages/react-native-editor/ios/build/WDA - key: ${{ runner.os }}-ios-build-${{ matrix.xcode }}-${{ matrix.device }}-${{ hashFiles('ios-checksums.txt') }} - - - name: Restore pods cache - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - with: - path: | - packages/react-native-editor/ios/Pods - ~/Library/Caches/CocoaPods - ~/.cocoapods/repos/trunk - packages/react-native-editor/ios/vendor - key: ${{ runner.os }}-pods-${{ hashFiles('packages/react-native-editor/ios/Gemfile.lock') }}-${{ hashFiles('packages/react-native-editor/ios/Podfile.lock') }}-${{ hashFiles('package-lock.json') }} - - - name: Bundle iOS - run: npm run native test:e2e:bundle:ios - - - name: Build (if needed) - run: test -e packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/GutenbergDemo || npm run native test:e2e:build-app:ios - - - name: Build Web Driver Agent (if needed) - run: test -d packages/react-native-editor/ios/build/WDA || npm run native test:e2e:build-wda - - - name: Run iOS Device Tests - env: - NATIVE_TEST_NAME: ${{ matrix.native-test-name }} - run: TEST_RN_PLATFORM=ios npm run native device-tests:local "$NATIVE_TEST_NAME" - - - name: Prepare build cache - run: | - rm packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/main.jsbundle - rm -rf packages/react-native-editor/ios/build/GutenbergDemo/Build/Products/Release-iphonesimulator/GutenbergDemo.app/assets - - - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: always() - with: - name: ios-screen-recordings - path: packages/react-native-editor/ios-screen-recordings - - - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: always() - with: - name: appium-logs - path: packages/react-native-editor/appium-out.log From cfc0638c4db0e9cbea864d709d30e3330e6c1db0 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:29:26 -0400 Subject: [PATCH 2/9] CI: Remove trunk-only Storybook GitHub Pages deploy workflow. --- .github/workflows/storybook-pages.yml | 38 --------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .github/workflows/storybook-pages.yml diff --git a/.github/workflows/storybook-pages.yml b/.github/workflows/storybook-pages.yml deleted file mode 100644 index 26871aebdebd26..00000000000000 --- a/.github/workflows/storybook-pages.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Storybook GitHub Pages - -on: - push: - branches: - - trunk - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - deploy: - runs-on: 'ubuntu-24.04' - permissions: - contents: write - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: trunk - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - - name: Setup Node.js and install dependencies - uses: ./.github/setup-node - - - name: Build Storybook - run: npm run storybook:build - - - name: Deploy - uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./storybook/build - force_orphan: true From 7b978154b586a59b15c6d433a94cec67b9e731db Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:29:27 -0400 Subject: [PATCH 3/9] CI: Remove trunk-only changelog verification workflows --- .../workflows/check-backport-changelog.yml | 65 --------------- .../workflows/check-components-changelog.yml | 79 ------------------- .../workflows/check-dataviews-changelog.yml | 79 ------------------- 3 files changed, 223 deletions(-) delete mode 100644 .github/workflows/check-backport-changelog.yml delete mode 100644 .github/workflows/check-components-changelog.yml delete mode 100644 .github/workflows/check-dataviews-changelog.yml diff --git a/.github/workflows/check-backport-changelog.yml b/.github/workflows/check-backport-changelog.yml deleted file mode 100644 index c91350721fc832..00000000000000 --- a/.github/workflows/check-backport-changelog.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Verify Core Backport Changelog - -on: - pull_request: - types: [opened, synchronize, labeled, unlabeled] - branches: - - trunk - paths: - - 'lib/**' - - '!lib/load.php' - - '!lib/experiments-page.php' - - '!lib/experimental/**' - - 'phpunit/**' - - '!phpunit/experimental/**' - - '!phpunit/blocks/**' - - 'packages/**/*.php' - - '!packages/block-library/**' - - '!packages/block-serialization-default-parser/**' - - '!packages/widgets/**' - - '!packages/e2e-tests/**' - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - check: - name: Check for a Core backport changelog entry - runs-on: 'ubuntu-24.04' - permissions: - contents: read - if: ${{ !contains(github.event.pull_request.labels.*.name, 'No Core Sync Required') && !contains(github.event.pull_request.labels.*.name, 'Backport from WordPress Core') }} - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - persist-credentials: false - - - name: Check the changelog folder - env: - PR_NUMBER: ${{ github.event.number }} - run: | - changelog_folder="backport-changelog" - - # Find any changelog file that contains the Gutenberg PR link - gutenberg_pr_url="https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}" - changelog_file=$(grep -rl "[-*] ${gutenberg_pr_url}" "${changelog_folder}" | head -n 1) - - # Confirm that there is an entry containing the Gutenberg PR link - if [[ -z "${changelog_file}" ]]; then - echo "Please create a core backport PR and add a file with the path /.md in the $changelog_folder folder with the core backport PR URL and a list item with this PR URL." - echo "If changes are related to an existing, open core PR, you may add this PR URL to the core PR's file." - echo "See $changelog_folder/readme.md for more information." - exit 1 - fi - - core_pr_number="$(basename "${changelog_file}" .md)" - core_pr_url="https://github\.com/WordPress/wordpress-develop/pull/${core_pr_number}" - - # Confirm that the entry has the correct core backport PR URL. - if ! grep -q -e "${core_pr_url}" "${changelog_file}"; then - echo "Please update the content of ${changelog_file} to include the core backport PR URL, or update the file name to match the core backport PR number." - exit 1 - fi diff --git a/.github/workflows/check-components-changelog.yml b/.github/workflows/check-components-changelog.yml deleted file mode 100644 index e3561c0d3da554..00000000000000 --- a/.github/workflows/check-components-changelog.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: OPTIONAL - Verify @wordpress/components CHANGELOG update - -on: - pull_request: - types: [opened, synchronize] - branches: - - trunk - paths: - - 'packages/components/**' - - '!packages/components/src/**/stories/**' - - '!packages/components/src/**/test/**' - - '!packages/components/src/**/*.android.js' - - '!packages/components/src/**/*.ios.js' - - '!packages/components/src/**/*.native.js' - - '!packages/components/src/**/*.native.scss' - - '!packages/components/src/**/react-native-*' - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - check: - name: Check CHANGELOG diff - runs-on: 'ubuntu-24.04' - permissions: - contents: read - steps: - - name: 'Get PR commit count' - env: - PR_COUNT: ${{ github.event.pull_request.commits }} - run: echo "PR_COMMIT_COUNT=$(( PR_COUNT + 1 ))" >> "${GITHUB_ENV}" - - name: Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: ${{ env.PR_COMMIT_COUNT }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - name: 'Fetch relevant history from origin' - run: git fetch origin "$GITHUB_BASE_REF" - - name: Check CHANGELOG status - env: - PR_NUMBER: ${{ github.event.number }} - BASE_SHA: ${{ github.event.pull_request.base.sha }} - run: | - changelog_path="packages/components/CHANGELOG.md" - optional_check_notice="This isn't a required check, so if you think your changes are small enough that they don't warrant a CHANGELOG entry, please go ahead and merge without one." - - # Fail if the PR doesn't touch the changelog - if git diff --quiet "$BASE_SHA" HEAD -- "$changelog_path"; then - echo "Please add a CHANGELOG entry to $changelog_path" - echo - echo "${optional_check_notice}" - exit 1 - fi - - pr_link_pattern="\[#${PR_NUMBER}\]\(https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}\)" - pr_link_grep_pattern="\[#${PR_NUMBER}\](https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER})" - - unreleased_section=$(sed -n '/^## Unreleased$/,/^## /p' "${changelog_path}") - - # Confirm that the CHANGELOG has an entry for the current PR - if ! grep -nq -e "${pr_link_grep_pattern}" "${changelog_path}"; then - echo "Please add a CHANGELOG entry to $changelog_path, and make sure your CHANGELOG entry has a link to the current PR." - echo - echo "${optional_check_notice}" - exit 1 - fi - - # Confirm that there is an 'Unreleased' section and that the relevant entry is in that section - if ! grep -nq -e '^## Unreleased' "${changelog_path}" || \ - ! [[ $unreleased_section = *${pr_link_pattern}* ]]; then - echo "Please make sure your CHANGELOG entry is in the \`## Unreleased\` section" - echo - echo "${optional_check_notice}" - exit 1 - fi diff --git a/.github/workflows/check-dataviews-changelog.yml b/.github/workflows/check-dataviews-changelog.yml deleted file mode 100644 index 9b03ebe469757e..00000000000000 --- a/.github/workflows/check-dataviews-changelog.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: OPTIONAL - Verify @wordpress/dataviews CHANGELOG update - -on: - pull_request: - types: [opened, synchronize] - branches: - - trunk - paths: - - 'packages/dataviews/**' - - '!packages/dataviews/src/**/stories/**' - - '!packages/dataviews/src/**/test/**' - - '!packages/dataviews/src/**/*.android.js' - - '!packages/dataviews/src/**/*.ios.js' - - '!packages/dataviews/src/**/*.native.js' - - '!packages/dataviews/src/**/*.native.scss' - - '!packages/dataviews/src/**/react-native-*' - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - check: - name: Check CHANGELOG diff - runs-on: 'ubuntu-24.04' - permissions: - contents: read - steps: - - name: 'Get PR commit count' - env: - PR_COUNT: ${{ github.event.pull_request.commits }} - run: echo "PR_COMMIT_COUNT=$(( PR_COUNT + 1 ))" >> "${GITHUB_ENV}" - - name: Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ github.event.pull_request.head.ref }} - repository: ${{ github.event.pull_request.head.repo.full_name }} - fetch-depth: ${{ env.PR_COMMIT_COUNT }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - name: 'Fetch relevant history from origin' - run: git fetch origin "$GITHUB_BASE_REF" - - name: Check CHANGELOG status - env: - PR_NUMBER: ${{ github.event.number }} - BASE_SHA: ${{ github.event.pull_request.base.sha }} - run: | - changelog_path="packages/dataviews/CHANGELOG.md" - optional_check_notice="This isn't a required check, so if you think your changes are small enough that they don't warrant a CHANGELOG entry, please go ahead and merge without one." - - # Fail if the PR doesn't touch the changelog - if git diff --quiet "$BASE_SHA" HEAD -- "$changelog_path"; then - echo "Please add a CHANGELOG entry to $changelog_path" - echo - echo "${optional_check_notice}" - exit 1 - fi - - pr_link_pattern="\[#${PR_NUMBER}\]\(https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER}\)" - pr_link_grep_pattern="\[#${PR_NUMBER}\](https://github\.com/WordPress/gutenberg/pull/${PR_NUMBER})" - - unreleased_section=$(sed -n '/^## Unreleased$/,/^## /p' "${changelog_path}") - - # Confirm that the CHANGELOG has an entry for the current PR - if ! grep -nq -e "${pr_link_grep_pattern}" "${changelog_path}"; then - echo "Please add a CHANGELOG entry to $changelog_path, and make sure your CHANGELOG entry has a link to the current PR." - echo - echo "${optional_check_notice}" - exit 1 - fi - - # Confirm that there is an 'Unreleased' section and that the relevant entry is in that section - if ! grep -nq -e '^## Unreleased' "${changelog_path}" || \ - ! [[ $unreleased_section = *${pr_link_pattern}* ]]; then - echo "Please make sure your CHANGELOG entry is in the \`## Unreleased\` section" - echo - echo "${optional_check_notice}" - exit 1 - fi From c61774c8dfe1bc28cb4ef1a2f05e8a133d89e5c1 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:29:27 -0400 Subject: [PATCH 4/9] CI: Remove trunk-only WordPress.org plugin repo publishing workflows --- .../workflows/sync-assets-to-plugin-repo.yml | 55 ---- .../upload-release-to-plugin-repo.yml | 286 ------------------ 2 files changed, 341 deletions(-) delete mode 100644 .github/workflows/sync-assets-to-plugin-repo.yml delete mode 100644 .github/workflows/upload-release-to-plugin-repo.yml diff --git a/.github/workflows/sync-assets-to-plugin-repo.yml b/.github/workflows/sync-assets-to-plugin-repo.yml deleted file mode 100644 index 65282f6ab3d0e5..00000000000000 --- a/.github/workflows/sync-assets-to-plugin-repo.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Sync Gutenberg plugin assets to WordPress.org plugin repo - -on: - push: - branches: - - trunk - paths: - - assets/** - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - sync-assets: - name: Sync assets to WordPress.org plugin repo - runs-on: 'ubuntu-24.04' - permissions: - contents: read - environment: wp.org plugin - env: - PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg' - SVN_USERNAME: ${{ secrets.SVN_USERNAME }} - SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} - - steps: - - name: Check out Gutenberg assets folder from WP.org plugin repo - run: | - svn checkout "$PLUGIN_REPO_URL/assets" \ - --username "$SVN_USERNAME" --password "$SVN_PASSWORD" - - - name: Delete everything - run: find assets -type f -not -path 'assets/.svn/*' -delete - - - name: Checkout assets from current release - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - sparse-checkout: | - assets - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - path: git - persist-credentials: false - - - name: Copy files from git checkout to svn working copy - run: cp -R git/assets/* assets - - - name: Commit the updated assets - working-directory: ./assets - run: | - svn st | awk '/^?/ {print $2}' | xargs -r svn add - svn st | awk '/^!/ {print $2}' | xargs -r svn rm - svn commit . \ - -m "Sync assets for commit $GITHUB_SHA" \ - --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ - --config-option=servers:global:http-timeout=600 diff --git a/.github/workflows/upload-release-to-plugin-repo.yml b/.github/workflows/upload-release-to-plugin-repo.yml deleted file mode 100644 index 0ebc212bfaf45e..00000000000000 --- a/.github/workflows/upload-release-to-plugin-repo.yml +++ /dev/null @@ -1,286 +0,0 @@ -name: Update Changelog and upload Gutenberg plugin to WordPress.org plugin repo - -on: - release: - types: [published] - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - validate-github-ref: - name: Validate github.ref - runs-on: 'ubuntu-24.04' - permissions: {} - steps: - - name: Check github.ref - run: | - if [ -z "${{ github.ref }}" ]; then - echo "::error::github.ref is empty ('${{ github.ref }}')" - exit 1 - fi - echo "github.ref is valid: ${{ github.ref }}" - - compute-should-update-trunk: - name: Decide if trunk or tag - runs-on: 'ubuntu-24.04' - permissions: {} - needs: validate-github-ref - # Skip this job if the release is a release candidate. This will in turn skip - # the upload jobs, which are only relevant for non-RC releases. - # We first check if the release is a prerelease, and then if the ref contains - # the string "rc". The latter is fallback in case the deployer accidentally - # unchecks the "This is a pre-release" checkbox in the release UI. - if: | - !github.event.release.prerelease && !contains(github.ref, 'rc') - - outputs: - should_update_trunk: ${{ steps.compute_should_update_trunk.outputs.should_update_trunk }} - - steps: - - name: Fetch latest version in the WP core repo - id: compute_latest_version_in_core_repo - run: | - latest_version_in_core_repo=$(curl -s 'https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request\[slug\]=gutenberg' | jq -r '.version') - echo "Latest Core Repo version: $latest_version_in_core_repo" - echo "version=$latest_version_in_core_repo" >> "$GITHUB_OUTPUT" - - - name: Decide if it is a trunk or tag update - id: compute_should_update_trunk - env: - GITHUB_REF: ${{ github.ref }} - LATEST_VERSION: ${{ steps.compute_latest_version_in_core_repo.outputs.version }} - run: | - latestPublishedVersion=$(echo "$GITHUB_REF" | sed -E 's/refs\/tags\/(v?)([0-9.]+)/\2/') - - # Determines if the first version string is greater than the second version string. - # - # Params: - # $1 - The first version string to compare, which may have an optional leading "v". - # $2 - The second version string to compare, which may have an optional leading "v". - # - # Return values: - # 0 - The first version string is greater than the second version string. - # 1 - The first version string is less than or equal to the second version string. - is_first_version_greater_than_second() { - v1=${1#v} - v2=${2#v} - dpkg --compare-versions "$v1" gt "$v2" - return $? - } - - # Only update trunk *if* the published release's version in GitHub is GREATER - # than the version currently published in the WP plugins repo. If not, then it - # will upload it as a new tag. - shouldUpdateTrunk=false - if is_first_version_greater_than_second "$latestPublishedVersion" "$LATEST_VERSION"; then - shouldUpdateTrunk=true - fi - - echo "Should update trunk: $shouldUpdateTrunk" - echo "should_update_trunk=$shouldUpdateTrunk" >> "$GITHUB_OUTPUT" - - get-release-branch: - name: Get release branch name - runs-on: 'ubuntu-24.04' - permissions: {} - needs: validate-github-ref - outputs: - release_branch: ${{ steps.get_release_branch.outputs.release_branch }} - - steps: - - name: Compute release branch name - id: get_release_branch - env: - TAG: ${{ github.event.release.tag_name }} - run: | - IFS='.' read -r -a VERSION_ARRAY <<< "${TAG#v}" - RELEASE_BRANCH="release/${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}" - echo "release_branch=${RELEASE_BRANCH}" >> "$GITHUB_OUTPUT" - - update-changelog: - name: Update Changelog on ${{ matrix.branch }} branch - runs-on: 'ubuntu-24.04' - permissions: - contents: write - if: | - github.event.release.assets[0] - needs: get-release-branch - env: - TAG: ${{ github.event.release.tag_name }} - strategy: - matrix: - include: - - branch: trunk - label: trunk - - branch: ${{ needs.get-release-branch.outputs.release_branch }} - label: release - - steps: - - name: Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ matrix.branch }} - token: ${{ secrets.GUTENBERG_TOKEN }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: true - - - name: Update the Changelog to include the release notes - env: - RELEASE_BODY: ${{ github.event.release.body }} - run: | - # First, determine where to insert the new Changelog entry. - SERIES="${RELEASE_BRANCH#release/}" - SERIES_REGEX="=\s${SERIES}\.[0-9]+\s=" - CUT_MARKS=$( grep -nP -m 1 "${SERIES_REGEX}" changelog.txt | cut -d: -f1 ) - if [[ -z "${CUT_MARKS}" ]]; then - CHANGELOG_REGEX="=\s[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?\s=" - RC_REGEX="=\s${TAG#v}(-rc\.[0-9]+)?\s=" - CUT_MARKS=$( awk "/${RC_REGEX}/ {print NR; next}; /${CHANGELOG_REGEX}/ {print NR; exit}" changelog.txt ) - fi - BEFORE=$( echo "$CUT_MARKS" | head -n 1 ) - AFTER=$( echo "$CUT_MARKS" | tail -n 1 ) - # Okay, we have all we need to build the new Changelog. - head -n $(( "${BEFORE}" - 1 )) changelog.txt > new_changelog.txt - printf '= %s =\n\n' "${TAG#v}" >> new_changelog.txt - # Need to use a heredoc in order to preserve special characters. - echo "$RELEASE_BODY" > release_notes.txt - # Normalize empty lines: Trim them from beginning and end of file... - awk 'NF {p=1} p' <<< "$(< release_notes.txt)" >> new_changelog.txt - # ...then add two empty lines at the end. - printf '\n\n' >> new_changelog.txt - tail -n +"${AFTER}" changelog.txt >> new_changelog.txt - mv new_changelog.txt changelog.txt - - - name: Configure git user name and email - run: | - git config user.name "Gutenberg Repository Automation" - git config user.email gutenberg@wordpress.org - - - name: Commit the Changelog update - env: - TARGET_BRANCH: ${{ matrix.branch }} - run: | - git add changelog.txt - # Remove files that are not meant to be committed - # ie. release_notes.txt created on the previous step. - git clean -fd - # Only attempt to commit changelog if it has been modified. - if ! git diff-index --quiet HEAD --; then - git commit -m "Update Changelog for ${TAG#v}" - git push --set-upstream origin "$TARGET_BRANCH" - fi - - - name: Upload Changelog artifact - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - with: - name: changelog ${{ matrix.label }} - path: ./changelog.txt - - upload: - name: Publish as trunk (and tag) - runs-on: 'ubuntu-24.04' - permissions: {} - environment: wp.org plugin - needs: [compute-should-update-trunk, update-changelog] - if: | - needs.compute-should-update-trunk.outputs.should_update_trunk == 'true' && github.event.release.assets[0] - env: - PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg' - STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*' - SVN_USERNAME: ${{ secrets.svn_username }} - SVN_PASSWORD: ${{ secrets.svn_password }} - VERSION: ${{ github.event.release.name }} - - steps: - - name: Install Subversion - run: | - sudo apt-get update -y && sudo apt-get install -y subversion - - - name: Check out Gutenberg trunk from WP.org plugin repo - run: | - svn checkout "$PLUGIN_REPO_URL/trunk" --username "$SVN_USERNAME" --password "$SVN_PASSWORD" - svn checkout "$PLUGIN_REPO_URL/tags" --depth=immediates --username "$SVN_USERNAME" --password "$SVN_PASSWORD" - - - name: Delete everything - working-directory: ./trunk - run: find . -maxdepth 1 -not -name ".svn" -not -name "." -not -name ".." -exec rm -rf {} + - - - name: Download and unzip Gutenberg plugin asset into trunk folder - env: - PLUGIN_URL: ${{ github.event.release.assets[0].browser_download_url }} - run: | - curl -L -o gutenberg.zip "$PLUGIN_URL" - unzip gutenberg.zip -d trunk - rm gutenberg.zip - - - name: Replace the stable tag placeholder with the new version - env: - STABLE_TAG_PLACEHOLDER: 'Stable tag: V\.V\.V' - run: | - sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" ./trunk/readme.txt - - - name: Download Changelog Artifact - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 - with: - name: changelog trunk - path: trunk - - - name: Commit the release - working-directory: ./trunk - run: | - svn st | grep '^?' | awk '{print $2}' | xargs -r svn add - svn st | grep '^!' | awk '{print $2}' | xargs -r svn rm - svn cp . "../tags/$VERSION" - svn commit . "../tags/$VERSION" \ - -m "Releasing version $VERSION" \ - --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ - --config-option=servers:global:http-timeout=600 - - upload-tag: - name: Publish as tag - runs-on: 'ubuntu-24.04' - permissions: {} - environment: wp.org plugin - needs: [compute-should-update-trunk, update-changelog] - if: | - needs.compute-should-update-trunk.outputs.should_update_trunk == 'false' && github.event.release.assets[0] - env: - PLUGIN_REPO_URL: 'https://plugins.svn.wordpress.org/gutenberg' - STABLE_VERSION_REGEX: '[0-9]\+\.[0-9]\+\.[0-9]\+\s*' - SVN_USERNAME: ${{ secrets.svn_username }} - SVN_PASSWORD: ${{ secrets.svn_password }} - VERSION: ${{ github.event.release.name }} - - steps: - - name: Install Subversion - run: | - sudo apt-get update -y && sudo apt-get install -y subversion - - - name: Download and unzip Gutenberg plugin asset into tags folder - env: - PLUGIN_URL: ${{ github.event.release.assets[0].browser_download_url }} - run: | - # do the magic here - curl -L -o gutenberg.zip "$PLUGIN_URL" - unzip gutenberg.zip -d "$VERSION" - rm gutenberg.zip - - - name: Replace the stable tag placeholder with the existing stable tag on the SVN repository - env: - STABLE_TAG_PLACEHOLDER: 'Stable tag: V\.V\.V' - run: | - sed -i "s/$STABLE_TAG_PLACEHOLDER/Stable tag: $VERSION/g" "$VERSION/readme.txt" - - - name: Download Changelog Artifact - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 - with: - name: changelog trunk - path: ${{ github.event.release.name }} - - - name: Add the new version directory and commit changes to the SVN repository - run: | - svn import "$VERSION" "$PLUGIN_REPO_URL/tags/$VERSION" -m "Committing version $VERSION" \ - --no-auth-cache --non-interactive --username "$SVN_USERNAME" --password "$SVN_PASSWORD" \ - --config-option=servers:global:http-timeout=300 From acda2537da3ab481aaacb576081151aea84384cc Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:29:27 -0400 Subject: [PATCH 5/9] Remove trunk-only release automation workflow. --- .github/workflows/cherry-pick-wp-release.yml | 193 ------------------- 1 file changed, 193 deletions(-) delete mode 100644 .github/workflows/cherry-pick-wp-release.yml diff --git a/.github/workflows/cherry-pick-wp-release.yml b/.github/workflows/cherry-pick-wp-release.yml deleted file mode 100644 index 46ca258398f33d..00000000000000 --- a/.github/workflows/cherry-pick-wp-release.yml +++ /dev/null @@ -1,193 +0,0 @@ -name: Auto Cherry-Pick - -on: - push: - branches: - - trunk - # We also want to attempt cherry-picking when a PR is labeled after the PR - # is merged. - pull_request: - types: [labeled] - branches: - - trunk - -# Ensure that new jobs wait for the previous job to finish. -concurrency: - group: ${{ github.workflow }} - cancel-in-progress: false - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - cherry-pick: - runs-on: 'ubuntu-24.04' - permissions: - contents: write - issues: write - pull-requests: read - # When in the context of a PR, ensure the PR is merged. - if: github.event.pull_request == null || github.event.pull_request.merged == true - steps: - - name: Determine if label should trigger cherry-pick - id: label-check - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const commit_sha = context.payload.pull_request ? context.payload.pull_request.merge_commit_sha : context.sha; - console.log(`Commit SHA: ${commit_sha}`); - core.exportVariable('commit_sha', commit_sha); - const prs = await github.rest.repos.listPullRequestsAssociatedWithCommit({ - owner: context.repo.owner, - repo: context.repo.repo, - commit_sha, - }); - if (prs.data.length === 0) { - console.log(`No PR found for commit ${context.sha}.`); - return; - } - const pr_number = prs.data[0].number; - console.log(`PR: ${pr_number}`); - core.exportVariable('pr_number', pr_number); - - const pr = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: pr_number, - }); - const labels = pr.data.labels.map(label => label.name); - console.log(`Labels: ${labels}`); - const regex = /^Backport to WP ([0-9]+\.[0-9]+) Beta\/RC$/; - let matched = false; - for (const label of labels) { - const match = label.match(regex); - if (match) { - const version = match[1]; - console.log(`Matched label: ${label}`); - console.log(`Extracted version: ${version}`); - core.exportVariable('cherry_pick', 'true'); - core.exportVariable('version', version); - matched = true; - break; - } - } - if (!matched) { - core.exportVariable('cherry_pick', 'false'); - } - - - name: Checkout repository - if: env.cherry_pick == 'true' - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - token: ${{ secrets.GUTENBERG_TOKEN }} - fetch-depth: 0 - persist-credentials: false - - - name: Set up Git - if: env.cherry_pick == 'true' - run: | - git config --global user.name "Gutenberg Repository Automation" - git config --global user.email "gutenberg@wordpress.org" - - - name: Cherry-pick the commit - id: cherry-pick - if: env.cherry_pick == 'true' - run: | - TARGET_BRANCH="wp/${version}" - COMMIT_SHA="${commit_sha}" - echo "Target branch: $TARGET_BRANCH" - echo "Commit SHA: $COMMIT_SHA" - git checkout "$TARGET_BRANCH" - git cherry-pick "$COMMIT_SHA" || echo "cherry-pick-failed" > result - if [ -f result ] && grep -q "cherry-pick-failed" result; then - echo "conflict=true" >> "$GITHUB_ENV" - git cherry-pick --abort - else - CHERRY_PICK_SHA="$(git rev-parse HEAD)" - echo "conflict=false" >> "$GITHUB_ENV" - echo "cherry_pick_sha=$CHERRY_PICK_SHA" >> "$GITHUB_ENV" - git push origin "$TARGET_BRANCH" - fi - - - name: Remove cherry-pick label - if: env.cherry_pick == 'true' && env.conflict == 'false' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const prNumber = process.env.pr_number; - const version = process.env.version; - console.log(`prNumber: ${prNumber}`); - console.log(`version: ${version}`); - const oldLabel = `Backport to WP ${version} Beta/RC`; - const newLabel = `Backported to WP Core`; - await github.rest.issues.removeLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - name: oldLabel - }); - await github.rest.issues.addLabels({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - labels: [newLabel] - }); - - - name: Comment on the PR - if: env.cherry_pick == 'true' && env.conflict == 'false' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const prNumber = process.env.pr_number; - const cherryPickSha = process.env.cherry_pick_sha; - const targetBranch = `wp/${process.env.version}`; - console.log(`prNumber: ${prNumber}`); - console.log(`cherryPickSha: ${cherryPickSha}`); - console.log(`targetBranch: ${targetBranch}`); - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - body: `I just cherry-picked this PR to the ${targetBranch} branch to get it included in the next release: ${cherryPickSha}` - }); - - - name: Comment on the PR about conflict - if: env.cherry_pick == 'true' && env.conflict == 'true' - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const prNumber = process.env.pr_number; - const commitSha = process.env.commit_sha; - const targetBranch = `wp/${process.env.version}`; - console.log(`prNumber: ${prNumber}`); - console.log(`targetBranch: ${targetBranch}`); - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: prNumber, - body: `There was a conflict while trying to cherry-pick the commit to the ${targetBranch} branch. Please resolve the conflict manually and create a PR to the ${targetBranch} branch. - - PRs to ${targetBranch} are similar to PRs to trunk, but you should base your PR on the ${targetBranch} branch instead of trunk. - - \`\`\` - # Checkout the ${targetBranch} branch instead of trunk. - git checkout ${targetBranch} - # Create a new branch for your PR. - git checkout -b my-branch - # Cherry-pick the commit. - git cherry-pick ${commitSha} - # Check which files have conflicts. - git status - # Resolve the conflict... - # Add the resolved files to the staging area. - git status - git add . - git cherry-pick --continue - # Push the branch to the repository - git push origin my-branch - # Create a PR and set the base to the ${targetBranch} branch. - # See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-base-branch-of-a-pull-request. - \`\`\` - ` - }); From aedfb118e78c0f5e639a20f1a0212d0ba8f123a7 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Mon, 14 Sep 2026 14:29:27 -0400 Subject: [PATCH 6/9] CI: Remove trunk-only issue management workflows --- .github/workflows/stale-issue-gardening.yml | 54 ---------- .github/workflows/sync-backport-changelog.yml | 99 ------------------- 2 files changed, 153 deletions(-) delete mode 100644 .github/workflows/stale-issue-gardening.yml delete mode 100644 .github/workflows/sync-backport-changelog.yml diff --git a/.github/workflows/stale-issue-gardening.yml b/.github/workflows/stale-issue-gardening.yml deleted file mode 100644 index 61abcaeda59add..00000000000000 --- a/.github/workflows/stale-issue-gardening.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: 'Stale Issue Gardening' - -on: - schedule: - - cron: '0 0 * * *' - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - issue-gardening: - name: ${{ matrix.name }} - runs-on: 'ubuntu-24.04' - permissions: - issues: write - pull-requests: write - if: ${{ github.repository == 'WordPress/gutenberg' }} - strategy: - matrix: - include: - - name: 'Issues that require more info' - message: 'Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.' - days-before-stale: 15 - days-before-close: -1 - only-labels: '[Status] Needs More Info' - remove-stale-when-updated: true - stale-issue-label: '[Status] Stale' - - name: 'Issues that have needed testing for a period of time' - message: "Hi,\nThis issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.\nThanks for helping out." - days-before-stale: 30 - days-before-close: -1 - only-labels: 'Needs Testing' - remove-stale-when-updated: true - stale-issue-label: '[Status] Stale' - - name: 'Flaky test issues without activity' - message: 'This issue has gone 15 days without any activity.' - days-before-stale: 15 - days-before-close: 1 - only-labels: '[Type] Flaky Test' - remove-stale-when-updated: true - stale-issue-label: '[Status] Stale' - - steps: - - name: Update issues - uses: actions/stale@5f858e3efba33a5ca4407a664cc011ad407f2008 # v10.1.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: ${{ matrix.message }} - days-before-stale: ${{ matrix.days-before-stale }} - days-before-close: ${{ matrix.days-before-close }} - only-labels: ${{ matrix.only-labels }} - remove-stale-when-updated: ${{ matrix.remove-stale-when-updated }} - stale-issue-label: ${{ matrix.stale-issue-label }} diff --git a/.github/workflows/sync-backport-changelog.yml b/.github/workflows/sync-backport-changelog.yml deleted file mode 100644 index e91c618b2ba1c2..00000000000000 --- a/.github/workflows/sync-backport-changelog.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Sync Core Backport Issue - -on: - push: - branches: - - trunk - issues: - types: [labeled] - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - sync-backport-changelog: - name: Sync Core Backport Issue - runs-on: 'ubuntu-24.04' - permissions: - contents: read - issues: write - if: > - github.event_name == 'push' || - ( - github.event_name == 'issues' && - github.event.action == 'labeled' && - github.event.label.name == '🤖 Sync Backport Changelog' - ) - steps: - - name: Checkout - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - fetch-depth: 2 # Fetch the last two commits to compare changes - persist-credentials: false - - name: Check for changes in backport-changelog - if: github.event_name == 'push' - run: | - if git diff --quiet HEAD^ HEAD -- backport-changelog; then - echo "skip_sync=true" >> "$GITHUB_ENV" - fi - - name: Sync Issue - if: ${{ ! env.skip_sync }} - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 - with: - script: | - const labelName = '🤖 Sync Backport Changelog'; - const issues = await github.paginate(github.rest.issues.listForRepo, { - owner: context.repo.owner, - repo: context.repo.repo, - labels: [labelName], - state: 'open', - per_page: 1, - }); - - if (issues.length === 0) { - console.log(`No issues found with the "${labelName}" label.`); - return; - } - - const [latestIssue] = issues; - const versionMatch = latestIssue.title.match(/(\d+\.\d+)/); - if (!versionMatch) { - console.log('Could not find a version number in the latest issue title.'); - return; - } - - const version = versionMatch[1]; - console.log(`Latest version: ${version}`); - - const { execSync } = require('child_process'); - const processedChangelog = execSync(`awk '/./ {print ($0 ~ /^[-*]/ ? " " : "- ") $0}' backport-changelog/${version}/*.md`).toString().trim(); - - const startDelimiter = ''; - const endDelimiter = ''; - const autoGeneratedContent = `${startDelimiter}\n${processedChangelog}\n${endDelimiter}`; - - const existingBody = latestIssue.body ?? ''; - - let newBody; - - const regex = new RegExp(`${startDelimiter}[\\s\\S]*${endDelimiter}`); - if (regex.test(existingBody)) { - // If delimiters exist, replace the content between them - newBody = existingBody.replace(regex, autoGeneratedContent); - } else { - // If delimiters don't exist, append the new content at the end - newBody = `${existingBody}\n\n${autoGeneratedContent}`; - } - - if (newBody.trim() !== existingBody.trim()) { - await github.rest.issues.update({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: latestIssue.number, - body: newBody - }); - console.log('Issue description updated successfully.'); - } else { - console.log('Issue description is already up to date.'); - } From 500b2cb4eeca706ecf1df222ed9e900f31f53243 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Thu, 8 Oct 2026 15:08:23 -0400 Subject: [PATCH 7/9] Remove `pull-request-automation.yml` and `enforce-pr-labels.yml`: `pull_request_target` runs always use the workflow file from trunk, so this branch's copies never run. --- .github/workflows/enforce-pr-labels.yml | 23 ------------- .github/workflows/pull-request-automation.yml | 34 ------------------- 2 files changed, 57 deletions(-) delete mode 100644 .github/workflows/enforce-pr-labels.yml delete mode 100644 .github/workflows/pull-request-automation.yml diff --git a/.github/workflows/enforce-pr-labels.yml b/.github/workflows/enforce-pr-labels.yml deleted file mode 100644 index e018ac9c9d719c..00000000000000 --- a/.github/workflows/enforce-pr-labels.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Enforce labels on Pull Request -on: - pull_request_target: - types: [labeled, unlabeled, ready_for_review, review_requested] - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - type-related-labels: - runs-on: 'ubuntu-24.04' - permissions: - pull-requests: write - steps: - - uses: mheap/github-action-required-labels@v5 - with: - mode: exactly - count: 1 - labels: '[Type] Automated Testing, [Type] Breaking Change, [Type] Bug, [Type] Build Tooling, [Type] Code Quality, [Type] Copy, [Type] Developer Documentation, [Type] Enhancement, [Type] Experimental, [Type] Feature, [Type] New API, [Type] Task, [Type] Technical Prototype, [Type] Performance, [Type] Project Management, [Type] Regression, [Type] Security, [Type] WP Core Ticket, Backport from WordPress Core, Gutenberg Plugin, New Block' - add_comment: true - message: "**Warning: Type of PR label mismatch**\n\n To merge this PR, it requires {{ errorString }} {{ count }} label indicating the type of PR. Other labels are optional and not being checked here. \n- **Type-related labels to choose from**: {{ provided }}.\n- **Labels found**: {{ applied }}.\n\nRead more about [Type labels in Gutenberg](https://github.com/WordPress/gutenberg/labels?q=type). Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task." - exit_type: failure diff --git a/.github/workflows/pull-request-automation.yml b/.github/workflows/pull-request-automation.yml deleted file mode 100644 index cb98aba5c30972..00000000000000 --- a/.github/workflows/pull-request-automation.yml +++ /dev/null @@ -1,34 +0,0 @@ -on: - pull_request_target: - types: [opened] - push: -name: Pull request automation - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - pull-request-automation: - runs-on: 'ubuntu-24.04' - permissions: - contents: read - issues: write - pull-requests: write - if: ${{ github.repository == 'WordPress/gutenberg' }} - - steps: - # Checkout defaults to using the branch which triggered the event, which - # isn't necessarily `trunk` (e.g. in the case of a merge). - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: trunk - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - - name: Setup Node.js and install dependencies - uses: ./.github/setup-node - - - uses: ./packages/project-management-automation - with: - github_token: ${{ secrets.GITHUB_TOKEN }} From ce155aefec336dc4c8260a3bd156738c2df6ba55 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:12:36 -0400 Subject: [PATCH 8/9] Remove the performance tests workflow. --- .github/workflows/performance.yml | 120 ------------------------------ 1 file changed, 120 deletions(-) delete mode 100644 .github/workflows/performance.yml diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml deleted file mode 100644 index 0b50fb0386cad2..00000000000000 --- a/.github/workflows/performance.yml +++ /dev/null @@ -1,120 +0,0 @@ -name: Performance Tests - -on: - pull_request: - release: - types: [published] - push: - branches: [trunk] - workflow_dispatch: - inputs: - branches: - description: 'branches or commits to compare (comma separated)' - required: true - wpversion: - description: 'The base WP version to use for the tests (latest or 6.0, 6.1...)' - required: false - default: 'latest' - -# Cancels all previous workflow runs for pull requests that have not completed. -concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests - # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - performance: - timeout-minutes: 60 - name: Run performance tests - runs-on: 'ubuntu-24.04' - permissions: - contents: read - if: ${{ github.repository == 'WordPress/gutenberg' }} - env: - WP_ARTIFACTS_PATH: ${{ github.workspace }}/artifacts - - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - - 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 base branch - if: github.event_name == 'pull_request' - run: ./bin/plugin/cli.js perf "$GITHUB_SHA" "$GITHUB_BASE_REF" --tests-branch "$GITHUB_SHA" --wp-version "6.8" - - - name: Compare performance with current WordPress Core and previous Gutenberg versions - if: github.event_name == 'release' - env: - PLUGIN_VERSION: ${{ github.event.release.name }} - shell: bash - run: | - IFS=. read -ra PLUGIN_VERSION_ARRAY <<< "$PLUGIN_VERSION" - CURRENT_RELEASE_BRANCH="release/${PLUGIN_VERSION_ARRAY[0]}.${PLUGIN_VERSION_ARRAY[1]}" - PREVIOUS_VERSION_BASE_10=$((PLUGIN_VERSION_ARRAY[0] * 10 + PLUGIN_VERSION_ARRAY[1] - 1)) - PREVIOUS_RELEASE_BRANCH="release/$((PREVIOUS_VERSION_BASE_10 / 10)).$((PREVIOUS_VERSION_BASE_10 % 10))" - WP_VERSION="$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)" - IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION" - WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}" - ./bin/plugin/cli.js perf "wp/$WP_MAJOR" "$PREVIOUS_RELEASE_BRANCH" "$CURRENT_RELEASE_BRANCH" --tests-branch "$GITHUB_SHA" --wp-version "$WP_MAJOR" - - - name: Compare performance with base branch - if: github.event_name == 'push' - # The base hash used here need to be a commit that is compatible with the current WP version - # The current one is 1b8efa77d39f68fb3d963ea02ce6ea6a8201d521 and it needs to be updated every WP major release. - # It is used as a base comparison point to avoid fluctuation in the performance metrics. - # See: https://developer.wordpress.org/block-editor/explanations/architecture/performance/#update-the-reference-commit. - run: | - WP_VERSION="$(awk -F ': ' '/^Tested up to/{print $2}' readme.txt)" - IFS=. read -ra WP_VERSION_ARRAY <<< "$WP_VERSION" - WP_MAJOR="${WP_VERSION_ARRAY[0]}.${WP_VERSION_ARRAY[1]}" - ./bin/plugin/cli.js perf "$GITHUB_SHA" 1b8efa77d39f68fb3d963ea02ce6ea6a8201d521 --tests-branch "$GITHUB_SHA" --wp-version "$WP_MAJOR" - - - name: Compare performance with custom branches - if: github.event_name == 'workflow_dispatch' - env: - BRANCHES: ${{ github.event.inputs.branches }} - WP_VERSION: ${{ github.event.inputs.wpversion }} - run: | - ./bin/plugin/cli.js perf "$(echo "$BRANCHES" | tr ',' ' ')" --tests-branch "$GITHUB_SHA" --wp-version "$WP_VERSION" - - - name: Add workflow summary - run: cat "${WP_ARTIFACTS_PATH}/summary.md" >> "$GITHUB_STEP_SUMMARY" - - - name: Archive performance results - if: success() - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - with: - name: performance-results - path: ${{ env.WP_ARTIFACTS_PATH }}/*.performance-results*.json - - - name: Publish performance results - if: github.event_name == 'push' - env: - CODEHEALTH_PROJECT_TOKEN: ${{ secrets.CODEHEALTH_PROJECT_TOKEN }} - run: | - COMMITTED_AT="$(git show -s "$GITHUB_SHA" --format="%cI")" - ./bin/log-performance-results.js "$CODEHEALTH_PROJECT_TOKEN" trunk "$GITHUB_SHA" 1b8efa77d39f68fb3d963ea02ce6ea6a8201d521 "$COMMITTED_AT" - - - name: Archive debug artifacts (screenshots, HTML snapshots) - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - if: failure() - with: - name: failures-artifacts - path: ${{ env.WP_ARTIFACTS_PATH }} - if-no-files-found: ignore From 974664b00f23836590ada6c390e604e822f0107b Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Date: Fri, 9 Oct 2026 19:17:13 -0400 Subject: [PATCH 9/9] Remove the plugin zip build workflow. --- .github/workflows/build-plugin-zip.yml | 394 ------------------------- 1 file changed, 394 deletions(-) delete mode 100644 .github/workflows/build-plugin-zip.yml diff --git a/.github/workflows/build-plugin-zip.yml b/.github/workflows/build-plugin-zip.yml deleted file mode 100644 index 11a1a1d78fa08a..00000000000000 --- a/.github/workflows/build-plugin-zip.yml +++ /dev/null @@ -1,394 +0,0 @@ -name: Build Gutenberg Plugin Zip - -on: - pull_request: - push: - branches: - - trunk - - 'release/**' - - 'wp/**' - workflow_dispatch: - inputs: - version: - description: 'rc or stable?' - required: true - -# Cancels all previous workflow runs for pull requests that have not completed. -concurrency: - # The concurrency group contains the workflow name and the branch name for pull requests - # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} - cancel-in-progress: true - -# Disable permissions for all available scopes by default. -# Any needed permissions should be configured at the job level. -permissions: {} - -jobs: - compute-stable-branches: - name: Compute current and next stable release branches - runs-on: 'ubuntu-24.04' - permissions: - contents: read - if: ${{ github.event_name == 'workflow_dispatch' }} - outputs: - current_stable_branch: ${{ steps.get_branches.outputs.current_stable_branch }} - next_stable_branch: ${{ steps.get_branches.outputs.next_stable_branch }} - - steps: - - name: Get current and next stable release branches - id: get_branches - run: | - curl \ - -H "Accept: application/vnd.github.v3+json" \ - -o latest.json \ - "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/latest" - LATEST_STABLE_TAG="$(jq --raw-output '.tag_name' latest.json)" - # shellcheck disable=SC2034 - IFS='.' read -r LATEST_STABLE_MAJOR LATEST_STABLE_MINOR LATEST_STABLE_PATCH <<< "${LATEST_STABLE_TAG#v}" - echo "current_stable_branch=release/${LATEST_STABLE_MAJOR}.${LATEST_STABLE_MINOR}" >> "$GITHUB_OUTPUT" - if [[ "${LATEST_STABLE_MINOR}" == "9" ]]; then - echo "next_stable_branch=release/$((LATEST_STABLE_MAJOR + 1)).0" >> "$GITHUB_OUTPUT" - else - echo "next_stable_branch=release/${LATEST_STABLE_MAJOR}.$((LATEST_STABLE_MINOR + 1))" >> "$GITHUB_OUTPUT" - fi - - bump-version: - name: Bump version - runs-on: 'ubuntu-24.04' - permissions: - contents: write - needs: compute-stable-branches - if: | - github.event_name == 'workflow_dispatch' && ( - ( - github.ref == 'refs/heads/trunk' || - endsWith( github.ref, needs.compute-stable-branches.outputs.next_stable_branch ) - ) && ( - github.event.inputs.version == 'rc' || - github.event.inputs.version == 'stable' - ) || ( - startsWith( github.ref, 'refs/heads/release/' ) && - github.event.inputs.version == 'stable' - ) - ) - outputs: - old_version: ${{ steps.get_version.outputs.old_version }} - new_version: ${{ steps.get_version.outputs.new_version }} - release_branch: ${{ steps.get_version.outputs.release_branch }} - release_branch_commit: ${{ steps.commit_version_bump_to_release_branch.outputs.version_bump_commit }} - trunk_commit: ${{ steps.commit_version_bump_to_trunk.outputs.version_bump_commit }} - - steps: - - name: Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - token: ${{ secrets.GUTENBERG_TOKEN }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: true - - - name: Compute old and new version - id: get_version - env: - VERSION: ${{ github.event.inputs.version }} - run: | - OLD_VERSION="$(jq --raw-output '.version' package.json)" - echo "old_version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" - if [[ "$VERSION" == 'stable' ]]; then - NEW_VERSION="$(npx semver "$OLD_VERSION" -i patch)" - else - if [[ "$OLD_VERSION" == *"rc"* ]]; then - NEW_VERSION="$(npx semver "$OLD_VERSION" -i prerelease)" - else - # WordPress version guidelines: If minor is 9, bump major instead. - IFS='.' read -r -a OLD_VERSION_ARRAY <<< "$OLD_VERSION" - if [[ ${OLD_VERSION_ARRAY[1]} == "9" ]]; then - NEW_VERSION="$(npx semver "$OLD_VERSION" -i major)-rc.1" - else - NEW_VERSION="$(npx semver "$OLD_VERSION" -i minor)-rc.1" - fi - fi - fi - echo "new_version=${NEW_VERSION}" >> "$GITHUB_OUTPUT" - IFS='.' read -r -a NEW_VERSION_ARRAY <<< "$NEW_VERSION" - RELEASE_BRANCH="release/${NEW_VERSION_ARRAY[0]}.${NEW_VERSION_ARRAY[1]}" - echo "release_branch=${RELEASE_BRANCH}" >> "$GITHUB_OUTPUT" - - - name: Configure git user name and email - run: | - git config user.name "Gutenberg Repository Automation" - git config user.email gutenberg@wordpress.org - - - name: Create and switch to release branch - if: | - github.event.inputs.version == 'rc' && - ! contains( steps.get_version.outputs.old_version, 'rc' ) - env: - TARGET_BRANCH: ${{ steps.get_version.outputs.release_branch }} - run: git checkout -b "$TARGET_BRANCH" - - - name: Switch to release branch - if: | - github.event.inputs.version == 'stable' || - contains( steps.get_version.outputs.old_version, 'rc' ) - env: - TARGET_BRANCH: ${{ steps.get_version.outputs.release_branch }} - run: | - git fetch --depth=1 origin "$TARGET_BRANCH" - git checkout "$TARGET_BRANCH" - - - name: Update plugin version - env: - VERSION: ${{ steps.get_version.outputs.new_version }} - OLD_VERSION: ${{ steps.get_version.outputs.old_version }} - run: | - jq --tab --arg version "${VERSION}" '.version = $version' package.json > package.json.tmp - mv package.json.tmp package.json - jq --tab --arg version "${VERSION}" '.version = $version | .packages[""].version = $version' package-lock.json > package-lock.json.tmp - mv package-lock.json.tmp package-lock.json - sed -i "s/${OLD_VERSION}/${VERSION}/g" gutenberg.php - - - name: Commit the version bump to the release branch - id: commit_version_bump_to_release_branch - env: - TARGET_BRANCH: ${{ steps.get_version.outputs.release_branch }} - VERSION: ${{ steps.get_version.outputs.new_version }} - run: | - git add gutenberg.php package.json package-lock.json - git commit -m "Bump plugin version to ${VERSION}" - git push --set-upstream origin "$TARGET_BRANCH" - echo "version_bump_commit=$(git rev-parse --verify --short HEAD)" >> "$GITHUB_OUTPUT" - - - name: Fetch trunk - if: ${{ github.ref != 'refs/heads/trunk' }} - run: git fetch --depth=1 origin trunk - - - name: Cherry-pick the version bump commit to trunk - id: commit_version_bump_to_trunk - env: - TARGET_BRANCH: ${{ steps.get_version.outputs.release_branch }} - OLD_VERSION: ${{ steps.get_version.outputs.old_version }} - run: | - git checkout trunk - git pull - TRUNK_VERSION="$(jq --raw-output '.version' package.json)" - if [[ "$OLD_VERSION" == "$TRUNK_VERSION" ]]; then - git cherry-pick "$TARGET_BRANCH" - git push - echo "version_bump_commit=$(git rev-parse --verify --short HEAD)" >> "$GITHUB_OUTPUT" - fi - - build: - name: Build Release Artifact - runs-on: 'ubuntu-24.04' - permissions: - contents: read - needs: bump-version - if: | - always() && ( - github.event_name == 'pull_request' || - github.event_name == 'workflow_dispatch' || - github.repository == 'WordPress/gutenberg' - ) - outputs: - job_status: ${{ job.status }} - - steps: - - name: Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - ref: ${{ needs.bump-version.outputs.release_branch || github.ref }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - - name: Use desired version of Node.js - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version-file: '.nvmrc' - check-latest: true - - - name: Build Gutenberg plugin ZIP file - run: ./bin/build-plugin-zip.sh - env: - NO_CHECKS: 'true' - - - name: Upload artifact - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - with: - name: gutenberg-plugin - path: ./gutenberg.zip - - - name: Build release notes draft - if: ${{ needs.bump-version.outputs.new_version }} - env: - VERSION: ${{ needs.bump-version.outputs.new_version }} - run: | - IFS='.' read -r -a VERSION_ARRAY <<< "${VERSION}" - MILESTONE="Gutenberg ${VERSION_ARRAY[0]}.${VERSION_ARRAY[1]}" - npm run other:changelog -- --milestone="$MILESTONE" --unreleased > release-notes.txt - sed -ie '1,6d' release-notes.txt - if [[ "${VERSION}" != *"rc"* ]]; then - # Include previous RCs' release notes, if any - CHANGELOG_REGEX="=\s[0-9]+\.[0-9]+\.[0-9]+(-rc\.[0-9]+)?\s=" - RC_REGEX="=\s${VERSION}(-rc\.[0-9]+)?\s=" - awk "/${RC_REGEX}/ {found=1;print;next} /${CHANGELOG_REGEX}/ {found=0} found" changelog.txt >> release-notes.txt - fi - - - name: Upload release notes artifact - if: ${{ needs.bump-version.outputs.new_version }} - uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 - with: - name: release-notes - path: ./release-notes.txt - - revert-version-bump: - name: Revert version bump if build failed - needs: [bump-version, build] - runs-on: 'ubuntu-24.04' - permissions: - contents: write - if: | - always() && - ( needs.build.outputs.job_status == 'failure' ) && - needs.bump-version.outputs.release_branch_commit - - steps: - - name: Checkout code - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - fetch-depth: 2 - ref: ${{ needs.bump-version.outputs.release_branch }} - token: ${{ secrets.GUTENBERG_TOKEN }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: true - - - name: Configure git user name and email - run: | - git config user.name "Gutenberg Repository Automation" - git config user.email gutenberg@wordpress.org - - - name: Revert version bump commit on release branch - if: | - github.event.inputs.version == 'stable' || - contains( needs.bump-version.outputs.old_version, 'rc' ) - env: - RELEAD_BRANCH_COMMIT: ${{ needs.bump-version.outputs.release_branch_commit }} - RELEASE_BRANCH: ${{ needs.bump-version.outputs.release_branch }} - run: | - git revert --no-edit "$RELEAD_BRANCH_COMMIT" - git push --set-upstream origin "$RELEASE_BRANCH" - - - name: Delete release branch if it was only just created for the RC - if: | - github.event.inputs.version == 'rc' && - ! contains( needs.bump-version.outputs.old_version, 'rc' ) - env: - RELEASE_BRANCH: ${{ needs.bump-version.outputs.release_branch }} - run: | - git push origin :"$RELEASE_BRANCH" - - - name: Revert version bump on trunk - if: ${{ needs.bump-version.outputs.trunk_commit }} - env: - TRUNK_COMMIT: ${{ needs.bump-version.outputs.trunk_commit }} - run: | - git fetch --depth=2 origin trunk - git checkout trunk - git revert --no-edit "$TRUNK_COMMIT" - git push --set-upstream origin trunk - - create-release: - name: Create Release Draft and Attach Asset - needs: [bump-version, build] - runs-on: 'ubuntu-24.04' - permissions: - contents: write - - steps: - - name: Set Release Version - id: get_release_version - env: - VERSION: ${{ needs.bump-version.outputs.new_version }} - run: echo "version=$(echo "$VERSION" | cut -d / -f 3 | sed 's/-rc./ RC/' )" >> "$GITHUB_OUTPUT" - - - name: Download Plugin Zip Artifact - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 - with: - name: gutenberg-plugin - - - name: Download Release Notes Artifact - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 - with: - name: release-notes - - - name: Create Release Draft - id: create_release - uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: 'v${{ needs.bump-version.outputs.new_version }}' - release_name: ${{ steps.get_release_version.outputs.version }} - commitish: ${{ needs.bump-version.outputs.release_branch || github.ref }} - draft: true - prerelease: ${{ contains(needs.bump-version.outputs.new_version, 'rc') }} - body_path: release-notes.txt - - - name: Upload Release Asset - id: upload-release-asset - uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./gutenberg.zip - asset_name: gutenberg.zip - asset_content_type: application/zip - - npm-publish: - name: Publish WordPress packages to npm - runs-on: 'ubuntu-24.04' - permissions: - contents: read - environment: WordPress packages - needs: [bump-version, build] - if: ${{ endsWith( needs.bump-version.outputs.new_version, '-rc.1' ) }} - steps: - - name: Checkout (for CLI) - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - path: main - ref: trunk - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: false - - - name: Checkout (for publishing) - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - path: publish - # Later, we switch this branch in the script that publishes packages. - ref: trunk - token: ${{ secrets.GUTENBERG_TOKEN }} - show-progress: ${{ runner.debug == '1' && 'true' || 'false' }} - persist-credentials: true - - - name: Configure git user name and email (for publishing) - run: | - cd publish - git config user.name "Gutenberg Repository Automation" - git config user.email gutenberg@wordpress.org - - - name: Setup Node.js - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 - with: - node-version-file: 'main/.nvmrc' - registry-url: 'https://registry.npmjs.org' - check-latest: true - - - name: Publish packages to npm ("latest" dist-tag) - run: | - cd main - npm ci - ./bin/plugin/cli.js npm-latest --semver minor --ci --repository-path ../publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}