mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-23 15:39:28 -05:00
feat: build Cypress for linux-arm64 (#22252)
This commit is contained in:
@@ -113,6 +113,7 @@ const deploy = {
|
||||
checkDownloads ({ version }) {
|
||||
const systems = [
|
||||
{ platform: 'linux', arch: 'x64' },
|
||||
{ platform: 'linux', arch: 'arm64' },
|
||||
{ platform: 'darwin', arch: 'x64' },
|
||||
{ platform: 'darwin', arch: 'arm64' },
|
||||
{ platform: 'win32', arch: 'x64' },
|
||||
|
||||
@@ -34,7 +34,7 @@ type semver = string
|
||||
/**
|
||||
* Platform plus architecture string like "darwin-x64"
|
||||
*/
|
||||
type platformArch = 'darwin-x64' | 'darwin-arm64' | 'linux-x64' | 'win32-x64'
|
||||
type platformArch = 'darwin-x64' | 'darwin-arm64' | 'linux-x64' | 'linux-arm64' | 'win32-x64'
|
||||
|
||||
interface ReleaseInformation {
|
||||
commit: commit
|
||||
|
||||
@@ -87,6 +87,7 @@ module.exports = {
|
||||
'darwin-x64': getUrl('darwin-x64'),
|
||||
'darwin-arm64': getUrl('darwin-arm64'),
|
||||
'linux-x64': getUrl('linux-x64'),
|
||||
'linux-arm64': getUrl('linux-arm64'),
|
||||
'win32-x64': getUrl('win32-x64'),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
const _ = require('lodash')
|
||||
const awspublish = require('gulp-awspublish')
|
||||
const human = require('human-interval')
|
||||
const la = require('lazy-ass')
|
||||
@@ -112,7 +111,7 @@ const purgeDesktopAppAllPlatforms = function (version, zipName) {
|
||||
}
|
||||
|
||||
// all architectures we are building the test runner for
|
||||
const validPlatformArchs = ['darwin-arm64', 'darwin-x64', 'linux-x64', 'win32-x64']
|
||||
const validPlatformArchs = ['darwin-arm64', 'darwin-x64', 'linux-x64', 'linux-arm64', 'win32-x64']
|
||||
// simple check for platform-arch string
|
||||
// example: isValidPlatformArch("darwin") // FALSE
|
||||
const isValidPlatformArch = check.oneOf(validPlatformArchs)
|
||||
@@ -122,25 +121,12 @@ const getValidPlatformArchs = () => {
|
||||
}
|
||||
|
||||
const getUploadNameByOsAndArch = function (platform) {
|
||||
// just hard code for now...
|
||||
const arch = os.arch()
|
||||
|
||||
const uploadNames = {
|
||||
darwin: {
|
||||
'arm64': 'darwin-arm64',
|
||||
'x64': 'darwin-x64',
|
||||
},
|
||||
linux: {
|
||||
'x64': 'linux-x64',
|
||||
},
|
||||
win32: {
|
||||
'x64': 'win32-x64',
|
||||
},
|
||||
}
|
||||
const name = _.get(uploadNames[platform], arch)
|
||||
const name = [platform, arch].join('-')
|
||||
|
||||
if (!name) {
|
||||
throw new Error(`Cannot find upload name for OS: '${platform}' with arch: '${arch}'`)
|
||||
if (!isValidPlatformArch(name)) {
|
||||
throw new Error(`${name} is not a valid upload destination. Does validPlatformArchs need updating?`)
|
||||
}
|
||||
|
||||
la(isValidPlatformArch(name), 'formed invalid platform', name, 'from', platform, arch)
|
||||
|
||||
Reference in New Issue
Block a user