This commit is contained in:
aymm 2021-04-17 17:54:58 +02:00
parent 6880b8221b
commit dc76c19ebb
Signed by: phlaym
GPG Key ID: A06651BAB6777237
3 changed files with 41 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "hutattedonmyarm/dragonpolls", "name": "hutattedonmyarm/dragonpolls",
"version": "0.9.1", "version": "0.9.3",
"description": "A polling client for pnut.io", "description": "A polling client for pnut.io",
"require": { "require": {
"hutattedonmyarm/apnuti": "@dev" "hutattedonmyarm/apnuti": "@dev"

View File

@ -8,4 +8,9 @@ return [
'app_name' => 'Playground', 'app_name' => 'Playground',
'callback_url' => 'http://localhost/auth_callback.php', 'callback_url' => 'http://localhost/auth_callback.php',
'permission_scopes' => 'basic' //comma seperated string 'permission_scopes' => 'basic' //comma seperated string
'github_username' => '',
'github_repo' => '',
'github_token' => '',
'gitea_url' => '',
'gitea_token' => ''
]; ];

35
release.php Normal file
View File

@ -0,0 +1,35 @@
<?php
$config = include(__DIR__.'/config.php');
$version = json_decode(file_get_contents(__DIR__.'/composer.json'), true)['version'];
if (count($argv) < 2) {
die('Usage: ' . $argv[0] . ' <release_name>');
}
$release_name = $argv[1];
$release_name_arg = escapeshellarg($release_name);
print('Creating tag'.PHP_EOL);
$output = shell_exec("git tag -s $version -m $release_name_arg");
print($output.PHP_EOL);
print(''.PHP_EOL);
print('Pusing tag'.PHP_EOL);
$output = shell_exec('git push --tags');
print($output.PHP_EOL);
print(''.PHP_EOL);
print('Creating release on Github'.PHP_EOL);
$gh_user = $config['github_username'];
$gh_repo = $config['github_repo'];
$gh_token = $config['github_token'];
$payload = escapeshellarg('{"tag_name":"'.$version.'", "name":"'.$release_name.'"}');
$ct_header = '"Content-Type: application/json"';
$output = shell_exec("curl -X POST -H $ct_header -u $gh_user:$gh_token https://api.github.com/repos/$gh_user/$gh_repo/releases -d $payload");
print($output.PHP_EOL);
print(''.PHP_EOL);
print('Creating release on Gitea'.PHP_EOL);
$g_url = $config['gitea_url'];
$g_token = $config['gitea_token'];
$token_header = '"Authorization: token ' . $g_token . '"';
$output = shell_exec("curl -X POST -H $ct_header -H $token_header $g_url -d $payload");
print($output.PHP_EOL);