}
$this->setTokenForUser($release->repository->owner->login);
- $this->github->uploadAssetForRelease($release->release, $release->repository, function($json) use($response) {
+ $this->github->uploadAssetForRelease($release->release, $release->repository, null, function($json) use($response) {
$response->setResponseCode(201);
$response->setHeader("Location", $json->url);
})->send();
}
$this->setTokenForUser($create->repository->owner->login);
- $this->github->createReleaseFromTag($create->repository, $create->ref, function($json) use($response) {
+ $this->github->createReleaseFromTag($create->repository, $create->ref, null, function($json) use($response) {
$response->setResponseCode(201);
$response->setHeader("Location", $json->url);
})->send();
call_user_func(new RepoCallback($this->github), $repo, $links);
$this->github->listReleases($repo->full_name, null, function($releases) use($repo) {
- $tag = $this->app->getRequest()->getForm("tag");
+ $config = $this->app->getRequest()->getForm();
foreach ($releases as $r) {
- if ($r->tag_name === $tag) {
- $this->github->uploadAssetForRelease($repo, $r, function() use($repo) {
+ if ($r->tag_name === $config->tag) {
+ $this->github->uploadAssetForRelease($repo, $r, $config, function() use($repo) {
$this->app->redirect($this->app->getBaseUrl()->mod("./github/" . $repo->full_name));
});
return;
}
}
- $this->github->createReleaseFromTag($repo, $tag, function() use($repo) {
+ $this->github->createReleaseFromTag($repo, $tag, $config, function() use($repo) {
$this->app->redirect($this->app->getBaseUrl()->mod("./github/" . $repo->full_name));
});
});
return $call($callback);
}
- function uploadAssetForRelease($repo, $release, callable $callback) {
- return $this->listHooks($repo->full_name, function($hooks) use($release, $repo, $callback) {
+ function uploadAssetForRelease($repo, $release, $config, callable $callback) {
+ return $this->listHooks($repo->full_name, function($hooks) use($release, $repo, $config, $callback) {
$repo->hooks = $hooks;
$hook = $this->checkRepoHook($repo);
- $phar = new Pharext\Package($repo->clone_url, $release->tag_name, $repo->name, $hook ? $hook->config : null);
+ $phar = new Pharext\Package($repo->clone_url, $release->tag_name, $repo->name, $config ?: $hook->config);
$name = sprintf("%s-%s.ext.phar", $repo->name, $release->tag_name);
$url = uri_template($release->upload_url, compact("name"));
$this->createReleaseAsset($url, $phar, "application/phar", function($json) use($release, $repo, $callback) {
});
}
- function createReleaseFromTag($repo, $tag_name, callable $callback) {
+ function createReleaseFromTag($repo, $tag_name, $config, callable $callback) {
return $this->createRelease($repo->full_name, $tag_name, function($json) use($repo, $callback) {
- $this->uploadAssetForRelease($repo, $json, $callback);
+ $this->uploadAssetForRelease($repo, $json, $config, $callback);
});
}
<?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
- <form method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/release") ?>">
+ <form class="form-inline" method="post" action="<?= $baseUrl->mod("./github/repo/". $repo->full_name ."/release") ?>">
<input type="hidden" name="tag" value="<?= $this->e($v->tag->name) ?>">
+ <div class="checkbox">
+ <label for="hook-zend">
+ <input id="hook-zend" type="checkbox" name="zend" value="1" <?= (!empty($hook) && !empty($hook->config->zend)) ? "checked":""?>>
+ Mark as a ZendExtension.
+ </label>
+ </div>
+ <div class="checkbox <?= empty($repo->package_xml) ? "disabled text-muted":"" ?>">
+ <label for="hook-pecl">
+ <input id="hook-pecl" type="checkbox" name="pecl" value="1" <?= (!empty($hook) && !empty($hook->config->pecl)) ? "checked":""?> <?= empty($repo->package_xml) ? "disabled":"" ?>>
+ Use PECL package XML file.
+ </label>
+ </div>
<button class="btn btn-warning">
<span class="octicon octicon-package"></span>
Release PHARext package