Merge pull request #19346 from atom/dw-fix-draft-automation

Re-enable draft release automation for builds on release branches
This commit is contained in:
Jason Rudolph 2019-05-21 14:27:38 -04:00 committed by GitHub
commit 0ab0e6595d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 13 deletions

View File

@ -62,19 +62,17 @@ jobs:
downloadType: 'specific'
displayName: Download Release Artifacts
# NOTE: This has been disabled until one final issue has been resolved
# around setting the SHA on GitHub releases.
# - script: |
# node $(Build.SourcesDirectory)\script\vsts\upload-artifacts.js --create-github-release --assets-path "$(System.ArtifactsDirectory)" --linux-repo-name "atom-staging"
# env:
# GITHUB_TOKEN: $(GITHUB_TOKEN)
# ATOM_RELEASE_VERSION: $(ReleaseVersion)
# ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)
# ATOM_RELEASES_S3_SECRET: $(ATOM_RELEASES_S3_SECRET)
# ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
# PACKAGE_CLOUD_API_KEY: $(PACKAGE_CLOUD_API_KEY)
# displayName: Create Draft Release
# condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
- script: |
node $(Build.SourcesDirectory)\script\vsts\upload-artifacts.js --create-github-release --assets-path "$(System.ArtifactsDirectory)" --linux-repo-name "atom-staging"
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
ATOM_RELEASE_VERSION: $(ReleaseVersion)
ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)
ATOM_RELEASES_S3_SECRET: $(ATOM_RELEASES_S3_SECRET)
ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
PACKAGE_CLOUD_API_KEY: $(PACKAGE_CLOUD_API_KEY)
displayName: Create Draft Release
condition: and(succeeded(), eq(variables['Atom.AutoDraftRelease'], 'true'), eq(variables['IsReleaseBranch'], 'true'))
- script: |
node $(Build.SourcesDirectory)\script\vsts\upload-artifacts.js --assets-path "$(System.ArtifactsDirectory)" --s3-path "vsts-artifacts/$(Build.BuildId)/"

View File

@ -4,6 +4,7 @@ const fs = require('fs')
const os = require('os')
const path = require('path')
const glob = require('glob')
const spawnSync = require('../lib/spawn-sync')
const publishRelease = require('publish-release')
const releaseNotes = require('./lib/release-notes')
const uploadToS3 = require('./lib/upload-to-s3')
@ -93,6 +94,11 @@ async function uploadArtifacts () {
console.log(`New release notes:\n\n${newReleaseNotes}`)
const releaseSha =
!isNightlyRelease
? spawnSync('git', ['rev-parse', 'HEAD']).stdout.toString().trimEnd()
: 'master' // Nightly tags are created in atom/atom-nightly-releases so the SHA is irrelevant
console.log(`Creating GitHub release v${releaseVersion}`)
const release =
await publishReleaseAsync({
@ -101,6 +107,7 @@ async function uploadArtifacts () {
repo: !isNightlyRelease ? 'atom' : 'atom-nightly-releases',
name: CONFIG.computedAppVersion,
notes: newReleaseNotes,
target_commitish: releaseSha,
tag: `v${CONFIG.computedAppVersion}`,
draft: !isNightlyRelease,
prerelease: CONFIG.channel !== 'stable',