Use "release" event instead of "push"

This commit is contained in:
Nicolò Ribaudo 2019-07-20 14:30:33 +02:00 committed by GitHub
parent a0cb7b1ab1
commit 718017d896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

46
.github/main.workflow vendored
View File

@ -1,13 +1,14 @@
workflow "Release" { workflow "Release" {
on = "push"
resolves = [ resolves = [
"Trigger GitHub release", "Trigger GitHub release",
"Is version tag",
] ]
on = "release"
}
# GitHub actions are too slow for this, it takes more than 15 mins. action "Is version tag" {
# Publishing to npm from GH actions is a cool idea, but it's a lot faster to uses = "actions/bin/filter@0dbb077f64d0ec1068a644d25c71b1db66148a24"
# publish locally. args = "tag v*"
# "Publish to npm",
} }
action "Trigger GitHub release" { action "Trigger GitHub release" {
@ -17,45 +18,14 @@ action "Trigger GitHub release" {
COMMIT_AUTHOR_NAME = "Babel Bot" COMMIT_AUTHOR_NAME = "Babel Bot"
COMMIT_AUTHOR_EMAIL = "babel-bot@users.noreply.github.com" COMMIT_AUTHOR_EMAIL = "babel-bot@users.noreply.github.com"
} }
needs = ["Create release tag"]
}
action "Publish to npm" {
uses = "docker://node:10"
secrets = ["NPM_TOKEN"]
runs = "make"
args = "publish-ci"
env = {
CI = "true"
}
needs = ["Create release tag"]
}
# When GitHub Actions will support the "release" event for public
# repositories, we won't need this checks anymore.
action "Create release tag" {
uses = "./.github/actions/create-release-tag"
needs = [ needs = [
"Is version commit", "Is version tag",
"On master branch",
] ]
} }
action "Is version commit" {
uses = "./.github/actions/filter-commit-message"
# This regex is run using "grep -P".
# The (-\\S+) part is for 7.0.0-beta.1 releases.
args = "^v(\\d+\\.){2}\\d+(-\\S+)?$"
}
action "On master branch" {
uses = "actions/bin/filter@master"
args = "branch master"
}
workflow "Welcome comment" { workflow "Welcome comment" {
on = "issues"
resolves = ["Create Comment"] resolves = ["Create Comment"]
on = "issues"
} }
action "Is action 'opened'" { action "Is action 'opened'" {