Skip to content

Commit

Permalink
ci(publish): add even more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
hasparus committed Sep 26, 2023
1 parent e81549a commit 8b3ebe5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/publish-to-npm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import packageJson from '../package.json' assert { type: 'json' }

const version = getVersion(packageJson)
const branch = exec('git branch --show-current', { stdio: 'pipe' })[0].trim()
console.log('Current branch:', branch)

await setVersions({ version })

if (checkStatus() === 'clear') process.exit(0)

commitAndPush({ version })
commitAndPush({ version, branch })
publishToNPM({
tag:
branch === PRODUCTION_BRANCH
Expand Down Expand Up @@ -78,14 +79,14 @@ function getVersion(packageJson) {
}

/**
* @param {{ version: string }} params
* @param {{ version: string, branch: string }} params
*/
function commitAndPush({ version }) {
function commitAndPush({ version, branch }) {
exec(`
git config user.name 'Piotr Monwid-Olechnowicz'
git config user.email '[email protected]'
git commit -am "Bump versions to: ${version} [skip ci]"
git push
git push origin HEAD:${branch}
`)
}

Expand Down

0 comments on commit 8b3ebe5

Please sign in to comment.