Skip to content

Release Process

Miguel Pérez Pellicer edited this page May 16, 2024 · 40 revisions

Release basics

We start to use GitHub workflow to automate the process. You will still need to use woorelease locally and do a few steps manually in GitHub.

  1. Go to Actions > Prepare New Release.

  2. Open the "Run workflow" dropdown, fill in the details, and click "Run workflow" button. image

  3. Wait for the new release PR to be created by the github-actions[bot].

  4. Follow the steps from the new PR. Some more hints and troubleshooting are provided below.

  5. ❗ While running smoke tests, remember: if this release has updated composer packages, we should test Composer package conflicts with other plugins.

Prerequisites and Reading

GitFlow

We use the GitFlow branching model. Check out the PeeuvX-1D-p2 if you haven't already.

Woorelease

woorelease is used to deploy to WooCommerce.com: https://github.com/woocommerce/woorelease

⚠ IMPORTANT Some Woorelease pre-configuration is necessary:

Troubleshooting

How to examine whether your WPORG account has write access to this repo?

- Log in your account and go to https://wordpress.org/plugins/google-listings-and-ads/advanced/
- Check if the **Committers** list is displayed at the right sidebar and your account is listed on it

Where is the temporary working folder for release processes? (git/svn/npm build operations and google-listings-and-ads.zip file)

- Get the folder path used for temporary files by `php -r 'echo sys_get_temp_dir()."/google-listings-and-ads\n";'`

What if the WPORG release process fails after wr release?

- Retry by the `wporg:release` command of WooRelease tool
    ```
    # Both --folder and --zip_file should point to the temporary folder just used for `wr release` in your system
    # --folder=/<temporary folder in your system>/google-listings-and-ads
    # --zip_file=/<temporary folder in your system>/google-listings-and-ads/google-listings-and-ads.zip

    wr wporg:release --product_version=x.x.x --folder=/<tmp_folder>/google-listings-and-ads --zip_file=/<tmp_folder>/google-listings-and-ads/google-listings-and-ads.zip --release https://github.com/woocommerce/google-listings-and-ads/tree/release/x.x.x
    ```

What if we keep on getting svn timeout errors?

ℹ️ This might happen when the Google API Library ghets updated as thousands of files needs to be committed and SVN gets in trouble with that.

For solving it, follow this steps:

First lets checkout the current SVN to get the latest files:

  1. Create a directory somewhere in your local machine. As an example lets assume it will be /home/gla
  2. Run cd /home/gla
  3. Run svn checkout https://plugins.svn.wordpress.org/google-listings-and-ads --depth immediates
  4. Run svn update --set-depth infinity google-listings-and-ads/trunk

Now let's unzip the extension files from the ZIP created during the release

Run this

cd google-listings-and-ads
rm -rf trunk/*
cd trunk
unzip /tmp/google-listings-and-ads/google-listings-and-ads.zip # Change this directory for where your temporary ZIP file is
cd google-listings-and-ads
mv * .. && cd ..
rmdir google-listings-and-ads

Now we need to commit folder by folder so SVN can handle the commits without trouble

Repeat this code for the next folders:

vendor/googleads vendor/google vendor/guzzlehttp vendor/psr

cd vendor/googleads
svn status | grep '^!' | awk '{print $2}' | xargs svn delete
svn status | grep '^?' | awk '{print $2}' | xargs svn add
svn ci -m 'Big update for vendor/googleads'
cd ../..

After committing these large amounts of file changes, use woorelease wporg:release for doing the release without blocking SVN

       # Both --folder and --zip_file should point to the temporary folder just used for `wr release` in your system
       # --folder=/<temporary folder in your system>/google-listings-and-ads
       # --zip_file=/<temporary folder in your system>/google-listings-and-ads/google-listings-and-ads.zip

       woorelease wporg:release --product_version=x.x.x --folder=/<tmp_folder>/google-listings-and-ads --zip_file=/<tmp_folder>/google-listings-and-ads/google-listings-and-ads.zip https://github.com/woocommerce/google-listings-and-ads/tree/release/x.x.x

What if the release is not created on GH?

Run this command:

woorelease gh:release --folder=/<tmp_folder>/google-listings-and-ads --zip_file=/<tmp_folder>/google-listings-and-ads/google-listings-and-ads.zip --release https://github.com/woocommerce/google-listings-and-ads/tree/release/x.x.x --product_version=x.x.x