WordPress / wp-movies-demo

Demo of the Interactivity API
https://wpmovies.dev
GNU General Public License v2.0
195 stars 42 forks source link

Create GitHub action to bump versions and upload ZIP files for plugin and theme #20

Closed SantosGuillamot closed 1 year ago

SantosGuillamot commented 1 year ago

This PR aims to include a GitHub action that takes care of two things:

  1. Bump version of the plugin and the package.json each time there is a push to main. Right now it is hardcoded to be always a patch.
  2. Builds a ZIP file for the plugin and the theme, and adds them to the release, so they are easily downloadable. These ZIP files should only contain the files and folders necessary.

This way, users would be able to download the plugin and the theme directly from:

And the links will be updated with the latest changes.

I've created a fake 0.1.1 release for testing purposes, and as a way to showcase that files are downloadable. We might need to delete it before merging this Pull Request.

michalczaplinski commented 1 year ago

That's great Mario! 👏

I'm just testing it and running into some issues though. I've started a local environment using Local and downloaded the zips.

https://www.loom.com/share/f30d18c87dbe41bfbc076d02a8f7fd3a

michalczaplinski commented 1 year ago

We should also update the README to explain that if you want to try out the demo you can just use the zips but if you want to make changes to the blocks and tinker with them then it's probably easier using Docker + wp-env.

SantosGuillamot commented 1 year ago

It seems to be an issue with how the ZIP file is created for the theme. If I copy and paste the folder into the themes folder, it seems to work fine. I still have to review it properly as well.

SantosGuillamot commented 1 year ago

There was a mismatch with some names not having a dash. It should be solved now.

SantosGuillamot commented 1 year ago

I've changed the base branch to clean-repo because this doesn't make sense until that one is merged. We don't want to create a ZIP file with the runtime code because that would be incompatible with installing the WP Directives plugin.

SantosGuillamot commented 1 year ago

The issue with wp-env should be solved now.

Moreover, I updated the README with the new instructions. I tried to make it a bit more generic, so people using different local development tools can get it running, but keeping the instructions to run it with wp-env. Feel free to modify anything.

SantosGuillamot commented 1 year ago

I'm using wp-env and I get this error on the frontend:

I'm not able to reproduce the error, even using wp-env. Could you confirm it is still happening with the current status of this branch?

This seems related to how we're now defining the initial state on the server in https://github.com/c4rl0sbr4v0/wp-movies-demo/pull/21 and not an issue with this PR so I'm going to approve but let's wait to merge https://github.com/c4rl0sbr4v0/wp-movies-demo/pull/21 first.

This pull request is built on top of https://github.com/c4rl0sbr4v0/wp-movies-demo/pull/21 instead of main, so it shouldn't be a problem to merge this one if we consider it ready, right?

SantosGuillamot commented 1 year ago

I'm not able to reproduce the error, even using wp-env.

Okay, I believe I know what is happening:

I've moved the state.wpmovies.favoriteMovies to the favorites-number block, which should be present in all the pages as it is included in the header.

luisherranz commented 1 year ago

Blocks should be self-sufficient. Repeating the same state is fine if more than one block depends on it. The store is just merged on the server.

SantosGuillamot commented 1 year ago

Okay, that makes sense, I've added the state to both blocks.