ci
This commit is contained in:
parent
ebe6015db0
commit
52ef8dea3e
2 changed files with 20 additions and 5 deletions
|
|
@ -13,8 +13,14 @@ if (process.versions.bun !== expectedBunVersion) {
|
|||
throw new Error(`This script requires bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`)
|
||||
}
|
||||
|
||||
const CHANNEL = process.env["OPENCODE_CHANNEL"] ?? (await $`git branch --show-current`.text().then((x) => x.trim()))
|
||||
const CHANNEL = await (async () => {
|
||||
if (process.env["OPENCODE_CHANNEL"]) return process.env["OPENCODE_CHANNEL"]
|
||||
if (process.env["OPENCODE_BUMP"]) return "latest"
|
||||
if (!process.env["OPENCODE_VERSION"]?.startsWith("0.0.0-")) return "latest"
|
||||
return await $`git branch --show-current`.text().then((x) => x.trim())
|
||||
})()
|
||||
const IS_PREVIEW = CHANNEL !== "latest"
|
||||
|
||||
const VERSION = await (async () => {
|
||||
if (process.env["OPENCODE_VERSION"]) return process.env["OPENCODE_VERSION"]
|
||||
if (IS_PREVIEW) return `0.0.0-${CHANNEL}-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue