mirror of
https://github.com/atom/atom.git
synced 2026-01-27 07:47:58 -05:00
Merge pull request #18048 from atom/dw-vsts-windows-x86
Enable 32-bit Windows builds on VSTS
This commit is contained in:
1001
script/vsts/package-lock.json
generated
1001
script/vsts/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
||||
"name": "atom-release-scripts",
|
||||
"description": "Atom release scripts",
|
||||
"dependencies": {
|
||||
"download": "^7.1.0",
|
||||
"request": "^2.87.0",
|
||||
"request-promise-native": "^1.0.5",
|
||||
"yargs": "4.8.1"
|
||||
|
||||
@@ -7,9 +7,9 @@ jobs:
|
||||
matrix:
|
||||
x64:
|
||||
buildArch: x64
|
||||
# TODO: x86 is currently not supported on VSTS
|
||||
# x86:
|
||||
# buildArch: x86
|
||||
x86:
|
||||
buildArch: x86
|
||||
|
||||
pool:
|
||||
vmImage: vs2015-win2012r2 # needed for python 2.7 and gyp
|
||||
|
||||
@@ -29,23 +29,30 @@ jobs:
|
||||
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: |
|
||||
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%
|
||||
script\build.cmd --code-sign --compress-artifacts --create-windows-installer
|
||||
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%
|
||||
script\build.cmd --code-sign --compress-artifacts
|
||||
node script\vsts\windows-run.js script\build.cmd --code-sign --compress-artifacts
|
||||
) ELSE (
|
||||
ECHO Pull request build, no code signing will be performed
|
||||
script\build.cmd --compress-artifacts
|
||||
node script\vsts\windows-run.js script\build.cmd --compress-artifacts
|
||||
)
|
||||
)
|
||||
env:
|
||||
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)
|
||||
@@ -53,13 +60,16 @@ jobs:
|
||||
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
|
||||
displayName: Build Atom
|
||||
|
||||
- script: script\lint.cmd
|
||||
- script: node script\vsts\windows-run.js script\lint.cmd
|
||||
env:
|
||||
BUILD_ARCH: $(buildArch)
|
||||
displayName: Run linter
|
||||
|
||||
- script: script\test.cmd
|
||||
- script: node script\vsts\windows-run.js script\test.cmd
|
||||
env:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
BUILD_ARCH: $(buildArch)
|
||||
displayName: Run tests
|
||||
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
|
||||
|
||||
@@ -69,7 +79,7 @@ jobs:
|
||||
ArtifactName: atom-x64-windows.zip
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-x64-windows.zip
|
||||
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
|
||||
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['buildArch'], 'x64'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
@@ -77,7 +87,7 @@ jobs:
|
||||
ArtifactName: AtomSetup-x64.exe
|
||||
ArtifactType: Container
|
||||
displayName: Upload AtomSetup-x64.exe
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
@@ -85,7 +95,7 @@ jobs:
|
||||
ArtifactName: atom-x64-$(ReleaseVersion)-full.nupkg
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-x64-$(ReleaseVersion)-full.nupkg
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x64'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
@@ -93,4 +103,36 @@ jobs:
|
||||
ArtifactName: RELEASES-x64
|
||||
ArtifactType: Container
|
||||
displayName: Upload RELEASES-x64
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
|
||||
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/RELEASES
|
||||
ArtifactName: RELEASES
|
||||
ArtifactType: Container
|
||||
displayName: Upload RELEASES
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'), eq(variables['buildArch'], 'x86'))
|
||||
|
||||
43
script/vsts/windows-run.js
Normal file
43
script/vsts/windows-run.js
Normal file
@@ -0,0 +1,43 @@
|
||||
// NOTE: This script is only used as part of the Windows build on VSTS,
|
||||
// see script/vsts/platforms/windows.yml for its usage
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const download = require('download')
|
||||
const childProcess = require('child_process')
|
||||
|
||||
const nodeVersion = '8.9.3'
|
||||
const nodeFileName = `node-v${nodeVersion}-win-x86`
|
||||
const extractedNodePath = `c:\\tmp\\${nodeFileName}`
|
||||
|
||||
async function downloadX86Node () {
|
||||
if (!fs.existsSync(extractedNodePath)) {
|
||||
await download(`https://nodejs.org/download/release/v${nodeVersion}/${nodeFileName}.zip`, 'c:\\tmp', { extract: true })
|
||||
}
|
||||
}
|
||||
|
||||
async function runScriptForBuildArch () {
|
||||
if (process.env.BUILD_ARCH === 'x86') {
|
||||
await downloadX86Node()
|
||||
|
||||
// Write out a launcher script that will launch the requested script
|
||||
// using the 32-bit cmd.exe and 32-bit Node.js
|
||||
const runScript = `@echo off\r\nCALL ${extractedNodePath}\\nodevars.bat\r\nCALL ${path.resolve(process.argv[2])} ${process.argv.splice(3).join(' ')}`
|
||||
const runScriptPath = 'c:\\tmp\\run.cmd'
|
||||
fs.writeFileSync(runScriptPath, runScript)
|
||||
childProcess.execSync(
|
||||
`C:\\Windows\\SysWOW64\\cmd.exe /c "${runScriptPath}"`,
|
||||
{ env: process.env, stdio: 'inherit' }
|
||||
)
|
||||
} else {
|
||||
if (process.argv.length > 2) {
|
||||
childProcess.execSync(
|
||||
process.argv.splice(2).join(' '),
|
||||
{ env: process.env, stdio: 'inherit' }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runScriptForBuildArch().catch(
|
||||
err => console.log(`\nScript failed due to error: ${err.message}`)
|
||||
)
|
||||
Reference in New Issue
Block a user