mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
ci: publish with multiple tags instead of using dist-tag
npm dist-tag add command is broken, so publish package multiple times with different tags directly instead
This commit is contained in:
parent
0759696ec0
commit
8e33ac052b
1 changed files with 14 additions and 16 deletions
|
|
@ -36,26 +36,24 @@ await Bun.file(`./dist/${pkg.name}/package.json`).write(
|
|||
),
|
||||
)
|
||||
|
||||
const tags = [Script.channel]
|
||||
if (!Script.preview) {
|
||||
const major = Script.version.split(".")[0]
|
||||
tags.push(`latest-${major}`)
|
||||
}
|
||||
|
||||
const tasks = Object.entries(binaries).map(async ([name]) => {
|
||||
try {
|
||||
if (process.platform !== "win32") {
|
||||
await $`chmod 755 -R .`.cwd(`./dist/${name}`)
|
||||
}
|
||||
await $`bun pm pack`.cwd(`./dist/${name}`)
|
||||
await $`npm publish *.tgz --access public --tag ${Script.channel}`.cwd(`./dist/${name}`)
|
||||
} finally {
|
||||
if (process.platform !== "win32") {
|
||||
await $`chmod 755 -R .`.cwd(`./dist/${name}`)
|
||||
}
|
||||
await $`bun pm pack`.cwd(`./dist/${name}`)
|
||||
for (const tag of tags) {
|
||||
await $`npm publish *.tgz --access public --tag ${tag}`.cwd(`./dist/${name}`)
|
||||
}
|
||||
})
|
||||
await Promise.all(tasks)
|
||||
await $`cd ./dist/${pkg.name} && bun pm pack && npm publish *.tgz --access public --tag ${Script.channel}`
|
||||
|
||||
if (!Script.preview) {
|
||||
const major = Script.version.split(".")[0]
|
||||
const majorTag = `latest-${major}`
|
||||
for (const [name] of Object.entries(binaries)) {
|
||||
await $`cd dist/${name} && npm dist-tag add ${name}@${Script.version} ${majorTag}`
|
||||
}
|
||||
await $`cd ./dist/${pkg.name} && npm dist-tag add ${pkg.name}-ai@${Script.version} ${majorTag}`
|
||||
for (const tag of tags) {
|
||||
await $`cd ./dist/${pkg.name} && bun pm pack && npm publish *.tgz --access public --tag ${tag}`
|
||||
}
|
||||
|
||||
if (!Script.preview) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue