Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ as well for this commit and pushed to git (ensure that you have rights to add ta

[version] can be either "11.5.3" or "11.5" for detecting the branch and the next version (of no specific version is set)

--sprint-release If this option is set, the version is considered as sprint release (e.g. 9.1.0)
--commitMessage -m An additional information to the commit message of the release commit.
--sprint-release If this option is set, the version is considered as sprint release (e.g. 9.1.0) - don't use this for an LTS (e.g. 14.3.0) release
--interactive -i Enabled by default, to verify that the right version and branch is used.
--dry-run No push to the remote git repository and gerrit is done, making all changes only in the local repository.

Expand Down
9 changes: 0 additions & 9 deletions src/Command/ReleaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ public function configure(): void
InputArgument::REQUIRED,
'Set it to "8.7" to release the next "8.7.x" version (even if "8.7.0" has not been released). Checks for a branch named like TYPO3_8-7 or uses main'
)
->addOption(
'commitMessage',
'm',
InputOption::VALUE_OPTIONAL,
'Additional commit message to [RELEASE] Release of TYPO3 x.y.z'
)
->addOption(
'sprint-release',
null,
Expand Down Expand Up @@ -129,9 +123,6 @@ public function execute(InputInterface $input, OutputInterface $output): int

// Now commit with "[RELEASE] Released TYPO3 x.y.z"
$commitMessage = '[RELEASE] Release of TYPO3 ' . $nextVersion;
if ($input->hasOption('commitMessage') && $input->getOption('commitMessage')) {
$commitMessage .= "\n\n" . $input->getOption('commitMessage');
}
$git->run('commit', ['-a', '-S', '--allow-empty', '-m', trim($commitMessage)]);
$localReleaseCommitHash = $this->gitHelper->getCurrentRevision();
$this->io->success('Release commit is ' . $localReleaseCommitHash . ' with message ' . "\n\n" . $commitMessage);
Expand Down
6 changes: 0 additions & 6 deletions src/Model/AnnounceApi/HashCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class HashCollection extends \ArrayObject implements \JsonSerializable
'sha256sum' => 64,
];

/**
* @param array $hashes
*/
public function __construct(array $hashes)
{
$hashes = array_intersect_key(
Expand Down Expand Up @@ -52,9 +49,6 @@ public function __construct(array $hashes)
parent::__construct($hashes);
}

/**
* @return array
*/
public function jsonSerialize(): array
{
return $this->getArrayCopy();
Expand Down
84 changes: 8 additions & 76 deletions src/Model/AnnounceApi/Release.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,62 +13,18 @@

class Release implements \JsonSerializable
{
/**
* @var string
*/
private $version;

/**
* @var string
*/
private $type;

/**
* @var \DateTimeInterface
*/
private $date;

/**
* @var HashCollection
*/
private $tarPackage;

/**
* @var HashCollection
*/
private $zipPackage;

/**
* @var ReleaseNotes
*/
private $releaseNotes;

/**
* @var bool
*/
private $elts;

public function __construct(
string $version,
string $type,
\DateTimeInterface $date,
HashCollection $tarPackage,
HashCollection $zipPackage,
ReleaseNotes $releaseNotes = null,
bool $elts = false
private string $version,
private string $type,
private \DateTimeInterface $date,
private HashCollection $tarPackage,
private HashCollection $zipPackage,
private ?ReleaseNotes $releaseNotes = null,
private bool $elts = false
) {
$this->version = $version;
$this->type = $type;
$this->date = $date;
$this->tarPackage = $tarPackage;
$this->zipPackage = $zipPackage;
$this->releaseNotes = $releaseNotes;
$this->elts = $elts;

}

/**
* @return array
*/
public function jsonSerialize(): array
{
$result = [
Expand All @@ -85,33 +41,21 @@ public function jsonSerialize(): array
return $result;
}

/**
* @return string
*/
public function getVersion(): string
{
return $this->version;
}

/**
* @return string
*/
public function getType(): string
{
return $this->type;
}

/**
* @return \DateTimeInterface
*/
public function getDate(): \DateTimeInterface
{
return $this->date;
}

/**
* @return \DateTimeInterface
*/
public function getUtcDate(): \DateTimeInterface
{
/** @var \DateTime|\DateTimeImmutable $date */
Expand All @@ -124,33 +68,21 @@ public function getUtcDate(): \DateTimeInterface
return $date;
}

/**
* @return HashCollection
*/
public function getTarPackage(): HashCollection
{
return $this->tarPackage;
}

/**
* @return HashCollection
*/
public function getZipPackage(): HashCollection
{
return $this->zipPackage;
}

/**
* @return ReleaseNotes
*/
public function getReleaseNotes(): ReleaseNotes
{
return $this->releaseNotes;
}

/**
* @return bool
*/
public function isElts(): bool
{
return $this->elts;
Expand Down
32 changes: 4 additions & 28 deletions src/Model/AnnounceApi/ReleaseNotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,14 @@

class ReleaseNotes implements \JsonSerializable
{
private $newsLink;
private $news;
private $upgradingInstructions;
private $changes;

public function __construct(
string $newsLink,
string $news,
string $upgradingInstructions,
string $changes
private string $newsLink,
private string $news,
private string $upgradingInstructions,
private string $changes
) {
$this->newsLink = $newsLink;
$this->news = $news;
$this->upgradingInstructions = $upgradingInstructions;
$this->changes = $changes;
}

/**
* @return array
*/
public function jsonSerialize(): array
{
return [
Expand All @@ -43,33 +31,21 @@ public function jsonSerialize(): array
];
}

/**
* @return string
*/
public function getNewsLink(): string
{
return $this->newsLink;
}

/**
* @return string
*/
public function getNews(): string
{
return $this->news;
}

/**
* @return string
*/
public function getUpgradingInstructions(): string
{
return $this->upgradingInstructions;
}

/**
* @return string
*/
public function getChanges(): string
{
return $this->changes;
Expand Down
31 changes: 6 additions & 25 deletions src/Service/AnnounceApiService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,11 @@

class AnnounceApiService
{
/**
* @var VariableResolveService
*/
private $variableResolveService;

/**
* @var ClientInterface
*/
private $client;

/**
* @var array
*/
private $configuration;

public function __construct(
VariableResolveService $variableResolveService,
ClientInterface $client,
array $configuration
) {
$this->variableResolveService = $variableResolveService;
$this->client = $client;
$this->configuration = $configuration;
}
private VariableResolveService $variableResolveService,
private ClientInterface $client,
private array $configuration
) {}

public function getRelease(string $version)
{
Expand Down Expand Up @@ -202,7 +183,7 @@ private function json(ResponseInterface $response)
return json_decode((string)$response->getBody(), true);
}

private function buildRelease(array $json = null)
private function buildRelease(?array $json = null)
{
if (empty($json)) {
return null;
Expand All @@ -223,7 +204,7 @@ private function buildHashCollection(array $json)
return new HashCollection($json);
}

private function buildReleaseNotes(array $json = null)
private function buildReleaseNotes(?array $json = null)
{
if (empty($json)) {
return null;
Expand Down