Skip to content

Build & Release

Jeremy Pry edited this page Aug 31, 2021 · 33 revisions

This document is out of date - please refer to P2 docs

Before deploy

  1. Ensure the readme.txt and changelog.txt files have changelog entries for the changes included in the new version (note the header formatting difference in readme.txt)
  2. Ensure the changelog date and version uses the following format: {year}.nn.nn {version}-dev.{number}. Sake expects to see and will replace 2021.nn.nn with the current version and {version}-dev.{number} (e.g 2.4.0-dev.1) with the version selected during deploy.
  3. Ensure that the value for the Stable tag header in readme.txt is {version}-dev.{number}
  4. Ensure that the value for the WC_Facebookcommerce::VERSION constant is {version}-dev.{number}
  5. Ensure that the value for the Version header in facebook-for-woocommerce.php is {version}-dev.{number}
  6. Ensure you have no untracked files or uncommitted changes on your working directory
  7. Ensure you have svn installed on your system by running which svn. For macOS, svn can be installed (if missing) using brew install svn.

Deploy

Facebook for WooCommerce uses Sake to build assets and deploy new versions. You can check the Getting started page for installation instructions.

Environment configuration

Once Sake is installed, you'll have to set a value for the following environment variables. Make sure to copy .dist.env to .env and provide a value.

  • GITHUB_USERNAME: your GitHub username
  • GITHUB_API_KEY: used to access the GitHub API to retrieve information about the repository and to create releases automatically. These can be generated on the Applications settings page.
  • WP_SVN_USER: the username of a WordPress.org user with permissions to commit changes to https://plugins.svn.wordpress.org/facebook-for-woocommerce/. Sake will ask for the password the first time that the user attempts to commit.
  • SAKE_PRE_RELEASE_PATH: a path to a directory where the zip files generated with sake prerelease should be stored (e.g. ~/Projects/prereleases)

You can also define these variables as shell environment variables in your .bash_profile (or .zprofile if you use zsh).

Deploy via Sake

Run composer install --no-dev as a sanity check to confirm that your vendor directory is clean. It doesn't hurt if you want remove the vendor directory entirely and let Sake create it again during the deploy process.

Then, deploy the new version with:

npm run deploy:sake

This will build the necessary assets using Webpack, and then run the deploy process using sake.

Check the Configuration and CLI Options pages to learn more about how to control Sake.

Deploy (Pre February 2021 for Reference)

  1. Set the WP_SVN_USER environment variable to the username that should be used to push changes to WordPress.org. Saké will ask for the password the first time that user attempts to commit.
  2. Use npx sake deploy --deployAssets=0 to skip the shell:svn_commit_assets action not used on this repo

After deploy

If you deploy from a branch, before merging the changes into master, follow these steps to fix the tag that Sake creates:

  1. git fetch to get the latest tags
  2. git tag -d {version} to delete the tag that sake created
  3. git tag {version} {hash of Facebook for WooCommerce versioning commit}
  4. git push --tags -f to overwrite the tag on GitHub with the modified tag

Clone this wiki locally