use a 202 if the asset was already published
[pharext/pharext.org] / app / Github / API.php
index 13373269ac86c30d144eff3d78addb2f8f49bcce..e56ada1ecb3941079ddf9a176a07130cc08ccabd 100644 (file)
@@ -50,7 +50,7 @@ class API
                $this->logger = $logger;
                $this->config = $config;
                $this->client = new Client("curl", "github");
-               $this->client->configure($config->http->configure);
+               $this->client->configure($config->http->configure->toArray());
                $this->client->attach(new ClientObserver($logger));
                $this->tokens = $tokens ?: new Storage\Session;
                $this->cache = $cache;
@@ -224,7 +224,12 @@ class API
                $call = new API\Releases\CreateRelease($this, compact("repo", "tag"));
                return $call($callback);
        }
-       
+
+       function publishRelease($repo, $id, $tag, callable $callback) {
+               $call = new API\Releases\PublishRelease($this, compact("repo", "id", "tag"));
+               return $call($callback);
+       }
+
        function createReleaseAsset($url, $asset, $type, callable $callback) {
                $call = new API\Releases\CreateReleaseAsset($this, compact("url", "asset", "type"));
                return $call($callback);