Skip to content

Commit 503bb53

Browse files
authored
ask for release stability for pecl release (#12)
1 parent 5c3cba0 commit 503bb53

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Console/Command/Release/PeclCommand.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Input\InputOption;
1717
use Symfony\Component\Console\Output\OutputInterface;
18+
use Symfony\Component\Console\Question\ChoiceQuestion;
1819
use Symfony\Component\Console\Question\Question;
1920

2021
class PeclCommand extends AbstractReleaseCommand
@@ -93,6 +94,13 @@ private function process(Repository $repository, SimpleXMLElement $xml): void
9394
return;
9495
}
9596

97+
$question = new ChoiceQuestion(
98+
'<question>Is this a beta or stable release?</question>',
99+
['stable', 'beta'],
100+
'stable',
101+
);
102+
$stability = $helper->ask($this->input, $this->output, $question);
103+
96104
//new release data
97105
$release = [
98106
'date' => date('Y-m-d'),
@@ -101,6 +109,10 @@ private function process(Repository $repository, SimpleXMLElement $xml): void
101109
'release' => $newVersion,
102110
'api' => '1.0',
103111
],
112+
'stability' => [
113+
'release' => $stability,
114+
'api' => 'stable',
115+
],
104116
'notes' => $this->format_notes($newVersion),
105117
];
106118
$this->output->writeln($this->convertPackageXml($xml, $release));
@@ -126,6 +138,8 @@ protected function convertPackageXml(SimpleXMLElement $xml, array $new): string
126138
$xml->time = $new['time'];
127139
$xml->version->release = $new['version']['release'];
128140
$xml->version->api = $new['version']['api'];
141+
$xml->stability->release = $new['stability']['release'];
142+
$xml->stability->api = $new['stability']['api'];
129143
$xml->notes = $new['notes'];
130144

131145
//prettify

0 commit comments

Comments
 (0)