chore: update release script
This commit is contained in:
parent
225c1b515a
commit
7d7bd8b55b
1 changed files with 13 additions and 11 deletions
|
|
@ -1,23 +1,25 @@
|
||||||
// @ts-check
|
// @ts-check
|
||||||
// forked from https://github.com/elk-zone/elk/blob/main/scripts/release.ts
|
// forked from https://github.com/elk-zone/elk/blob/main/scripts/release.ts
|
||||||
|
|
||||||
import Git from 'simple-git'
|
import {simpleGit, } from 'simple-git'
|
||||||
|
|
||||||
|
|
||||||
const git = Git()
|
const git = simpleGit()
|
||||||
const upstream = 'gh'
|
|
||||||
|
|
||||||
const hash = await git.revparse(['main'])
|
const hash = await git.revparse(['main'])
|
||||||
|
|
||||||
console.log('Checkout release branch')
|
console.log('Fetch remote gh repo')
|
||||||
await git.fetch('gh')
|
await git.fetch('gh')
|
||||||
await git.checkout(`${upstream}/release`, {l})
|
|
||||||
|
|
||||||
console.log(`Reset to main branch (${hash})`)
|
console.log('Checkout release branch')
|
||||||
await git.reset(['--hard', hash])
|
//git checkout -b release --track gh/release
|
||||||
|
await git.checkout(['-b', 'release', '--track', 'gh/release'])
|
||||||
|
|
||||||
console.log('Push to release branch')
|
// console.log(`Reset to main branch (${hash})`)
|
||||||
await git.push(['--force'])
|
// await git.reset(['--hard', hash])
|
||||||
|
|
||||||
console.log('Checkout main branch')
|
// console.log('Push to release branch')
|
||||||
await git.checkout('main')
|
// await git.push(['--force'])
|
||||||
|
|
||||||
|
// console.log('Checkout main branch')
|
||||||
|
// await git.checkout('main')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue