ci: implement release workflows (#113)

This commit is contained in:
shadcn
2023-03-08 12:55:10 +04:00
committed by GitHub
parent 9cee5cd83e
commit 2478e664ad
6 changed files with 226 additions and 0 deletions

21
.github/version-script-beta.js vendored Normal file
View File

@@ -0,0 +1,21 @@
// ORIGINALLY FROM CLOUDFLARE WRANGLER:
// https://github.com/cloudflare/wrangler2/blob/main/.github/version-script.js
import { exec } from "child_process"
import fs from "fs"
const pkgJsonPath = "cli/package.json"
try {
const pkg = JSON.parse(fs.readFileSync(pkgJsonPath))
exec("git rev-parse --short HEAD", (err, stdout) => {
if (err) {
console.log(err)
process.exit(1)
}
pkg.version = "0.0.0-beta." + stdout.trim()
fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, "\t") + "\n")
})
} catch (error) {
console.error(error)
process.exit(1)
}