Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

Automates the build process for WordPress plugin releases by running npm and composer builds, then creating a distribution-ready zip file attached to GitHub releases.

Changes

  • .distignore: Defines files excluded from production builds (dev dependencies, tests, source files, documentation, vendor test directories)
  • .github/workflows/build-release.yml: Workflow triggered on release creation that:
    • Installs Node.js dependencies and runs npm run build
    • Installs PHP production dependencies via composer install --no-dev
    • Creates zip using rsync with .distignore exclusions
    • Uploads zip to release via GitHub CLI

Result

Production zip is ~1.7MB containing only runtime-necessary files (built assets, production dependencies, plugin code). Version bumps and readme updates remain manual.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/DaveChild/Text-Statistics/zipball/e83d5f82726db80e662ae305fce3b3c41299b4f5
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/Masterminds/html5-php/zipball/f5ac2c0b0a2eefca70b2ce32a5809992227e75a6
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/firebase/php-jwt/zipball/8f718f4dfc9c5d5f0c994cdfd103921b43592712
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/uoRpb4 /usr/bin/composer install --no-dev --optimize-autoloader (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/fivefilters/readability.php/zipball/2fd58a6cc626124a05721efb9b3632e91783d487
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/mattwright/URLResolver.php/zipball/416039192cb6d9158bdacd68349bceff8739b857
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/simplehtmldom/simplehtmldom/zipball/3c87726400e59d8e1bc4709cfe82353abeb0f4d1
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)
  • https://api.github.com/repos/thephpleague/uri/zipball/09da64118eaf4c5d52f9923a1e6a5be1da52fd9a
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/uoRpb4 /usr/bin/composer install --no-dev --optimize-autoloader (http block)
    • Triggering command: /usr/bin/php8.3 /usr/bin/php8.3 -n -c /tmp/QphVJX /usr/bin/composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>GitHub Action for building a production-ready zip</issue_title>
<issue_description>A number of build steps are required to make a version of the plugin that's runnable in WordPress. See the Release Checklist. https://github.com/PressForward/pressforward/wiki/Release-checklist

For the time being, I'd like to do the version bumps and readme updates manually, as they give me a way to do a last-minute review of changes.

But it would be nice if the GitHub Release that I create as the very last step actually had a usable zip attached. This would require a build step that runs the necessary npm and composer steps, then builds a zip that's compatible with WP's installation routine.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits December 11, 2025 16:10
Co-authored-by: boonebgorges <246627+boonebgorges@users.noreply.github.com>
Co-authored-by: boonebgorges <246627+boonebgorges@users.noreply.github.com>
Co-authored-by: boonebgorges <246627+boonebgorges@users.noreply.github.com>
Co-authored-by: boonebgorges <246627+boonebgorges@users.noreply.github.com>
Copilot AI changed the title [WIP] Add GitHub action for building production-ready zip Add GitHub Action to build production-ready WordPress plugin zip on release Dec 11, 2025
Copilot AI requested a review from boonebgorges December 11, 2025 16:20
@boonebgorges
Copy link
Contributor

@copilot Two questions for you:

  1. I see how you build the zip, but it's not obvious how this becomes available for download on the Release page. I guess when you use gh release upload, that's what you're doing, and GH takes care of "attaching" the zip and then showing a download link?
  2. Do you have recommendations on how best to test this? Will I have to merge and then create a release, or is there some other way I can sandbox it?

Copy link
Contributor Author

Copilot AI commented Dec 11, 2025

@copilot Two questions for you:

  1. I see how you build the zip, but it's not obvious how this becomes available for download on the Release page. I guess when you use gh release upload, that's wh...

Great questions!

  1. Yes, exactly right. When gh release upload runs, it attaches the zip file as a release asset to the GitHub Release. The file will automatically appear in the "Assets" section at the bottom of the release page with a download link. The --clobber flag ensures that if you re-run the workflow (e.g., by deleting and recreating the release), it will replace any existing file with the same name.

  2. For testing, here are a couple of options:

    • Draft release: Create a draft release with a tag like v0.0.0-test on this branch. The workflow will run when you publish it, and you can delete the release and tag afterward.
    • Push event testing: You could temporarily modify the workflow trigger from release: types: [created] to push: branches: [copilot/add-github-action-for-zip] to test it on pushes to this branch, then revert that change before merging.
    • Manual workflow dispatch: Add workflow_dispatch: to the on: triggers to enable manual runs from the Actions tab (though you'd need to simulate the release context).

The draft release approach is probably the cleanest for testing the actual release flow without affecting the main repository.

@boonebgorges boonebgorges marked this pull request as ready for review December 11, 2025 18:41
@boonebgorges boonebgorges merged commit 47e24e0 into 5.9.x Dec 11, 2025
5 checks passed
@boonebgorges boonebgorges deleted the copilot/add-github-action-for-zip branch December 11, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants