c1fe8ec99a
this PR puts sync stuff in the bemo worker, and sets up a temporary dev-only page in dotcom for testing bemo stuff ### Change type - [ ] `bugfix` - [ ] `improvement` - [x] `feature` - [ ] `api` - [ ] `other` ### Test plan 1. Create a shape... 2. - [ ] Unit tests - [ ] End to end tests ### Release notes - Fixed a bug with...
29 lines
1 KiB
TypeScript
29 lines
1 KiB
TypeScript
import { appendFileSync } from 'fs'
|
|
import { exec } from './lib/exec'
|
|
import { getLatestVersion, publish, publishProductionDocsAndExamples } from './lib/publishing'
|
|
import { uploadStaticAssets } from './upload-static-assets'
|
|
|
|
// This expects the package.json files to be in the correct state.
|
|
// You might want to run this locally after a failed publish attempt on CI.
|
|
// Or if you need to hotfix a package it might be desirable to run this.
|
|
|
|
// Generate a npm automation token and run this with the NPM_TOKEN env var set.
|
|
async function main() {
|
|
const latestVersionInBranch = await getLatestVersion()
|
|
const latestVersionOnNpm = (await exec('npm', ['show', 'tldraw', 'version'])).trim()
|
|
|
|
const isLatestVersion = latestVersionInBranch.format() === latestVersionOnNpm
|
|
if (process.env.GITHUB_OUTPUT) {
|
|
appendFileSync(process.env.GITHUB_OUTPUT, `is_latest_version=${isLatestVersion}\n`)
|
|
}
|
|
|
|
await uploadStaticAssets(latestVersionInBranch.version)
|
|
|
|
await publish()
|
|
|
|
if (isLatestVersion) {
|
|
await publishProductionDocsAndExamples()
|
|
}
|
|
}
|
|
|
|
main()
|