mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
make what get's uploaded configurable and allow to run upload alone
This commit is contained in:
parent
e03c84f948
commit
09e9f81545
@ -65,6 +65,8 @@ $config = array(
|
|||||||
'editchangelog' => '* ',
|
'editchangelog' => '* ',
|
||||||
//'sfuser' => 'ralfbecker',
|
//'sfuser' => 'ralfbecker',
|
||||||
//'release' => '$sfuser,egroupware@frs.sourceforge.net:/home/frs/project/e/eg/egroupware/eGroupware-$version/eGroupware-$version.$packaging/',
|
//'release' => '$sfuser,egroupware@frs.sourceforge.net:/home/frs/project/e/eg/egroupware/eGroupware-$version/eGroupware-$version.$packaging/',
|
||||||
|
// what gets uploaded with upload
|
||||||
|
'upload' => '$sourcedir/*egroupware-epl{,-contrib}-$version.$packaging*',
|
||||||
'copychangelog' => '$sourcedir/README', //'$sfuser,egroupware@frs.sourceforge.net:/home/frs/project/e/eg/egroupware/README',
|
'copychangelog' => '$sourcedir/README', //'$sfuser,egroupware@frs.sourceforge.net:/home/frs/project/e/eg/egroupware/README',
|
||||||
'skip' => array(),
|
'skip' => array(),
|
||||||
'run' => array('checkout','editchangelog','tag','copy','virusscan','create','sign','obs','copychangelog'),
|
'run' => array('checkout','editchangelog','tag','copy','virusscan','create','sign','obs','copychangelog'),
|
||||||
@ -382,9 +384,26 @@ function do_release()
|
|||||||
'body' => $config['changelog'],
|
'body' => $config['changelog'],
|
||||||
);
|
);
|
||||||
$response = github_api("/repos/EGroupware/egroupware/releases", $data);
|
$response = github_api("/repos/EGroupware/egroupware/releases", $data);
|
||||||
$upload_url = preg_replace('/{\?[^}]+}$/', '', $response['upload_url']); // remove {?name,label} template
|
$config['upload_url'] = preg_replace('/{\?[^}]+}$/', '', $response['upload_url']); // remove {?name,label} template
|
||||||
|
|
||||||
$archives = $config['sourcedir'].'/*egroupware-epl{,-contrib}-'.$config['version'].'.'.$config['packaging'].'*';
|
do_upload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload archives
|
||||||
|
*/
|
||||||
|
function do_upload()
|
||||||
|
{
|
||||||
|
global $config,$verbose;
|
||||||
|
|
||||||
|
if (empty($config['upload_url']))
|
||||||
|
{
|
||||||
|
$response = github_api("/repos/EGroupware/egroupware/releases", array(), 'GET');
|
||||||
|
$config['upload_url'] = preg_replace('/{\?[^}]+}$/', '', $response[0]['upload_url']); // remove {?name,label} template
|
||||||
|
}
|
||||||
|
|
||||||
|
$archives = config_translate('upload');
|
||||||
|
echo "Uploading $archives\n";
|
||||||
|
|
||||||
foreach(glob($archives) as $path)
|
foreach(glob($archives) as $path)
|
||||||
{
|
{
|
||||||
@ -410,8 +429,9 @@ function do_release()
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ($verbose) echo "Uploading $path as $content_type\n";
|
||||||
$name = basename($path);
|
$name = basename($path);
|
||||||
github_api($upload_url, array(
|
github_api($config['upload_url'], array(
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'label' => isset($label) ? $label : $name,
|
'label' => isset($label) ? $label : $name,
|
||||||
), 'FILE', $path, $content_type);
|
), 'FILE', $path, $content_type);
|
||||||
|
Loading…
Reference in New Issue
Block a user