mirror of
https://github.com/atom/atom.git
synced 2026-02-11 15:14:59 -05:00
On release branches, we can't upload crash dumps because they will leak secret environment variables. So instead we will upload them to our S3 bucket with 'private' ACL. They can then be manually retrieved via the AWS CLI with our private credentials.
211 lines
8.2 KiB
YAML
211 lines
8.2 KiB
YAML
jobs:
|
|
- job: Windows
|
|
dependsOn: GetReleaseVersion
|
|
timeoutInMinutes: 180
|
|
strategy:
|
|
maxParallel: 2
|
|
matrix:
|
|
x64:
|
|
buildArch: x64
|
|
x86:
|
|
buildArch: x86
|
|
|
|
pool:
|
|
vmImage: vs2015-win2012r2 # needed for python 2.7 and gyp
|
|
|
|
variables:
|
|
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
|
|
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
|
|
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
|
|
|
|
steps:
|
|
- task: NodeTool@0
|
|
inputs:
|
|
versionSpec: 8.9.3
|
|
displayName: Install Node.js 8.9.3
|
|
|
|
- script: |
|
|
ECHO Installing npm-windows-upgrade
|
|
npm install --global --production npm-windows-upgrade
|
|
ECHO Upgrading npm
|
|
npm-windows-upgrade --no-spinner --no-prompt --npm-version 6.2.0
|
|
displayName: Install npm 6.2.0
|
|
|
|
- script: |
|
|
cd script\vsts
|
|
npm install
|
|
displayName: Install Windows build dependencies
|
|
|
|
- script: |
|
|
node script\vsts\windows-run.js script\bootstrap.cmd
|
|
env:
|
|
BUILD_ARCH: $(buildArch)
|
|
displayName: Bootstrap build environment
|
|
|
|
- script: node script\vsts\windows-run.js script\lint.cmd
|
|
env:
|
|
BUILD_ARCH: $(buildArch)
|
|
displayName: Run linter
|
|
|
|
- script: |
|
|
IF NOT EXIST C:\tmp MKDIR C:\tmp
|
|
SET SQUIRREL_TEMP=C:\tmp
|
|
IF [%IS_RELEASE_BRANCH%]==[true] (
|
|
ECHO Creating production artifacts for release branch %BUILD_SOURCEBRANCHNAME%
|
|
node script\vsts\windows-run.js script\build.cmd --code-sign --compress-artifacts --create-windows-installer
|
|
) ELSE (
|
|
IF [%IS_SIGNED_ZIP_BRANCH%]==[true] (
|
|
ECHO Creating signed CI artifacts for branch %BUILD_SOURCEBRANCHNAME%
|
|
node script\vsts\windows-run.js script\build.cmd --code-sign --compress-artifacts
|
|
) ELSE (
|
|
ECHO Pull request build, no code signing will be performed
|
|
node script\vsts\windows-run.js script\build.cmd --compress-artifacts
|
|
)
|
|
)
|
|
env:
|
|
GITHUB_TOKEN: $(GITHUB_TOKEN)
|
|
BUILD_ARCH: $(buildArch)
|
|
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
|
ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL)
|
|
ATOM_WIN_CODE_SIGNING_CERT_PASSWORD: $(ATOM_WIN_CODE_SIGNING_CERT_PASSWORD)
|
|
IS_RELEASE_BRANCH: $(IsReleaseBranch)
|
|
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
|
|
displayName: Build Atom
|
|
|
|
- script: node script\vsts\windows-run.js script\test.cmd
|
|
env:
|
|
CI: true
|
|
CI_PROVIDER: VSTS
|
|
ATOM_JASMINE_REPORTER: list
|
|
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)\junit
|
|
BUILD_ARCH: $(buildArch)
|
|
displayName: Run tests
|
|
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
|
|
|
|
- script: >
|
|
node script\vsts\windows-run.js script\postprocess-junit-results.cmd
|
|
--search-folder %TEST_JUNIT_XML_ROOT% --test-results-files "**/*.xml"
|
|
env:
|
|
TEST_JUNIT_XML_ROOT: $(Common.TestResultsDirectory)\junit
|
|
displayName: Post-process test results
|
|
condition: ne(variables['Atom.SkipTests'], 'true')
|
|
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testResultsFormat: JUnit
|
|
searchFolder: $(Common.TestResultsDirectory)\junit
|
|
testResultsFiles: "**/*.xml"
|
|
mergeTestResults: true
|
|
testRunTitle: Windows $(buildArch)
|
|
condition: ne(variables['Atom.SkipTests'], 'true')
|
|
|
|
- script: |
|
|
IF NOT EXIST "%ARTIFACT_STAGING_DIR%\crash-reports" MKDIR "%ARTIFACT_STAGING_DIR%\crash-reports"
|
|
IF EXIST "%Temp%\Atom Crashes" (
|
|
FOR %%a in ("%Temp%\Atom Crashes\*.dmp") DO XCOPY "%%a" "%ARTIFACT_STAGING_DIR%\crash-reports" /I
|
|
)
|
|
displayName: Stage crash reports
|
|
condition: failed()
|
|
env:
|
|
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.ArtifactStagingDirectory)/crash-reports
|
|
ArtifactName: crash-reports
|
|
displayName: Publish crash reports on non-release branch
|
|
condition: and(failed(), eq(variables['IsReleaseBranch'], 'false'))
|
|
|
|
- script: >
|
|
node $(Build.SourcesDirectory)\script\vsts\upload-crash-reports.js --crash-report-path "%ARTIFACT_STAGING_DIR%\crash-reports" --s3-path "vsts-artifacts/%BUILD_ID%/"
|
|
env:
|
|
ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)
|
|
ATOM_RELEASES_S3_SECRET: $(ATOM_RELEASES_S3_SECRET)
|
|
ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
|
|
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
|
|
BUILD_ID: $(Build.BuildId)
|
|
displayName: Upload crash reports to S3 on release branch
|
|
condition: and(failed(), ne(variables['ATOM_RELEASES_S3_KEY'], ''))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/atom-x64-windows.zip
|
|
ArtifactName: atom-x64-windows.zip
|
|
ArtifactType: Container
|
|
displayName: Upload atom-x64-windows.zip
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['buildArch'], 'x64'))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/AtomSetup-x64.exe
|
|
ArtifactName: AtomSetup-x64.exe
|
|
ArtifactType: Container
|
|
displayName: Upload AtomSetup-x64.exe
|
|
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/atom-x64-$(ReleaseVersion)-full.nupkg
|
|
ArtifactName: atom-x64-$(ReleaseVersion)-full.nupkg
|
|
ArtifactType: Container
|
|
displayName: Upload atom-x64-$(ReleaseVersion)-full.nupkg
|
|
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/atom-x64-$(ReleaseVersion)-delta.nupkg
|
|
ArtifactName: atom-x64-$(ReleaseVersion)-delta.nupkg
|
|
ArtifactType: Container
|
|
displayName: Upload atom-x64-$(ReleaseVersion)-delta.nupkg
|
|
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
|
|
continueOnError: true # Nightly builds don't produce delta packages yet, so don't fail the build
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/RELEASES-x64
|
|
ArtifactName: RELEASES-x64
|
|
ArtifactType: Container
|
|
displayName: Upload RELEASES-x64
|
|
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/atom-windows.zip
|
|
ArtifactName: atom-windows.zip
|
|
ArtifactType: Container
|
|
displayName: Upload atom-windows.zip
|
|
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['buildArch'], 'x86'))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/AtomSetup.exe
|
|
ArtifactName: AtomSetup.exe
|
|
ArtifactType: Container
|
|
displayName: Upload AtomSetup.exe
|
|
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/atom-$(ReleaseVersion)-full.nupkg
|
|
ArtifactName: atom-$(ReleaseVersion)-full.nupkg
|
|
ArtifactType: Container
|
|
displayName: Upload atom-$(ReleaseVersion)-full.nupkg
|
|
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/atom-$(ReleaseVersion)-delta.nupkg
|
|
ArtifactName: atom-$(ReleaseVersion)-delta.nupkg
|
|
ArtifactType: Container
|
|
displayName: Upload atom-$(ReleaseVersion)-delta.nupkg
|
|
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
|
|
continueOnError: true # Nightly builds don't produce delta packages yet, so don't fail the build
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
inputs:
|
|
PathtoPublish: $(Build.SourcesDirectory)/out/RELEASES
|
|
ArtifactName: RELEASES
|
|
ArtifactType: Container
|
|
displayName: Upload RELEASES
|
|
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
|