Skip to content
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

Exit Pre Mode (main) #536

Merged
merged 2 commits into from
Jul 29, 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
5 changes: 5 additions & 0 deletions .changeset/light-readers-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@osdk/tool.release": minor
---

Properly generate titles and body copy after exiting pre mode
2 changes: 1 addition & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mode": "pre",
"mode": "exit",
"tag": "beta",
"initialVersions": {
"@osdk/examples.docs.example": "0.0.1",
Expand Down
10 changes: 7 additions & 3 deletions packages/tool.release/src/runVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,13 @@ export async function runVersion({
} else {
// project with `commit: true` setting could have already committed files
if (!(await gitUtils.checkIfClean())) {
const finalCommitMessage = `${commitMessage}${
!!preState ? ` (${preState.tag})` : ""
}`;
let finalCommitMessage = commitMessage;
if (preState && preState.mode === "pre") {
finalCommitMessage += ` (${preState.tag})`;
} else if (preState && preState.mode === "exit") {
finalCommitMessage += ` (exit ${preState.tag})`;
}

await gitUtils.commitAll(finalCommitMessage);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/tool.release/src/util/getVersionPrBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export async function getVersionPrBody({
`This PR was opened by automation. When you're ready to do a release, you can merge this and publish to npm yourself.
If you're not ready to do a release yet, that's fine, whenever you re-run the release script in ${branch}, this PR will be updated.
`;
const messagePreState = !!preState
const messagePreState = preState && preState.mode === "pre"
? `⚠️⚠️⚠️⚠️⚠️⚠️

\`${branch}\` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run \`changeset pre exit\` on \`${branch}\`.
Expand Down