OllieJones / index-wp-mysql-for-speed

A plugin to add useful indexes to your WordPress installation's MySQL database.
GNU General Public License v2.0
125 stars 10 forks source link

build: add GitHub Actions workflow for build and archive #86

Closed MaximeMichaud closed 3 weeks ago

MaximeMichaud commented 1 month ago

Hello,

I have set up a workflow to automatically compress the repository when a commit is made. This workflow only runs on the main branch.

The purpose is to facilitate access to an archive of the plugin for a specific commit.

Note: actions/upload-artifact does not include hidden files (.) or GitHub-related folders by default.

The only potential improvement for efficiency would be to include certain paths to ensure the workflow doesn't run if no modifications were made to the plugin code.

That said, it's an open-source project, and it's GitHub's servers doing the heavy lifting for free. :) The workflow was tested on my repository & WordPress, and everything worked as expected.

TL;DR: Added a GitHub Actions workflow to archive the repository on commits to the main branch, matching the archive available on WordPress.org.

MaximeMichaud commented 1 month ago

After reviewing the documentation for upload-artifact, I was able to exclude files that were not present in the archived release of the plugin available on wordpress.org.

The downside is that if additional files are added (that are not hidden files), they will be included in the archive and will need to be excluded in this configuration file.

However, this isn't a major issue, as someone downloading the plugin can add the file manually or download it directly from GitHub without relying on the artifact.

TL;DR : Exclusions were applied to match the plugin release on wordpress.org. Any new non-hidden files will need to be manually excluded in the config. Not a big issue, as users can add files manually or download from GitHub if needed.