Skip to content

chore: Added workflow for Plugin PRs to create zip for testing#232

Merged
colinmurphy merged 28 commits into
mainfrom
chore-create-github-workflow-release-plugins
May 29, 2025
Merged

chore: Added workflow for Plugin PRs to create zip for testing#232
colinmurphy merged 28 commits into
mainfrom
chore-create-github-workflow-release-plugins

Conversation

@colinmurphy

@colinmurphy colinmurphy commented May 27, 2025

Copy link
Copy Markdown
Member

Description

Fixes #187

This does the following:

  1. Runs on any PR create/update when a plugin sub-directory has been modified
  2. Creates an artifact of the plugin in a sub-directory of that plugin called "plugin-build" using composer archive - https://getcomposer.org/doc/03-cli.md#archive
  3. Add a build-sha.txt file with the Github SHA to the plugin
  4. Uploads the file name as ${PLUGIN-SLUG}.zip to thay workflow
  5. Leaves an automated comment into the PR with a link to the workflow summary so you can download the file

Important

We had Github SHA as part of the zip file name but this had to be removed as WP install wouldn't allow this filename.

Screenshot 2025-05-27 at 21 20 02

Important

For any other plugin which wants to use this, they need to ensure composer archive is setup. They can test this locally bu running composer archive -vvv --format=zip --file="plugin-build/hwp-previews" --dir="." (REPLACE hwp-previews)

Related Issue

#187

Dependant PRs

N/A

Type of Change

  • ✅ Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactoring (no functional changes)
  • 📄 Example update (no functional changes)
  • 📝 Documentation update
  • 🔍 Performance improvement
  • 🧪 Test update

How Has This Been Tested?

Screenshots

See example comment here -#232 (comment)

Screenshot 2025-05-27 at 21 21 35 Screenshot 2025-05-27 at 21 21 52 Screenshot 2025-05-27 at 21 22 06

Checklist

  • I have read the CONTRIBUTING document
  • My code follows the project's coding standards
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • Any dependent changes have been highlighted, merged or published

@github-actions

Copy link
Copy Markdown
Contributor

🔗 Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

…ing to make it more simpler and add a .build-sha with the SHA ID
@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@github-actions

Copy link
Copy Markdown
Contributor

ℹ️ Download the hwp-previews plugin artifact from this workflow run (see the 'Artifacts' section at the bottom).

@colinmurphy colinmurphy marked this pull request as ready for review May 27, 2025 20:24
@colinmurphy colinmurphy requested a review from a team as a code owner May 27, 2025 20:24
@colinmurphy colinmurphy changed the title chore: DRAFT - Added workflow for PRs chore: Added workflow for PRs May 27, 2025
@colinmurphy colinmurphy changed the title chore: Added workflow for PRs chore: Added workflow for Plugin PRs to create Artifact May 27, 2025
@colinmurphy colinmurphy changed the title chore: Added workflow for Plugin PRs to create Artifact chore: Added workflow for Plugin PRs to create zip for testing May 27, 2025
@moonmeister

Copy link
Copy Markdown
Member

nice work! Would it be possible to add the link to the artifact in the comment? And can we have a single comment that's updated or does it have to do it on every push? If not I think this works pretty well, just risks being spammy.

@ahuseyn ahuseyn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great 🚀

@colinmurphy colinmurphy added this pull request to the merge queue May 29, 2025
Merged via the queue into main with commit 003b166 May 29, 2025
14 checks passed
@colinmurphy colinmurphy deleted the chore-create-github-workflow-release-plugins branch May 29, 2025 10:26
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.

Setup Github Workflow to create the dev release of Previews

3 participants