diff --git a/jenkins_jobs.groovy b/jenkins_jobs.groovy index 92e593ead3..1654795ee5 100644 --- a/jenkins_jobs.groovy +++ b/jenkins_jobs.groovy @@ -1,20 +1,41 @@ // Jenkins build jobs for Yarn // https://build.dan.cx/view/Yarn/ -/** - * Trigger that fires when a new stable Yarn version is released - * This could probably be smarter in the future (eg. handle it using a webhook - * rather than polling the version number) - */ -def yarnStableVersionChange = { - triggerContext -> triggerContext.with { - urlTrigger { - cron 'H/15 * * * *' - url('https://yarnpkg.com/latest-version') { - inspection 'change' +job('yarn-version') { + description 'Updates the version number on the Yarn website' + label 'linux' + authenticationToken "${YARN_VERSION_KEY}" + scm { + git { + branch 'master' + remote { + github 'yarnpkg/website', 'ssh' + } + extensions { + // Required so we can commit to master + // http://stackoverflow.com/a/29786580/210370 + localBranch 'master' } } } + parameters { + stringParam 'YARN_VERSION' + booleanParam 'YARN_RC' + } + steps { + shell ''' + ./scripts/set-version.sh + git commit -m "Automated upgrade to Yarn $YARN_VERSION" _config.yml + ''' + } + publishers { + git { + branch 'origin', 'master' + pushOnlyIfSuccess + } + gitHubIssueNotifier { + } + } } matrixJob('yarn-e2e') { @@ -51,7 +72,7 @@ job('yarn-chocolatey') { github 'yarnpkg/yarn', 'master' } triggers { - yarnStableVersionChange delegate + upstream 'yarn-version' } steps { powerShell '.\\scripts\\build-chocolatey.ps1 -Publish' @@ -70,7 +91,7 @@ job('yarn-homebrew') { github 'yarnpkg/yarn', 'master' } triggers { - yarnStableVersionChange delegate + upstream 'yarn-version' } steps { shell './scripts/update-homebrew.sh'