1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Update release guide and fix release script (#7276)

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2023-03-03 06:08:05 -08:00 committed by GitHub
parent 15f614942d
commit f92da1796e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 6 deletions

View File

@ -11,9 +11,12 @@ All releases will be made by creating a PR which bumps the version field in the
## Steps
1. If you are making a minor or major release (or prereleases for one) make sure you are on the `master` branch.
1. If you are making a minor or major release (or prereleases of one) make sure you are on the `master` branch.
1. If you are making a patch release (or a prerelease for one) make sure you are on the `release/v<MAJOR>.<MINOR>` branch.
1. Run `npm run create-release-pr <release-type>`. If you are making a subsequent prerelease release, provide the `--check-commits` flag.
1. If you are checking the commits, type `y<ENTER>` to pick a commit, and `n<ENTER>` to skip it. You will want to skip the commits that were part of previous prerelease releases.
1. Run `npm run create-release-pr`.
1. Pick the PRs that you want to include in this release using the keys listed.
1. Once the PR is created, approved, and then merged the `Release Open Lens` workflow will create a tag and release for you.
1. If you are making a major or minor release, create a `release/v<MAJOR>.<MINOR>` branch and push it to `origin` so that future patch releases can be made from it.
1. If you released a major or minor version, create a new patch milestone and move all bug issues to that milestone and all enhancement issues to the next minor milestone.
1. If you released a patch version, create a new patch milestone for the next patch version and move all the issues and PRs (open or closed) that weren't included in the current release to that milestone.
1. Close the milestone related to the release that was just made (if not a prerelease release).

View File

@ -145,6 +145,14 @@ function formatSemverForMilestone(version: SemVer): string {
return `${version.major}.${version.minor}.${version.patch}`;
}
function formatVersionForPickingPrs(version: SemVer): string {
if (version.prerelease.length > 0) {
return `${version.major}.${version.minor}.${version.patch}`;
}
return `${version.major}.${version.minor}.${version.patch+1}`;
}
async function createReleaseBranchAndCommit(prBase: string, version: SemVer, prBody: string): Promise<void> {
const prBranch = `release/v${version.format()}`;
@ -182,9 +190,10 @@ function sortExtendedGithubPrData(left: ExtendedGithubPrData, right: ExtendedGit
return -1;
}
async function getRelevantPRs(milestone: string, previousReleasedVersion: string): Promise<ExtendedGithubPrData[]> {
async function getRelevantPRs(previousReleasedVersion: string): Promise<ExtendedGithubPrData[]> {
console.log("retrieving previous 200 PRs...");
const milestone = formatVersionForPickingPrs(await getCurrentVersionOfSubPackage("core"));
const getMergedPrsArgs = [
"gh",
"pr",
@ -326,8 +335,7 @@ async function createRelease(): Promise<void> {
await bumpPackageVersions();
}
const prMilestone = formatSemverForMilestone(await getCurrentVersionOfSubPackage("core"));
const relevantPrs = await getRelevantPRs(prMilestone, previousReleasedVersion);
const relevantPrs = await getRelevantPRs(previousReleasedVersion);
const selectedPrs = await pickRelevantPrs(relevantPrs, isMasterBranch);
const prBody = formatChangelog(previousReleasedVersion, selectedPrs);