Author or Publish run modes can only be set when you start the AEM instance for the first time and cannot be changed afterward.
You have to delete the crx-quickstart folder and restart the jar file after changing the runmode to "publish"
Check caution at [1]
Caution:
When using one of the above run modes (author, publish, samplecontent, nosamplecontent), the value used at installation time defines the run mode for the entire lifetime of that installation.
For these run modes you cannot change them after installation.
[1] Run Modes