miya/gh-auto-updater

1.0.1 2017-02-13 01:00 UTC

This package is not auto-updated.

Last update: 2024-05-25 18:15:38 UTC


README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

A composer library for self-hosted WordPress plugin on GitHub with automatic update.

Getting Started

1. The easier way to install this is by using composer.

$ composer require miya/gh-auto-updater

2. Activate automatic update in your WordPress plugin.

<?php

// Autoload
require_once( dirname( __FILE__ ) . '/vendor/autoload.php' );

add_action( 'init', 'activate_autoupdate' );

function activate_autoupdate() {
	$plugin_slug = plugin_basename( __FILE__ ); // e.g. `hello/hello.php`.
	$gh_user = 'miya0001';                      // The user name of GitHub.
	$gh_repo = 'gh-auto-updater-example';       // The repository name of your plugin.

	// Activate automatic update.
	new Miya\WP\GH_Auto_Updater( $plugin_slug, $gh_user, $gh_repo );
}

3. GitHub Access Token (Optional)

You can use personal access token.

define( 'GITHUB_ACCESS_TOKEN', 'xxxxxxxx' );

How to update your plugin.

To release the new version, please do as follows:

1. Tag and push to GitHub.

$ git tag 1.1.0
$ git push origin 1.1.0
  • 1.0.0 is a version number, it have to be same with version number in your WordPress plugin.
  • You have to commit vendor directory in your plugin.

2. Release the new version.

  1. Please visit "releases" in your GitHub repository.
  2. Choose a tag.
  3. Fill out the release note and title.
  4. Upload your plugin which is comporessed with zip. (Optional)
  5. Press "Publish release".

Also, you can use automatic release.

Following is an example of the .travis.yml for automatic release.

https://github.com/miya0001/miya-gallery/blob/master/.travis.yml

You can generate deploy: section by The Travis Client like following.

$ travis setup releases

Example Projects

Please install old version of following projects, then you can see update notice.

These projects deploy new releases automatically with Travis CI.

$ travis setup releases

Please check .travis.yml and documentation.

Screenshots

Notification on "Plugins" screen in WordPress dashboard.

"Details" screen in WordPress dashboard. You can see release note on GitHub as changelog.

"WordPress Updates" screen.

License

GPL v2