Skip to content

Show Key Metrics setup screen errors inline, rather than sticky, when the buttons are inline #33045

Show Key Metrics setup screen errors inline, rather than sticky, when the buttons are inline

Show Key Metrics setup screen errors inline, rather than sticky, when the buttons are inline #33045

Workflow file for this run

name: Plugin Zip Files
on:
push:
branches:
- develop
- main
- 'feature/**'
- 'release/**'
paths:
- '.github/workflows/zips.yml'
- 'bin/release'
- 'assets/**'
- '!assets/**/__tests__/**/*.js'
- '!assets/**/test/*.js'
- '!assets/**/*.test.js'
- 'includes/**'
- 'gtg/**'
- 'google-site-kit.php'
- 'scoper.inc.php'
- 'uninstall.php'
- 'composer.json'
- 'composer.lock'
- 'php-scoper/composer.lock'
- 'package.json'
- 'package-lock.json'
- 'postcss.config.js'
- 'webpack/*.config.js'
- 'webpack.config.js'
- 'feature-flags.json'
tags: ['**']
pull_request:
branches:
- develop
- main
- 'feature/**'
paths:
- '.github/workflows/zips.yml'
- 'bin/release'
- 'assets/**'
- '!assets/**/__tests__/**/*.js'
- '!assets/**/test/*.js'
- '!assets/**/*.test.js'
- 'includes/**'
- 'google-site-kit.php'
- 'scoper.inc.php'
- 'uninstall.php'
- 'composer.json'
- 'composer.lock'
- 'php-scoper/composer.lock'
- 'package.json'
- 'package-lock.json'
- 'postcss.config.js'
- 'webpack/*.config.js'
- 'webpack.config.js'
- 'feature-flags.json'
types:
- opened
- closed
- reopened
- synchronize
- ready_for_review
workflow_dispatch:
inputs:
release_version:
type: string
description: Release version
required: false
default: ''
concurrency:
group: zips-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
env:
GCS_BUCKET: site-kit-github-artifacts
GCS_ROOT_PATH: builds
jobs:
build-zips:
name: Build Zips
runs-on: ubuntu-latest
timeout-minutes: 20
if: |
false == (
(
github.event_name == 'pull_request' && (
github.event.action == 'closed' ||
github.event.pull_request.draft == true ||
contains( github.head_ref, 'dependabot/' )
)
) ||
github.event.pull_request.head.repo.fork
)
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- uses: shivammathur/setup-php@7c071dfe9dc99bdf297fa79cb49ea005b9fcadbc # ratchet:shivammathur/setup-php@v2
with:
php-version: '8.4'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get Composer Cache Directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # ratchet:actions/cache@v5
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Composer Install
run: composer install --no-interaction --no-progress --no-dev
- name: Setup Node.js (.nvmrc)
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # ratchet:actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
- name: npm install
run: npm ci --include-workspace-root -w assets
- name: Create destination directory and update file permissions
run: |
mkdir -p "${{ github.ref }}"
sudo chown -R "$(id -u):$(id -g)" .
- name: Build develop version
run: |
npm run dev-zip
mv ./*.zip "${{ github.ref }}/google-site-kit-dev.zip"
- name: Build release version
run: |
npm run release-zip
mv ./*.zip "${{ github.ref }}/google-site-kit.zip"
- name: Upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # ratchet:actions/upload-artifact@v6
with:
name: zip-files
path: ${{ github.ref }}
upload-to-cloud-storage:
name: Upload to GCS
runs-on: ubuntu-latest
if: github.event_name != 'workflow_dispatch'
needs: build-zips
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # ratchet:actions/download-artifact@v7
with:
name: zip-files
path: ${{ github.ref }}
- uses: ./.github/actions/upload-to-gcs
id: upload
with:
credentials-json: ${{ secrets.GCP_CREDENTIALS }}
path: ${{ github.ref }}
destination: ${{ env.GCS_ROOT_PATH }}/${{ github.ref }}
- uses: ./.github/actions/update-pr-comment
if: github.event_name == 'pull_request'
with:
issue-number: ${{ github.event.pull_request.number }}
section-id: zips
section-content: |
📦 **Build files for ${{ github.event.pull_request.head.sha }}:**
- Download [development build](${{ steps.upload.outputs.public-url }}/google-site-kit-dev.zip?${{ github.sha }})
- Download [production build](${{ steps.upload.outputs.public-url }}/google-site-kit.zip?${{ github.sha }})
remove-zips:
name: Remove Zips
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed'
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
- uses: ./.github/actions/remove-gcs-path
with:
credentials-json: ${{ secrets.GCP_CREDENTIALS }}
path: ${{ env.GCS_ROOT_PATH }}/refs/pull/${{ github.event.pull_request.number }}
- uses: ./.github/actions/update-pr-comment
with:
issue-number: ${{ github.event.pull_request.number }}
section-id: zips
section-content: |
📦 **Build files for ${{ github.event.pull_request.head.sha }}:**
- Build files have been deleted.
dryrun-publish-to-wporg:
name: '[DRY RUN] Publish to WordPress.org'
runs-on: ubuntu-latest
# environment: do not define to omit SVN credentials + deployment protection rules for this dry-run.
if: github.event_name == 'workflow_dispatch' && ( github.ref_type == 'tag' || inputs.release_version != '' )
needs: build-zips
timeout-minutes: 20
steps:
- name: Install SVN ( Subversion )
run: |
sudo apt-get update
sudo apt-get install subversion
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # ratchet:actions/download-artifact@v7
with:
name: zip-files
path: /tmp
- name: Extract
run: |
unzip /tmp/google-site-kit.zip
- uses: 10up/action-wordpress-plugin-deploy@abb939a0d0bfd01063e8d1933833209201557381 # ratchet:10up/action-wordpress-plugin-deploy@2.2.2
with:
dry-run: true
env:
BUILD_DIR: ./google-site-kit
SLUG: google-site-kit
SVN_PASSWORD: no-op-password
SVN_USERNAME: no-op-username
VERSION: ${{ inputs.release_version }}
publish-to-wporg:
name: Publish to WordPress.org
runs-on: ubuntu-latest
environment: wordpress-plugin-svn
if: github.event_name == 'workflow_dispatch' && ( github.ref_type == 'tag' || inputs.release_version != '' )
needs: build-zips
timeout-minutes: 20
steps:
- name: Install SVN ( Subversion )
run: |
sudo apt-get update
sudo apt-get install subversion
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # ratchet:actions/download-artifact@v7
with:
name: zip-files
path: /tmp
- name: Extract
run: |
unzip /tmp/google-site-kit.zip
- uses: 10up/action-wordpress-plugin-deploy@abb939a0d0bfd01063e8d1933833209201557381 # ratchet:10up/action-wordpress-plugin-deploy@2.2.2
env:
BUILD_DIR: ./google-site-kit
SLUG: google-site-kit
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
VERSION: ${{ inputs.release_version }}