The initial error is not about order of the installer_unix task vs. the publishing.publications configuration in your build script. You’ve written them as expected. Reversing them is worse because you can’t reference the installer_unix as a project property until you’ve defined the task.
The error about configuring the ‘publishing’ extension after it has been accessed suggests that something else in your build is tampering with the publishing extension too late or forcing a deferred action to execute too early. Depending on which case, a stack trace may provide a clue to what is causing this.
Additionally, adding apply plugin: 'maven-publish' and a couple lines to actually create the zip file yields a project that can successfully publish the artifact, so the example provided doesn’t seem to actually reproduce the issue you’re seeing.
Thanks for these clues. I think that solved it. Like so much of gradle, lots of trial and error is needed to figure out the best way to structure things. The docs are useful for the details, but rarely for the big picture.
In my case, I had publishing.repositories defined in the top level gradle but inside an allprojects{} block. I’m never really sure what belongs inside allprojects{} and what doesn’t.