2017 © Pedro Peláez
 

library gh-auto-updater

image

miya/gh-auto-updater

  • Sunday, March 11, 2018
  • by miya0001
  • Repository
  • 1 Watchers
  • 30 Stars
  • 1,144 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 5 Versions
  • 21 % Grown

The README.md

Automatic Updater with GitHub API for WordPress Plugin

Build Status Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

A composer library for self-hosted WordPress plugin on GitHub with automatic update., (*2)

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., (*3)

define( 'GITHUB_ACCESS_TOKEN', 'xxxxxxxx' );

How to update your plugin.

To release the new version, please do as follows:, (*4)

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., (*5)

Following is an example of the .travis.yml for automatic release., (*6)

https://github.com/miya0001/miya-gallery/blob/master/.travis.yml, (*7)

You can generate deploy: section by The Travis Client like following., (*8)

$ travis setup releases

Example Projects

Please install old version of following projects, then you can see update notice., (*9)

  • https://github.com/miya0001/self-hosted-wordpress-plugin-on-github
  • https://github.com/miya0001/miya-gallery

These projects deploy new releases automatically with Travis CI., (*10)

$ travis setup releases

Please check .travis.yml and documentation., (*11)

Screenshots

Notification on "Plugins" screen in WordPress dashboard., (*12)

, (*13)

"Details" screen in WordPress dashboard. You can see release note on GitHub as changelog., (*14)

, (*15)

"WordPress Updates" screen., (*16)

, (*17)

License

GPL v2, (*18)

The Versions

11/03 2018

dev-master

9999999-dev

  Sources   Download

GPL v2

The Requires

 

The Development Requires

by Avatar miya0001

22/02 2017

dev-fix-problem-on-secret-repo

dev-fix-problem-on-secret-repo

  Sources   Download

GPL v2

The Requires

 

The Development Requires

by Avatar miya0001

22/02 2017

dev-allow-to-set-gh-token-on-constructor

dev-allow-to-set-gh-token-on-constructor

  Sources   Download

GPL v2

The Requires

 

The Development Requires

by Avatar miya0001

13/02 2017

dev-stable

dev-stable

  Sources   Download

GPL v2

The Requires

 

The Development Requires

by Avatar miya0001

13/02 2017

1.0.1

1.0.1.0

  Sources   Download

GPL v2

The Requires

 

The Development Requires

by Avatar miya0001