Skip to content

Commit

Permalink
Exit Pre Mode (main) (#536)
Browse files Browse the repository at this point in the history
* Exit pre-mode

* Fix commit and pr text for release
  • Loading branch information
ericanderson authored Jul 29, 2024
1 parent f7dde01 commit 0e931a4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
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

0 comments on commit 0e931a4

Please sign in to comment.