Skip to content

Allow using existing Keep-A-Changelog files for release notes #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Aug 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
a875b8b
qa: add phly/keep-a-changelog as a dependency
weierophinney Jul 30, 2020
6bc8e3a
WIP: add ability to use Keep-A-Changelog to set release date in CHANG…
weierophinney Jul 31, 2020
3e2e89e
qa: adapted ReleaseCommandTest to mirror changes to ReleaseCommand
weierophinney Jul 31, 2020
c98f47d
qa: apply phpcs fixes
weierophinney Jul 31, 2020
01c2544
qa: suppress psalm deprecation notice in console file
weierophinney Aug 3, 2020
c54f81d
qa: ensure proper types are used everywhere
weierophinney Aug 3, 2020
5e23df3
qa: unit tests for CreateChangelogViaMilestone class
weierophinney Aug 3, 2020
6ef607f
qa: unit tests for ReleaseChangelogAndFetchContentsAggregate
weierophinney Aug 3, 2020
11bdaae
qa: adds unit tests for CommitFileViaConsole
weierophinney Aug 3, 2020
a8c3af2
qa: adds unit tests for UseKeepAChangelogEventsToReleaseAndFetchChang…
weierophinney Aug 3, 2020
3349594
qa: apply CS fixes and psalm advice
weierophinney Aug 3, 2020
d2707b1
fix: remove author awareness from CommitFile and ReleaseChangelogEvent
weierophinney Aug 4, 2020
b6bf9d5
refactor: remove input/output awareness from ReleaseChangelogEvent
weierophinney Aug 4, 2020
3a40424
refactor: accept a branch name when committing a file
weierophinney Aug 4, 2020
8d8146c
refactor: new interface, ReleaseChangelog
weierophinney Aug 4, 2020
ba55354
refactor: idempotent creation of release text via keep-a-changelog
weierophinney Aug 4, 2020
dba9e17
refactor: creates AppendingCreateReleaseTextAggregate as aggregate Cr…
weierophinney Aug 4, 2020
1591c4a
refactor: add ReleaseChangelog as ReleaseCommand argument and switch …
weierophinney Aug 4, 2020
7da6ca0
refactor: use lcobucci/clock instead of `date()`
weierophinney Aug 5, 2020
9641022
docs: adds initial CHANGELOG.md file.
weierophinney Aug 6, 2020
b7a888f
refactor: rename `AppendingCreateReleaseTextAggregate` to `Concatenat…
weierophinney Aug 6, 2020
8c4de68
qa: incorporate feedback for ConcatenateMultipleReleaseTexts
weierophinney Aug 6, 2020
51713c2
refactor: rename `ReleaseChangelog` to `CommitReleaseChangelog`
weierophinney Aug 6, 2020
a5deb57
refactor: assign text `CHANGELOG.md` to a class constant
weierophinney Aug 6, 2020
d9fe978
feat: more commit text when committing changelog
weierophinney Aug 6, 2020
8be5ae2
fix: assertions > type declaration
weierophinney Aug 6, 2020
7d9c597
qa: refactor how `CommitFileViaConsoleTest` initializes dummy repo
weierophinney Aug 6, 2020
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
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changelog

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 1.1.0 - TBD

### Added

- [#18](https://github.com/laminas/automatic-releases/pull/18) adds support for using `CHANGELOG.md` files in [Keep-A-Changelog](https://keepachangelog.com) format for the release notes. When such a file is found, the tooling will set the release date in the file, commit and push it, and then extract that changelog version to use in the release notes. It still pulls release notes from patches associated with the milestone as well, in order to provide attribution and provide additional insight into the changes associated with the release.

### Changed

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- Nothing.
19 changes: 16 additions & 3 deletions bin/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
use Laminas\AutomaticReleases\Application\Command\CreateMergeUpPullRequest;
use Laminas\AutomaticReleases\Application\Command\ReleaseCommand;
use Laminas\AutomaticReleases\Application\Command\SwitchDefaultBranchToNextMinor;
use Laminas\AutomaticReleases\Changelog\CommitReleaseChangelogViaKeepAChangelog;
use Laminas\AutomaticReleases\Environment\EnvironmentVariables;
use Laminas\AutomaticReleases\Git\CommitFileViaConsole;
use Laminas\AutomaticReleases\Git\CreateTagViaConsole;
use Laminas\AutomaticReleases\Git\FetchAndSetCurrentUserByReplacingCurrentOriginRemote;
use Laminas\AutomaticReleases\Git\GetMergeTargetCandidateBranchesFromRemoteBranches;
Expand All @@ -21,10 +23,13 @@
use Laminas\AutomaticReleases\Github\Api\V3\CreatePullRequestThroughApiCall;
use Laminas\AutomaticReleases\Github\Api\V3\CreateReleaseThroughApiCall;
use Laminas\AutomaticReleases\Github\Api\V3\SetDefaultBranchThroughApiCall;
use Laminas\AutomaticReleases\Github\ConcatenateMultipleReleaseTexts;
use Laminas\AutomaticReleases\Github\CreateReleaseTextThroughChangelog;
use Laminas\AutomaticReleases\Github\CreateReleaseTextViaKeepAChangelog;
use Laminas\AutomaticReleases\Github\Event\Factory\LoadCurrentGithubEventFromGithubActionPath;
use Laminas\AutomaticReleases\Github\JwageGenerateChangelog;
use Laminas\AutomaticReleases\Gpg\ImportGpgKeyFromStringViaTemporaryFile;
use Lcobucci\Clock\SystemClock;
use PackageVersions\Versions;
use Symfony\Component\Console\Application;

Expand Down Expand Up @@ -56,17 +61,24 @@ static function (int $errorCode, string $message = '', string $file = '', int $l
$httpClient,
$githubToken
));
$createReleaseText = new CreateReleaseTextThroughChangelog(JwageGenerateChangelog::create(
$commit = new CommitFileViaConsole();
$push = new PushViaConsole();
$commitChangelog = new CommitReleaseChangelogViaKeepAChangelog(new SystemClock(), $commit, $push);
$createCommitText = new CreateReleaseTextThroughChangelog(JwageGenerateChangelog::create(
$makeRequests,
$httpClient
));
$push = new PushViaConsole();
$createReleaseText = new ConcatenateMultipleReleaseTexts([
new CreateReleaseTextViaKeepAChangelog(),
$createCommitText,
]);
$createRelease = new CreateReleaseThroughApiCall(
$makeRequests,
$httpClient,
$githubToken
);

/** @psalm-suppress DeprecatedClass */
$application = new Application(Versions::ROOT_PACKAGE_NAME, Versions::getVersion('laminas/automatic-releases'));

$application->addCommands([
Expand All @@ -76,6 +88,7 @@ static function (int $errorCode, string $message = '', string $file = '', int $l
$fetch,
$getCandidateBranches,
$getMilestone,
$commitChangelog,
$createReleaseText,
new CreateTagViaConsole(),
$push,
Expand All @@ -87,7 +100,7 @@ static function (int $errorCode, string $message = '', string $file = '', int $l
$fetch,
$getCandidateBranches,
$getMilestone,
$createReleaseText,
$createCommitText,
$push,
new CreatePullRequestThroughApiCall(
$makeRequests,
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
},
"require": {
"php": "^7.4.7",
"composer/package-versions-deprecated": "^1.10.99",
"jwage/changelog-generator": "^1.2.1",
"laminas/laminas-diactoros": "^2.3.1",
"ocramius/package-versions": "^1.9",
"lcobucci/clock": "^1.3",
"phly/keep-a-changelog": "^2.8",
"php-http/curl-client": "^2.1.0",
"php-http/discovery": "^1.9.1",
"php-http/httplug": "^2.1.0",
Expand Down
Loading