chore: refactor the release script

This commit is contained in:
ayo 2026-07-03 09:16:32 +02:00
parent 2038badb13
commit 21bfce4c04

View file

@ -3,9 +3,10 @@ import { simpleGit } from 'simple-git'
const git = simpleGit()
const hash = await git.revparse(['main'])
const remote = 'gh'
console.log('Fetch remote gh repo')
await git.fetch('gh')
await git.fetch(remote)
console.log('Checkout release branch')
await git.checkout(['-b', 'release', '--track', 'gh/release'])
@ -14,7 +15,7 @@ console.log(`Reset to main branch (${hash})`)
await git.reset(['--hard', hash])
console.log('Push to release branch')
await git.push(['--force', 'gh'])
await git.push(['--force', remote])
console.log('Checkout main branch')
await git.checkout('main')
@ -25,5 +26,5 @@ await git.branch(['-D', 'release'])
// TODO: handle multiple remotes with a data structure
console.log('Push tags')
await git.push(['--tags'])
await git.push(['--tags', 'gh'])
await git.push(['--tags', remote])
await git.push(['--tags', 'sh'])