Added support (and outputs) for semver builds and prereleases.

This commit is contained in:
Corey Butler
2020-04-04 18:28:01 -05:00
parent 155e0c9674
commit 3c94e12b38
5 changed files with 34 additions and 14 deletions

View File

@ -42,6 +42,14 @@ export default class Tag {
return this._ref || ''
}
get prerelease () {
return /([0-9\.]{5}(-[\w\.0-9]+)?)/i.test(this.version)
}
get build () {
return /([0-9\.]{5}(\+[\w\.0-9]+)?)/i.test(this.version)
}
async getMessage () {
if (this._message !== null) {
return this._message

View File

@ -54,6 +54,8 @@ async function run () {
core.warning(`Attempting to create ${tag.name} tag.`)
core.setOutput('tagrequested', tag.name)
core.setOutput('prerelease', tag.prerelease ? 'yes' : 'no')
core.setOutput('build', tag.build ? 'yes' : 'no')
// Check for existance of tag and abort (short circuit) if it already exists.
if (await tag.exists()) {