WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@infowprobo
Copy link

What?

Adds automated GitHub Action workflow to build and attach ai.zip to releases.

Closes #109

This PR creates a new workflow that automatically generates the plugin zip file and attaches it as a release asset whenever a new release is published on GitHub.

Why?

Currently, the plugin zip must be manually packaged and attached to each GitHub release. This creates extra work and potential for inconsistency across releases.

Issue #109 requested automation to:

  • Remove the need for manual packaging
  • Ensure consistency across all tagged versions
  • Match WordPress.org naming conventions (ai.zip)

How?

The implementation:

  1. Creates .github/workflows/release.yml that triggers on release: published events
  2. Reuses the existing build-plugin-zip.yaml workflow (DRY principle)
  3. Downloads the built artifact from the build job
  4. Uploads ai.zip as a release asset using softprops/action-gh-release

The workflow follows WordPress security best practices:

  • Minimal permissions (contents: read for build, contents: write only for upload)
  • Uses pinned action versions with SHA hashes
  • Reuses existing, tested build process

Testing Instructions

Local Build Verification

  1. Clone the repository
  2. Run the build process:
   npm ci
   composer install --no-dev
   npm run build
   npm run plugin-zip
  1. Verify ai.zip is created successfully
  2. Extract and inspect the zip structure matches WordPress.org expectations

Workflow Testing (Maintainers Only)

⚠️ Note: This workflow cannot be fully tested on forks because it depends on the build-plugin-zip.yaml workflow which requires SVN_USERNAME secret that only exists in the WordPress/ai repository.

To test in the WordPress/ai repository:

  1. Merge this PR to trunk
  2. Create a test release (e.g., v0.2.0-rc1)
  3. Tag: v0.2.0-rc1, Target: trunk
  4. Click "Publish release"
  5. Navigate to Actions tab and verify "Attach Plugin Zip to Release" workflow runs
  6. Return to the release page
  7. Verify ai.zip appears in the Assets section
  8. Download and verify the zip structure

Expected Results

  • ✅ Workflow triggers automatically on release publish
  • ✅ Build completes successfully (~2-3 minutes)
  • ai.zip appears in release assets
  • ✅ Zip contains proper plugin structure matching WordPress.org requirements

Testing Instructions for Keyboard

N/A - This PR does not affect the user interface. It only adds backend automation for release management.

Screenshots or screencast

N/A - This is a CI/CD workflow change with no visual output. The workflow will appear in the Actions tab when releases are published.

Test Evidence (Local Build)

$ npm run plugin-zip
> [email protected] plugin-zip
> wp-scripts plugin-zip

Creating archive... ai.zip
Done!

$ ls -lh ai.zip
-rw-r--r-- 1 user user 2.5M Nov 30 12:00 ai.zip
 

Additional Notes

Why Reusing build-plugin-zip.yaml?

  • Maintains single source of truth for build process
  • Ensures consistency with any existing build workflows
  • Easier to maintain (updates to build process automatically apply here)
  • Follows WordPress best practices for workflow composition

Security Considerations

  • Workflow uses minimal required permissions
  • Actions are pinned to specific SHA hashes for security
  • No secrets are exposed or required in this workflow
  • Follows GitHub's security best practices for release automation

- Triggers on release publish
- Reuses existing build-plugin-zip workflow
- Downloads built artifact
- Uploads ai.zip as release asset

Fixes WordPress#109
@github-actions
Copy link

github-actions bot commented Nov 30, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @alishanvr.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: alishanvr.

Co-authored-by: dkotter <[email protected]>
Co-authored-by: infowprobo <[email protected]>
Co-authored-by: jeffpaul <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.61%. Comparing base (5c4491a) to head (dad690e).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #115   +/-   ##
==========================================
  Coverage      29.61%   29.61%           
  Complexity       145      145           
==========================================
  Files             14       14           
  Lines            878      878           
==========================================
  Hits             260      260           
  Misses           618      618           
Flag Coverage Δ
unit 29.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jeffpaul jeffpaul requested a review from dkotter December 1, 2025 03:27
@jeffpaul jeffpaul added this to the 0.2.0 milestone Dec 1, 2025
Copy link
Collaborator

@dkotter dkotter 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 this comment on another PR/Issue but I don't think we need a separate GitHub Action for this as the Action we have that deploys to WP.org will already attach the final asset to the release (see https://github.com/WordPress/ai/blob/develop/.github/workflows/wporg-plugin-deploy.yml#L54)

We can leave this PR open for now until we've verified our current approach works

@infowprobo
Copy link
Author

Got it, thanks! I'll wait for your verification. Let me know if you need anything from me. 👍

@jeffpaul jeffpaul modified the milestones: 0.1.1, 0.2.0 Dec 2, 2025
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.

Automate generation of ai.zip release asset via GitHub Action

4 participants