Please post below if you have better methods because I want to ask for improvements too! 1. Using commit SHA Methods to locate: Read from the local .git directory. This is bad because not every copy of the plugin has this file. Example: https://github.com/PocketMine/Pocke...a592ad471a9988ec6f4c3b5/src/config.php#L76-80 Force the phar builder to inject the commit into your plugin. This is bad too, because you cannot use it with FolderPluginLoader then. Methods to check: Use the GitHub API. For example, cURL-get (Utils::getURL()) https://api.github.com/repos/OwnerName/RepoName/commits, JSON-decode it and check if your commit is the newest commit by $decoded[0]["sha"]. Host a server that provides information for a plugin about newest commits. You have to make sure its uptime though. 2. Using a build ID Methods to locate/create: Inject into plugin with incrementation when building phar. Same issue with FolderPluginLoader. Make it yourself. This is not good because you will forget it. Methods to check: Use GitHub raw content. Download from the repo the latest ID and see if you are having the latest one. Query from your own server. You have to make sure its uptime though. 3. Using plugin version This only applies for release auto-updates. To identify: use this in the plugin code: PHP: $plugin->getDescription()->getVersion(); To check: Download raw from GitHub, YAML-parse and compare versions Use the GitHub release name As you see, all methods have their bad sides. These are some ideas, please suggest better ideas below. The thread may seem a little badly-structured because @Lambo is rushing me to the test server
I quite like using build IDs and have set my Jenkins to append build numbers to the PHAR. I have yet to implement it into the plugin.yml file, but I intend to. Just as I did with my Bukkit version. It was easier for Bukkit though, cause you could simply use Maven for it, whereas with PHAR files you need to create a separate script that greps the line and edits it.
And how do you check if it is a new version? And I was talking about development builds there but right, plugin version is a method.
I only do updates to releases, and I use the GitHub API to see if the current release code is different than the one in the phar metadata. Not fool proof, but simple.
I prefer to use only the ones approved here because it will be like a second filter for users to believe that every update is safe :3
That is better :3 let them choose from Stable, Beta and Development like PocketMine xD so... The Stable will be from the forums, the Beta from the Github repo and the Development from your generator :3