|
1 |
| -import crypto from 'node:crypto' |
2 |
| -import fs from 'node:fs/promises' |
3 | 1 | import { Octokit } from '@octokit/rest'
|
4 | 2 | import { generateChangelog, inferNextVersion } from '@radashi-org/changelog'
|
5 | 3 | import { installDeployKey } from '@radashi-org/common/installDeployKey.ts'
|
6 | 4 | import { execa } from 'execa'
|
7 | 5 | import { green } from 'kleur/colors'
|
| 6 | +import crypto from 'node:crypto' |
| 7 | +import fs from 'node:fs/promises' |
| 8 | +import { supabase } from 'radashi-db/supabase.ts' |
8 | 9 | import { sift } from 'radashi/array/sift.ts'
|
9 | 10 | import { dedent } from 'radashi/string/dedent.ts'
|
10 | 11 | import { glob } from 'tinyglobby'
|
@@ -90,6 +91,19 @@ export async function publishVersion(args: {
|
90 | 91 | log(`🟢 Version ${newVersion} is available`)
|
91 | 92 | }
|
92 | 93 |
|
| 94 | + // Check if Supabase database is reachable |
| 95 | + try { |
| 96 | + const { error } = await supabase.from('meta').select('id').limit(1) |
| 97 | + if (error) { |
| 98 | + log('🚫 Supabase database is not reachable:', error) |
| 99 | + process.exit(1) |
| 100 | + } |
| 101 | + log('🟢 Supabase database is reachable') |
| 102 | + } catch (error) { |
| 103 | + log('🚫 Error connecting to Supabase:', error) |
| 104 | + process.exit(1) |
| 105 | + } |
| 106 | + |
93 | 107 | // Find all commits after this tag with a PR number in the message.
|
94 | 108 | const latestTag = args.tag
|
95 | 109 | ? await execa('git', ['describe', '--tags', '--abbrev=0']).then(
|
|
0 commit comments