mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-21 21:25:11 +00:00
chore: bump edge version based on commits (#19397)
This commit is contained in:
parent
e3fe706625
commit
f3c82d5797
@ -1,6 +1,8 @@
|
|||||||
import { execSync } from 'node:child_process'
|
import { execSync } from 'node:child_process'
|
||||||
import { $fetch } from 'ofetch'
|
import { $fetch } from 'ofetch'
|
||||||
import { inc } from 'semver'
|
import { inc } from 'semver'
|
||||||
|
import { getGitDiff, determineSemverChange, loadChangelogConfig, parseCommits } from 'changelogen'
|
||||||
|
import { execaSync } from 'execa'
|
||||||
import { loadWorkspace } from './_utils'
|
import { loadWorkspace } from './_utils'
|
||||||
|
|
||||||
async function main () {
|
async function main () {
|
||||||
@ -14,9 +16,15 @@ async function main () {
|
|||||||
const latestNitro = nitroInfo['dist-tags'].latest
|
const latestNitro = nitroInfo['dist-tags'].latest
|
||||||
nuxtPkg.data.dependencies.nitropack = `npm:nitropack-edge@^${latestNitro}`
|
nuxtPkg.data.dependencies.nitropack = `npm:nitropack-edge@^${latestNitro}`
|
||||||
|
|
||||||
|
const config = await loadChangelogConfig(process.cwd())
|
||||||
|
|
||||||
|
const latestTag = execaSync('git', ['describe', '--tags', '--abbrev=0']).stdout
|
||||||
|
|
||||||
|
const commits = await getGitDiff(latestTag)
|
||||||
|
const bumpType = determineSemverChange(parseCommits(commits, config), config)
|
||||||
|
|
||||||
for (const pkg of workspace.packages.filter(p => !p.data.private)) {
|
for (const pkg of workspace.packages.filter(p => !p.data.private)) {
|
||||||
// TODO: Set release type based on changelog after 3.0.0
|
const newVersion = inc(pkg.data.version, bumpType || 'prerelease')
|
||||||
const newVersion = inc(pkg.data.version, 'prerelease', 'rc')
|
|
||||||
workspace.setVersion(pkg.data.name, `${newVersion}-${date}.${commit}`)
|
workspace.setVersion(pkg.data.name, `${newVersion}-${date}.${commit}`)
|
||||||
const newname = pkg.data.name === 'nuxt' ? 'nuxt3' : (pkg.data.name + '-edge')
|
const newname = pkg.data.name === 'nuxt' ? 'nuxt3' : (pkg.data.name + '-edge')
|
||||||
workspace.rename(pkg.data.name, newname)
|
workspace.rename(pkg.data.name, newname)
|
||||||
|
Loading…
Reference in New Issue
Block a user