fix tag command

This commit is contained in:
phips28 2019-10-26 21:53:54 +02:00
parent 7be093300e
commit 9cbd6cfcc2
1 changed files with 2 additions and 2 deletions

View File

@ -33,14 +33,14 @@ Toolkit.run(async tools => {
await tools.runInWorkspace('npm', await tools.runInWorkspace('npm',
['version', '--allow-same-version=true', '--git-tag-version=false', current]) ['version', '--allow-same-version=true', '--git-tag-version=false', current])
console.log('current:', current, '/', 'version:', version) console.log('current:', current, '/', 'version:', version)
const newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString() const newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString().trim()
console.log('new version:', newVersion) console.log('new version:', newVersion)
await tools.runInWorkspace('git', ['commit', '-a', '-m', `"ci: ${commitMessage} ${newVersion}"`]) await tools.runInWorkspace('git', ['commit', '-a', '-m', `"ci: ${commitMessage} ${newVersion}"`])
const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git` const remoteRepo = `https://${process.env.GITHUB_ACTOR}:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git`
console.log('remoteRepo:', remoteRepo) console.log('remoteRepo:', remoteRepo)
await tools.runInWorkspace('git', ['tag', `-a "${newVersion}"`]) await tools.runInWorkspace('git', ['tag', '-a', newVersion])
await tools.runInWorkspace('git', ['push', `"${remoteRepo}"`, '--follow-tags']) await tools.runInWorkspace('git', ['push', `"${remoteRepo}"`, '--follow-tags'])
await tools.runInWorkspace('git', ['push', `"${remoteRepo}"`, '--tags']) await tools.runInWorkspace('git', ['push', `"${remoteRepo}"`, '--tags'])
} catch (e) { } catch (e) {