-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build assets during the release #2486
Conversation
So we can use it with rsync to generate a zip file
For better alignment with SemVer: https://semver.org/#spec-item-9
CONTRIBUTING.md
Outdated
@@ -39,11 +39,30 @@ The `develop` branch is the development branch which means it contains the next | |||
1. Test: While still on the `master` branch, test for functionality locally. | |||
1. Push: Push your `master` branch to GitHub (e.g. `git push origin master`). | |||
1. Release: Create a [new release](https://github.com/10up/elasticpress/releases/new), naming the tag and the release with the new version number, and targeting the `master` branch. Paste the release changelog from `CHANGELOG.md` into the body of the release and include a link to the closed issues on the [milestone](https://github.com/10up/elasticpress/milestone/#?closed=1). | |||
1. Check the assets build action: After the release, GitHub should trigger an action to generate a zip with the plugin and attach it to the GitHub Release page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be worth linking on Check the assets build action
to the specific action to make it easier for others following these instructions. Eg https://github.com/10up/ElasticPress/actions/workflows/push-deploy.yml
CONTRIBUTING.md
Outdated
1. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.gitattributes`. | ||
1. Merge: Merge the release branch/PR into the next version branch (`4.x.x`, for example). | ||
1. Test: Checkout the next version branch locally and build assets like the GitHub Action will do (see `.github/workflows/push-deploy.yml`) | ||
1. Release: Create a [new release](https://github.com/10up/elasticpress/releases/new), naming the tag and the release with the new version number, and targeting the next version branch branch. Paste the release changelog from `CHANGELOG.md` into the body of the release and include a link to the closed issues on the [milestone](https://github.com/10up/elasticpress/milestone/#?closed=1). **ATTENTION**: The tag **needs** to contain the `beta` string, so the version is not released in WordPress.org. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that you could also create a pre-release
instead of relying on the beta
string in the tag name.
CONTRIBUTING.md
Outdated
1. Merge: Merge the release branch/PR into the next version branch (`4.x.x`, for example). | ||
1. Test: Checkout the next version branch locally and build assets like the GitHub Action will do (see `.github/workflows/push-deploy.yml`) | ||
1. Release: Create a [new release](https://github.com/10up/elasticpress/releases/new), naming the tag and the release with the new version number, and targeting the next version branch branch. Paste the release changelog from `CHANGELOG.md` into the body of the release and include a link to the closed issues on the [milestone](https://github.com/10up/elasticpress/milestone/#?closed=1). **ATTENTION**: The tag **needs** to contain the `beta` string, so the version is not released in WordPress.org. | ||
1. Check the assets build action: After the release, GitHub should trigger an action to generate a zip with the plugin and attach it to the GitHub Release page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be worth linking on Check the assets build action to the specific action to make it easier for others following these instructions. Eg https://github.com/10up/ElasticPress/actions/workflows/push-deploy.yml
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ${{ github.workspace }}/${{ env.SLUG }}.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that you could tweak this, see sample action workflow here: https://github.com/10up/action-wordpress-plugin-deploy#deploy-on-publishing-a-new-release-and-attach-a-zip-file-to-the-release
Note that you could utilize the prereleased type instead of published or released to target your beta releases as well. See more on that here: 10up/action-wordpress-plugin-deploy#5 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments throughout, none are blockers
@jeffpaul addressed most of your comments in the recent commits. Do you mind checking again? Tests in my fork worked fine. |
CONTRIBUTING.md
Outdated
1. New files: Check to be sure any new files/paths that are unnecessary in the production version are included in `.gitattributes`. | ||
1. Merge: Merge the release branch/PR into the next version branch (`4.x.x`, for example). | ||
1. Test: Checkout the next version branch locally and build assets like the GitHub Action will do (see `.github/workflows/push-deploy.yml`) | ||
1. Release: Create a [new release](https://github.com/10up/elasticpress/releases/new), naming the tag and the release with the new version number, and targeting the next version branch branch. Paste the release changelog from `CHANGELOG.md` into the body of the release and include a link to the closed issues on the [milestone](https://github.com/10up/elasticpress/milestone/#?closed=1). **ATTENTION**: Make sure to check the `This is a pre-release` checkbox, so the release is not published on WordPress.org. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're going the "pre-release" route, it might be better to change the copy of the link from new release
to new pre-release
to hopefully capture whoever is handling the release's attention in case they miss the note at the end of this step?
@@ -3,7 +3,7 @@ | |||
* Plugin Name: ElasticPress | |||
* Plugin URI: https://github.com/10up/ElasticPress | |||
* Description: A fast and flexible search and query engine for WordPress. | |||
* Version: 4.0.0-beta-1 | |||
* Version: 4.0.0-beta.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what its worth, WP core uses "beta1" and not "beta-1" or "beta.1" in case we want to more closely mimic their numbering scheme?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be interesting 🍿
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:rubber-stamp:
Description of the Change
This PR removes the dist folder from the repo and builds JS and CSS files during the release workflow.
Although the
10up/action-wordpress-plugin-deploy
action optionally generates a zip file, we don't want to publish Beta versions on WP.org. That is why we have a separate step for the zip generation.Verification Process
As testing this in this repo without making an actual release is impossible, tests were done in my personal fork. Here is the latest test: https://github.com/felipeelia/ElasticPress/releases/tag/4.0.0-beta-1.3
Applicable Issues
Closes #2182
Changelog Entry
Changed: Minified JavaScript and CSS files are now built during the release process and are not versioned anymore. Props @felipeelia