Skip to content
Merged
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
18 changes: 15 additions & 3 deletions scripts/release-canary.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
import { releaseVersion, releaseChangelog, releasePublish } from 'nx/release'
import { execSync } from 'child_process'
;(async () => {
const { workspaceVersion: canaryCheckWorkspaceVersion } = await releaseVersion({
verbose: true,
gitCommit: false,
stageChanges: false,
dryRun: true, // Just to check if there are any conventional commits that warrant a release
})

// If no version bump detected, exit early
if (!canaryCheckWorkspaceVersion || canaryCheckWorkspaceVersion === '0.0.0') {
console.log(
'ℹ️ No conventional commits found that warrant a release. Skipping canary release.'
)
process.exit(0)
}

const { workspaceVersion, projectsVersionData } = await releaseVersion({
verbose: true,
gitCommit: false,
Expand Down Expand Up @@ -63,8 +78,5 @@ import { execSync } from 'child_process'
console.log('⚠️ Continuing with release despite gotrue-js publish failure')
}

execSync('git stash')
console.log('✅ All changes stashed.')

process.exit(Object.values(publishResult).every((result) => result.code === 0) ? 0 : 1)
})()