Skip to content
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

Merged
merged 18 commits into from
Dec 6, 2021
Merged

Conversation

felipeelia
Copy link
Member

@felipeelia felipeelia commented Dec 3, 2021

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

@felipeelia felipeelia added this to the 4.0.0 (beta 1) milestone Dec 3, 2021
@felipeelia felipeelia self-assigned this Dec 3, 2021
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.
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffpaul
Copy link
Member

jeffpaul commented Dec 6, 2021

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)

Copy link
Member

@jeffpaul jeffpaul left a 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

@felipeelia
Copy link
Member Author

@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.
Copy link
Member

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
Copy link
Member

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?

Copy link
Member

@jeffpaul jeffpaul left a 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 🍿

Copy link
Member

@jeffpaul jeffpaul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:rubber-stamp:

@felipeelia felipeelia merged commit 4117ffc into 4.x.x Dec 6, 2021
@felipeelia felipeelia deleted the chore/build-assets-for-release branch December 6, 2021 21:10
felipeelia pushed a commit that referenced this pull request Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants