Skip to content

fix(scripts): remove skip bc from the changelog [skip-bc] #4100

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 3 commits into from
Nov 13, 2024
Merged
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: 2 additions & 1 deletion scripts/ci/codegen/createGitHubReleases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { Language } from '../../types.js';
import { cloneRepository } from '../utils.js';

import { resolve } from 'path';
import { stripCommitMessage } from '../../release/common.js';
import { commitStartRelease } from './text.js';

async function createGitHubRelease(lang: Language): Promise<void> {
Expand Down Expand Up @@ -55,7 +56,7 @@ async function createGitHubRelease(lang: Language): Promise<void> {
const content = `
# New ${isMajor ? '**major** ' : ''}version released!
## What's Changed
${changelog}
${stripCommitMessage(changelog)}

**Full Changelog**: ${repositoryLink}/compare/${previousVersion}...${newVersion}

Expand Down
4 changes: 4 additions & 0 deletions scripts/release/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ export function getGitAuthor(): { name: string; email: string } {
export async function writeJsonFile(ppath: string, data: Record<string, any>): Promise<void> {
await fsp.writeFile(ppath, JSON.stringify(data, null, 2).concat('\n'));
}

export function stripCommitMessage(message: string): string {
return message.replace(/ \[skip-bc\]/g, '').replace(/ \[skip-e2e\]/g, '');
}
6 changes: 3 additions & 3 deletions scripts/release/createReleasePR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
import { getPackageVersionDefault } from '../config.js';
import type { Language } from '../types.js';

import { getFileChanges, getLastReleasedTag } from './common.js';
import { getFileChanges, getLastReleasedTag, stripCommitMessage } from './common.js';
import TEXT from './text.js';
import type { Changelog, Commit, CommitType, ParsedCommit, Scope, Versions } from './types.js';
import { updateAPIVersions } from './updateAPIVersions.js';
Expand Down Expand Up @@ -202,7 +202,7 @@ export function decideReleaseStrategy({
console.log(`Deciding next version bump for ${lang}.`);

if (relevantCommits.length === 0) {
console.log(` > Skipping, no commits found for ${lang}.`);
console.log(` > Skipping, no commits found for ${lang}, staying on '${currentVersion}'.`);

versionsToPublish[lang] = { current: currentVersion };

Expand Down Expand Up @@ -383,7 +383,7 @@ export async function createReleasePR({

const changelogCommit = [
`[${validCommit.hash}](https://github.com/${OWNER}/${REPO}/commit/${validCommit.hash})`,
validCommit.message,
stripCommitMessage(validCommit.message),
validCommit.prNumber
? `([#${validCommit.prNumber}](https://github.com/${OWNER}/${REPO}/pull/${validCommit.prNumber}))`
: undefined,
Expand Down
6 changes: 4 additions & 2 deletions scripts/release/updateAPIVersions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ import type { Changelog, Versions } from './types.js';

async function updateConfigFiles(versionsToRelease: Versions): Promise<void> {
// update the other versions in clients.config.json
for (const lang of Object.keys(versionsToRelease)) {
clientsConfig[lang].packageVersion = versionsToRelease[lang].next;
for (const lang of Object.keys(versionsToRelease) as Language[]) {
if (versionsToRelease[lang]?.next) {
clientsConfig[lang].packageVersion = versionsToRelease[lang].next;
}
}

await writeJsonFile(toAbsolutePath('config/clients.config.json'), clientsConfig);
Expand Down
Loading