Skip to content

Commit

Permalink
Update documentation only after successful release
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Nov 26, 2023
1 parent 8f85f2d commit 8ae12b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 8 additions & 2 deletions scripts/postpublish.js
Expand Up @@ -3,7 +3,8 @@ import { env } from 'node:process';
import GitHub from 'github-api';
import semverPreRelease from 'semver/functions/prerelease.js';
import { cyan } from './colors.js';
import { CHANGELOG } from './release-constants.js';
import { runWithEcho } from './helpers.js';
import { CHANGELOG, DOCUMENTATION_BRANCH } from './release-constants.js';
import {
getCurrentCommitMessage,
getFirstChangelogEntry,
Expand Down Expand Up @@ -50,11 +51,16 @@ const includedPRs = await getIncludedPRs(
isPreRelease
);

const gitTag = getGitTag(newVersion);
if (changelogEntry) {
await createReleaseNotes(changelogEntry, getGitTag(newVersion));
await createReleaseNotes(changelogEntry, gitTag);
}
await postReleaseComments(includedPRs, issues, newVersion);

if (!isPreRelease) {
await runWithEcho('git', ['branch', DOCUMENTATION_BRANCH, '--force', gitTag]);
}

function createReleaseNotes(changelog, tag) {
return repo.createRelease({
body: changelog,
Expand Down
1 change: 0 additions & 1 deletion scripts/prepare-release.js
Expand Up @@ -224,7 +224,6 @@ async function commitChanges(newVersion, gitTag, isMainBranch) {
]);
await runWithEcho('git', ['commit', '-m', newVersion]);
await runWithEcho('git', ['tag', gitTag]);
isMainBranch && (await runWithEcho('git', ['branch', DOCUMENTATION_BRANCH, '--force', gitTag]));
}

function pushChanges(gitTag) {
Expand Down

0 comments on commit 8ae12b9

Please sign in to comment.