A squirrel endpoint running on Skygear Cloud Code using GitHub as a backend.
Only works on public GitHub repositories. Private repositories are NOT supported (see this issue for more details).
-
Register an account on Skygear.io if you haven't yet.
-
Signin to your account on Skygear.io.
-
Go to Settings, add the following environment variable:
GITHUB_REPO
=<your-repo-url>
-
Clone this repository by running
git clone https://github.com/skygear-demo/skygear-squirrel-server
-
Follow this guide to deploy the code to Skygear Cloud Code.
-
Go to
https://your-skygear-cloud-url/getStatus
to verify if the deployment is successful.
-
Your should release your updates to the
GITHUB_REPO
GitHub repository you provided above. -
The tag name of each release MUST follow SemVer.
-
Attach your binaries as assets to the release.
- skygear-squirrel-endpoint will search for
osx
in your filename to determine if it is for osx - skygear-squirrel-endpoint will search for
win
in your filename to determine if it is for windows.
- skygear-squirrel-endpoint will search for
/update?platform={platform}&version={current-version}
:
- if update available, return with status code
200
, and{ "url": "<download-url>" }
- if no updates available, return with status code
204
/getStatus
:
-
if the server is in initializing the connection with GitHub, responses with text:
Server status: Initializing
-
if the server is connected to the GitHub repo successfully, responses wih text:
Server status: GitHub Repo connected!
-
if the server failed to connect to the GitHub repo, responses with text:
Connection with GitHub repo failed. Please make sure environment variable - GITHUB_REPO - is a valid GitHub repo.
-
if GITHUB_REPO is not set at all, responses with text:
Environment variables GITHUB_REPO not set
- If the latest version > current version, return the latest version.
Example:
v1.5.0 -
myapp-osx.zip
,myapp-win.exe
v1.0.0 -
myapp-osx.zip
,myapp-win.exe
/update?platform=osx&version=1.0.0
:200 OK
-{"url": "https://your-github-repo-url/v1.5.0/myapp-osx.zip"}
- If the latest version <= current version, return 204 No Content.
Example:
v1.5.0 -
myapp-osx.zip
,myapp-win.exe
v1.0.0 -
myapp-osx.zip
,myapp-win.exe
/update?platform=osx&version=1.5.0
:204 No Content
- Pre-releases are ignored.
Example:
v2.0.0(pre-release) -
myapp-osx.zip
,myapp-win.exe
v1.5.0 -
myapp-osx.zip
,myapp-win.exe
v1.0.0 -
myapp-osx.zip
,myapp-win.exe
/update?platform=osx&version=1.0.0
:200 OK
-{"url": "https://your-github-repo-url/v1.5.0/myapp-osx.zip"}
- Releases not following SemVer as their tag are ignored.
Example:
v2.awww.yeahhhh -
myapp-osx.zip
,myapp-win.exe
v1.5.0 -
myapp-osx.zip
,myapp-win.exe
v1.0.0 -
myapp-osx.zip
,myapp-win.exe
/update?platform=osx&version=1.0.0
:200 OK
-{"url": "https://your-github-repo-url/v1.5.0/myapp-osx.zip"}
- Releases without assets for target platform are ignored.
Example:
v2.0.0 -
myapp-win.exe
//no assets for osxv1.5.0 -
myapp-osx.zip
,myapp-win.exe
v1.0.0 -
myapp-osx.zip
,myapp-win.exe
/update?platform=osx&version=1.0.0
:200 OK
-{"url": "https://your-github-repo-url/v1.5.0/myapp-osx.zip"}