woocommerce/tools/release-post-generator
Sam Seay 4ca9c5225d
Port the release generator from Woorelease extensions to tools (#34496)
2022-09-06 15:51:28 +12:00
..
commands Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00
lib Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00
templates Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00
.env.sample Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00
README.md Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00
index.ts Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00
package.json Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00
program.ts Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00
tsconfig.json Port the release generator from Woorelease extensions to tools (#34496) 2022-09-06 15:51:28 +12:00

README.md

Release Post Generator CLI tool

This is a cli tool designed to generate draft release posts for WooCommerce. Posts generated via the tool will be draft posted to https://developer.woocommerce.com.

You can also generate an HTML representation of the post if you don't have access to a wc.com auth token.

Setup

  1. Make sure pnpm i has been run in the monorepo.
  2. Make sure you have added a .env file with the env variables set. WCCOM_TOKEN is optional if you're using --outputOnly, but the GITHUB_ACCESS_TOKEN is required. If you need help generating a token see the docs. To silence all CLI output, set LOGGER_LEVEL to "silent".
  3. Run the tool via the npm script, e.g. pnpm run release "6.8.0" --outputOnly
  4. For more help on individual options, run the help pnpm run release --help

Publishing Draft Posts

This tool will publish draft posts to https://developer.woocommerce.com for you if you omit the --outputOnly flag. There is some minimal first time setup for this though:

  1. Create an app on Wordpress.com here.
  2. Recommended settings:
  1. Once your app is created you can go back to the app list and click "manage app".
  2. Take note of the client secret and the client id.
  3. In your .env file add the client secret to the WPCOM_OAUTH_CLIENT_SECRET variable and the client id to the WPCOM_OAUTH_CLIENT_ID variable.

Advanced

If you can't run anything on your localhost port 3000 you may want to override the redirect uri for oauth.

Steps:

  1. Add your preferred redirect URI to the WPCOM_OAUTH_REDIRECT_URI variable in .env. e.g. http://localhost:4321/oauth
  2. When creating your app on Wordpress.com make sure the redirect URL you set matches the one set in .env