-
Notifications
You must be signed in to change notification settings - Fork 30
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
1 parent
fcefc4a
commit 5e65f23
Showing
8 changed files
with
573 additions
and
33 deletions.
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,20 @@ | ||
name: Publish to JSR | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: '*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Publish to JSR | ||
env: | ||
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | ||
run: | | ||
pnpm install -C scripts/versions | ||
pnpm install -C scripts/radashi-db | ||
./scripts/versions/node_modules/.bin/tsx ./scripts/versions/ci-publish-jsr.ts |
This file was deleted.
Oops, something went wrong.
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,41 @@ | ||
import { execa } from 'execa' | ||
import fs from 'node:fs/promises' | ||
import { supabase } from 'radashi-db/supabase.js' | ||
|
||
main() | ||
|
||
async function main() { | ||
const versionResult = await supabase | ||
.from('meta') | ||
.select('value') | ||
.eq('id', 'latest_version') | ||
.limit(1) | ||
.single() | ||
|
||
if (versionResult.error) { | ||
console.error('Error fetching latest version:', versionResult.error) | ||
process.exit(1) | ||
} | ||
|
||
const { version, ref } = versionResult.data.value as { | ||
version: string | ||
ref: string | ||
} | ||
|
||
console.log('Publishing v%s using ref %s', version, ref) | ||
|
||
await execa('git', ['fetch', 'origin', ref], { stdio: 'inherit' }) | ||
await execa('git', ['checkout', ref], { stdio: 'inherit' }) | ||
|
||
const denoJson = { | ||
...JSON.parse(await fs.readFile('deno.json', 'utf8')), | ||
version, | ||
} | ||
|
||
await fs.writeFile('deno.json', JSON.stringify(denoJson, null, 2)) | ||
console.log('Updated version in deno.json') | ||
|
||
await execa('pnpm', ['dlx', 'jsr', 'publish', '--allow-dirty'], { | ||
stdio: 'inherit', | ||
}) | ||
} |
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,27 @@ | ||
import { supabase } from 'radashi-db/supabase.js' | ||
|
||
main() | ||
|
||
async function main() { | ||
const [version, ref] = process.argv.slice(2) | ||
const channel = version.match(/-(\w+)/)?.[1] ?? 'stable' | ||
|
||
const value = { version, ref } | ||
console.log('Updating with:', value) | ||
|
||
const { error: upsertError } = await supabase.from('meta').upsert([ | ||
{ | ||
id: 'latest_version', | ||
value, | ||
}, | ||
{ | ||
id: channel + '_version', | ||
value, | ||
}, | ||
]) | ||
|
||
if (upsertError) { | ||
console.error('Error upserting version data:', upsertError) | ||
process.exit(1) | ||
} | ||
} |
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,9 @@ | ||
{ | ||
"private": true, | ||
"type": "module", | ||
"dependencies": { | ||
"execa": "^9.3.0", | ||
"radashi-db": "link:../radashi-db", | ||
"tsx": "^4.17.0" | ||
} | ||
} |
Oops, something went wrong.