woocommerce/tools/release-posts
Ron Rennick 4fa2e3822c
Update the monorepo to node v20 (#45148)
* test bumping node to v18

* remove community contributor condition from review assignment

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/extend-cart-checkout-block, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/admin-e2e-tests, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai

* bump node to v20

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/extend-cart-checkout-block, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/admin-e2e-tests, packages/php/remote-specs-validation, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai

* Add changefile(s) from automation for the following project(s): @woocommerce/tracks, @woocommerce/onboarding, @woocommerce/number, @woocommerce/notices, @woocommerce/navigation, @woocommerce/internal-js-tests, @woocommerce/extend-cart-checkout-block, @woocommerce/expression-evaluation, @woocommerce/explat, @woocommerce/experimental, @woocommerce/eslint-plugin, @woocommerce/dependency-extraction-webpack-plugin, @woocommerce/date, @woocommerce/data, @woocommerce/customer-effort-score, @woocommerce/currency, @woocommerce/csv-export, @woocommerce/create-woo-extension, @woocommerce/create-product-editor-block, @woocommerce/components, @woocommerce/api, @woocommerce/admin-e2e-tests, woocommerce-blocks, woocommerce-beta-tester, woocommerce, woo-ai

* add blocks eslint-plugin-woocommerce to project workspace

* add e2e-environment as a peer to e2e-utils

* restore version on @woocommerce/api

* update lock file

* move e2e-environment to devDependencies

* add undefined location check to admin js test

---------

Co-authored-by: Ron Rennick <ronald.rennick@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
2024-04-12 13:49:55 -03:00
..
commands/release-post Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
lib Monorepo Utils: Migrate cli-core (#38018) 2023-04-28 10:16:19 +12:00
templates Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
.env.sample Extract the scanning functionality from code-analyzer, move common code into a separate package (#34600) 2022-09-11 09:55:53 +12:00
.prettierignore Fix release post template syntax errors and add prettierignore (#36411) 2023-01-18 18:43:00 +13:00
README.md Update Woo.com references to WooCommerce.com (#46259) 2024-04-09 09:50:15 +01:00
index.ts Extract the scanning functionality from code-analyzer, move common code into a separate package (#34600) 2022-09-11 09:55:53 +12:00
package.json Update the monorepo to node v20 (#45148) 2024-04-12 13:49:55 -03:00
program.ts Extract the scanning functionality from code-analyzer, move common code into a separate package (#34600) 2022-09-11 09:55:53 +12:00
tsconfig.json Regenerate PNPM Lock File & Fix Errors (#41830) 2023-12-05 00:36:30 -08: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 WordPress.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. Note that the env file should live at the same path that you're running the command from.
  4. Run the tool via the npm script, e.g. pnpm release-post release "6.8.0" --outputOnly
  5. For more help on individual options, run the help pnpm release-post <command> --help. e.g. pnpm release-post rc --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:
    • Name can be anything
    • Description can be left blank
    • Website URL just put http://localhost
    • Redirect URLs, by default you should add: http://localhost:3000/oauth
    • JavaScript Origins put http://localhost
    • Type - choose "Web"
  3. Once your app is created you can go back to the app list and click "manage app".
  4. Take note of the client secret and the client id.
  5. 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.

Generating Just a Contributors List

If you don't have a final release yet you can generate an HTML contributors list that you can copy paste into a blank post.

To do that simply run pnpm release-post contributors "<currentVersion>" "<previousVersion>"

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