Compare commits

...

5 commits
v0.0.2 ... main

Author SHA1 Message Date
j
9f9d7c58bb Mention about content-type 2025-06-17 16:29:42 +10:00
j
e295fcbfb3 Remove build from plugin upload
All checks were successful
Build & Release WordPress Plugin / build (push) Successful in 22s
2025-06-17 16:26:58 +10:00
j
c25710e4bd Use file not raw binary
Some checks failed
Build & Release WordPress Plugin / build (push) Failing after 36s
2025-06-17 16:24:57 +10:00
j
ad1212df4c Ensure unzip installed
All checks were successful
Build & Release WordPress Plugin / build (push) Successful in 27s
God why do we still use zip when tar.gz is superior in every way
2025-06-17 16:22:09 +10:00
j
b336ab151c Add unzip check 2025-06-17 16:21:47 +10:00
2 changed files with 15 additions and 5 deletions

View file

@ -34,7 +34,7 @@ jobs:
- name: Prepare Build Environment - name: Prepare Build Environment
run: | run: |
apt update && apt -y install zip nodejs curl jq apt update && apt -y install zip unzip nodejs curl jq
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@v4 uses: actions/checkout@v4
@ -53,6 +53,7 @@ jobs:
cd build cd build
zip -r "../${PLUGIN_NAME}.zip" "${PLUGIN_NAME}" zip -r "../${PLUGIN_NAME}.zip" "${PLUGIN_NAME}"
cd - cd -
unzip -l "${PLUGIN_NAME}.zip"
- name: Create Release if not exists - name: Create Release if not exists
run: | run: |
@ -86,7 +87,8 @@ jobs:
| jq -r '.id') | jq -r '.id')
# Pushes he zip file to be shown in the "Releases" tab under this release. # Pushes he zip file to be shown in the "Releases" tab under this release.
curl -X POST "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=${PLUGIN_NAME}.zip" \ curl -X POST "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \ -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-H "Content-Type: application/zip" \ -F "name=${PLUGIN_NAME}.zip" \
--data-binary "@build/${PLUGIN_NAME}.zip" -F "attachment=@${PLUGIN_NAME}.zip"

View file

@ -1,3 +1,11 @@
# workflow-sample-wordpress-plugin # workflow-sample-wordpress-plugin
A sample workflow that demonstrates how I prefer to store my Wordpress plugins in a repository, and how to publish them to "releases". A sample workflow that demonstrates how I prefer to store my Wordpress plugins in a repository, and how to publish them to "releases".
Wordpress code is just some ChatGPT sample I asked it to generate. Tested and
the zip is dumpable.
Worth noting that the way we upload the Zip may not work for Github. Forgejo
requires a multipart/form-data content type where-as Github may require binary.
I'm not 100% sure because I don't use Github much at the moment. If you're
downloading corrupt zips though, this is probably why.