From d39fd0eb3faf3326a078f902156661f104629ad8 Mon Sep 17 00:00:00 2001 From: swissky <30409887+swissky@users.noreply.github.com> Date: Mon, 6 Jul 2026 00:18:05 +0200 Subject: [PATCH] Add CI workflow that builds an installable plugin zip on tag push Fixes #6: the GitHub "Download ZIP" of the repo nests the plugin under wp-emdash-main/plugins/, which WordPress' Upload Plugin rejects. This workflow builds emdash-exporter.zip with the plugin folder at the archive root, attaches it to a release on every v* tag, runs a PHP syntax check first, and uploads the zip as an artifact on pull requests for testing. --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..91a3a1e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release plugin zip + +# Builds an installable emdash-exporter.zip (plugin folder at the archive +# root, so WordPress' "Upload Plugin" accepts it) on every tag push, and as +# a downloadable artifact on pull requests for testing. + +on: + push: + tags: + - "v*" + pull_request: + +permissions: + contents: write + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: PHP syntax check + run: | + find plugins/emdash-exporter -name '*.php' -print0 | xargs -0 -n1 php -l + + - name: Build zip + run: | + cd plugins + zip -r ../emdash-exporter.zip emdash-exporter + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: emdash-exporter + path: emdash-exporter.zip + + - name: Create release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v2 + with: + files: emdash-exporter.zip + generate_release_notes: true