Download the PHP package rohsyl/github-auto-release without Composer
On this page you can find all versions of the php package rohsyl/github-auto-release. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rohsyl/github-auto-release
More information about rohsyl/github-auto-release
Files in rohsyl/github-auto-release
Package github-auto-release
Short Description A github webhook to automatically create an update repository for your app
License
Informations about the package github-auto-release
Github Auto Release
The purpose of this library is to help you tu build an update server for your app and automate the release of new versions of your app.
Let's imagine you have a web server (https://update.yourdomain.tld) and you want to serve a current.json
file that will contains informations about the last release of your app.
But you're a silly slacker and you dont want to do it manually.
With Github Auto Release, it's done automatically. You just have to configure a webhook and then create your release on github and the .json
files are automatically generated.
Exemple of current.json
:
Create the webhook
Go to your repository on github and go to settings > Webhooks.
Then create a new webhooks.
Set the Payload URL to your webserver URL (SSL recommended).
Set the Content type to application/json
.
Set the Secret with a nice random token. And don't forget it because we need it for configure the app.
Set Which events would you like to trigger this webhook? to releases
only.
Check the Active checkbox and save.
Installation
To install this library run the follow command on your server.
Configuration
Create a .env file at the root of your project if it does not exists.
And set the following values
ENABLE_DEBUG
define if debug is enabled or disabled.
GITHUB_SECRET_TOKEN
is the secret defined while you created the webhook on Github.
LOG_PATH
is the path to the log file. This entry is optional. By default logs are located under logs/app.log
JSON_VERSION_PATH
is the path where json files with informations about each releases will be stored. This entry is optional. By defaults files are stored in the current directory
Basic app
Create an index.php
with the following content:
Test the webhook
To test the webhook, it's possible to send test payload on Github.
Go to your repository on github and go to settings > Webhooks > Edit your webhook.
Down the page there is a list with all delivered payload. Click on the ...
to display details of the payload and them click on Redeliver to send it again and test.
Enjoy !
Now that Github Auto Release is working well you can imagine extend it by creating some functions in your project that will request https://update.yourdomain.tld/current.json to get informations about the last versions of your project.
Then you can download the archive
and extract it locally. Then you can replace every files by the ones from the archive.
You also can use this library rohsyl/laraupdater if you're working with Laravel.
All versions of github-auto-release with dependencies
ext-json Version *
illuminate/http Version ^5.8
vlucas/phpdotenv Version ^3.3
monolog/monolog Version ^1.24
guzzlehttp/guzzle Version ^6.3