I’m trying to get my github build chain working for my Venom plugin, the one referenced in this post:
It builds all four platforms just fine. But I cannot get it to publish - it always says the publish job was skipped. I gave the plugin version “v2.1.0”, and also tagged the commit the same. So I expected the job to publish a release, but no such luck.
Anyone have any pointers as to where I have gone wrong?
The action does not care about the version inside the json file. It instead looks at the tags on the commit, i believe. If the commit has a tag that starts with v, it will publish. I think.
That is what I thought, but my commit version does begin with “v”. I don’t know the syntax of the file, but in my ignorance it appears that later on in the publish job that I copied it also checks that the json version matches the commit version. But that is true in my case as well. So I am stumped.
I am not very familiar with git terminology, but I believe it is annotated. I created the tag locally with GitHub Desktop, then pushed to the server. I can see the tag on the GitHub server.
It’s because the tag shoud be named “v2.1.0” which you have done correctly, but the plugin version in the manifest should be named “2.1.0” NOT with a leading “v”.
If you look in the workflow file here’s the relevant block:
- name: Check if plugin version matches tag
run: |
pluginversion=`jq -r '.version' plugin.json`
if [ "v$pluginversion" != "${{ env.CI_REF_NAME }}" ]; then
echo "Plugin version from plugin.json 'v$pluginversion' doesn't match with tag version '${{ env.CI_REF_NAME }}'"
exit 1
fi
The specific part is "v$pluginversion". Here you can see that it reads the plugin version, which should be “2.1.0”, then prepends it with a “v” and then compares it with the tag.
Thanks Lars - I have since removed the “v” from my plugin.json version, but still no luck.
I’ve looked at some Surge build runs, and I see that the initial modify-plugin-version: job skips the run step if the tag begins with “V”. But when I run it does not skip. I restructured the run step a bit to give it a name and to put the if: at the top of the step. But I believe it should logically be the same, and a prior run failed in the same way before I made that change.
The other major difference is the publish job - Surge obviously runs the job, and mine skips the job.
I don’t understand why mine behaves differently.
I’m assuming the build action creates the release from scratch. Or are you supposed to create the release placeholder first, and then run the build action? Obviously I am doing something wrong.
I built my release actions to trigger on the creation of a release, rather than on a tagged commit. When I started with github actions, it wasn’t really feasible to do actions on demand, so triggering on release creation seemed the best compromise.
I create the release, and then a few minutes later, the built packages get added to it.