Skip to content

Commit

Permalink
chore: fix publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Jun 17, 2020
1 parent e4205f1 commit ef00a41
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"prisma": {
"version": "41f8d9863f1e0f6bfdb24def858e520f99bc2479",
"prismaCommit": "a6b2e963b5eb83261175980594d2a3871044de1e"
"prismaCommit": "e4205f1367ddc8d609983d2b4b8f05f7fff20bc4"
},
"devDependencies": {
"@apexearth/copy": "1.4.5",
Expand Down
12 changes: 11 additions & 1 deletion src/scripts/ci/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,12 @@ export function getPublishOrder(packages: Packages): string[][] {
return topo(dag)
}

function zeroOutPatch(version: string): string {
const parts = version.split('.')
parts[parts.length - 1] = '0'
return parts.join('.')
}

/**
* Takes the max dev version + 1
* For now supporting 2.Y.Z-dev.#
Expand All @@ -302,7 +308,11 @@ export function getPublishOrder(packages: Packages): string[][] {
async function getNewDevVersion(packages: Packages): Promise<string> {
const before = Date.now()
console.log('\nCalculating new dev version...')
const nextStable = await getNextMinorStable()
// Why are we calling zeroOutPatch?
// Because here we're only interested in the 2.5.0 <- the next minor stable version
// If the current version would be 2.4.7, we would end up with 2.5.7
const nextStable = zeroOutPatch(await getNextMinorStable())

console.log(`Next minor stable: ${nextStable}`)

const versions = await getAllVersions(packages, 'dev', nextStable + '-dev')
Expand Down

0 comments on commit ef00a41

Please sign in to comment.