-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { $ } from "bun"; | ||
import { execaCommand } from "execa"; | ||
import consola from "consola"; | ||
|
||
consola.info("Starting release process"); | ||
|
||
try { | ||
consola.log("Trying to publish"); | ||
await execaCommand("pnpm publish --no-git-checks", { | ||
shell: true, | ||
all: true, | ||
}); | ||
consola.success("Published successfully"); | ||
|
||
consola.log("Trying to push tags..."); | ||
await $`git push --follow-tags`; | ||
consola.success("tags pushed successfully"); | ||
} catch (error) { | ||
if (error instanceof Error) { | ||
if ( | ||
error.message.includes( | ||
"You cannot publish over the previously published versions", | ||
) | ||
) { | ||
console.info("Version already published, skipping..."); | ||
process.exit(0); | ||
} else { | ||
consola.error("Something went wrong", error.message); | ||
process.exit(1); | ||
} | ||
} else { | ||
consola.error("Unknown error", error); | ||
process.exit(1); | ||
} | ||
} | ||
|
||
// const a = await $`git`.text(); | ||
|
||
// console.log(a); |