mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-07 17:05:33 +02:00
bump version to 1.9.12 and simplify macOS release naming and update URL handling
Some checks are pending
CI / general (push) Waiting to run
Some checks are pending
CI / general (push) Waiting to run
This commit is contained in:
parent
89b2c3927a
commit
e91d11b419
4 changed files with 92 additions and 120 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@zen-browser/surfer",
|
"name": "@zen-browser/surfer",
|
||||||
"version": "1.9.10",
|
"version": "1.9.12",
|
||||||
"description": "Simplifying building firefox forks!",
|
"description": "Simplifying building firefox forks!",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|
|
@ -36,118 +36,107 @@ export const surferPackage = async () => {
|
||||||
|
|
||||||
// The engine directory must have been downloaded for this to be valid
|
// The engine directory must have been downloaded for this to be valid
|
||||||
// TODO: Make this a reusable function that can be used by everything
|
// TODO: Make this a reusable function that can be used by everything
|
||||||
if (!existsSync(ENGINE_DIR)) {
|
if (!process.env.JUST_MAR) {
|
||||||
log.error(
|
if (!existsSync(ENGINE_DIR)) {
|
||||||
`Unable to locate any source directories.\nRun |${bin_name} download| to generate the source directory.`
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!existsSync(machPath)) {
|
|
||||||
log.error(`Cannot locate the 'mach' binary within ${ENGINE_DIR}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const arguments_ = ['package']
|
|
||||||
|
|
||||||
log.info(
|
|
||||||
`Packaging \`${config.binaryName}\` with args ${JSON.stringify(
|
|
||||||
arguments_.slice(1, 0)
|
|
||||||
)}...`
|
|
||||||
)
|
|
||||||
|
|
||||||
const currentCWD = process.cwd()
|
|
||||||
|
|
||||||
if (!process.env.SURFER_SIGNING_MODE) {
|
|
||||||
await dispatch(machPath, arguments_, ENGINE_DIR, true)
|
|
||||||
|
|
||||||
// Merge language packs
|
|
||||||
for (const locale of await getLocales()) {
|
|
||||||
const arguments_ = ['build', `merge-${locale}`]
|
|
||||||
|
|
||||||
log.info(
|
|
||||||
`Packaging \`${config.binaryName}\` with args ${JSON.stringify(
|
|
||||||
arguments_.slice(1, 0)
|
|
||||||
)}...`
|
|
||||||
)
|
|
||||||
|
|
||||||
await dispatch(machPath, arguments_, ENGINE_DIR, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info('Copying language packs')
|
|
||||||
|
|
||||||
await dispatch(
|
|
||||||
machPath,
|
|
||||||
['package-multi-locale', '--locales', ...(await getLocales())],
|
|
||||||
ENGINE_DIR,
|
|
||||||
true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info('Copying results up')
|
|
||||||
|
|
||||||
log.debug("Creating the dist directory if it doesn't exist")
|
|
||||||
if (!existsSync(DIST_DIR)) await mkdir(DIST_DIR, { recursive: true })
|
|
||||||
|
|
||||||
log.debug('Indexing files to copy')
|
|
||||||
const filesInMozillaDistrobution = await readdir(join(OBJ_DIR, 'dist'), {
|
|
||||||
withFileTypes: true,
|
|
||||||
})
|
|
||||||
const files = filesInMozillaDistrobution
|
|
||||||
.filter((entry) => entry.isFile())
|
|
||||||
.map((entry) => entry.name)
|
|
||||||
|
|
||||||
for (const file of files) {
|
|
||||||
const destinationFile = join(DIST_DIR, file)
|
|
||||||
log.debug(`Copying ${file}`)
|
|
||||||
if (existsSync(destinationFile)) await unlink(destinationFile)
|
|
||||||
await copyFile(join(OBJ_DIR, 'dist', file), destinationFile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Windows has some special dist files that are available within the dist
|
|
||||||
// directory.
|
|
||||||
if ((process as any).surferPlatform == 'win32') {
|
|
||||||
const installerDistributionDirectory = join(
|
|
||||||
OBJ_DIR,
|
|
||||||
'dist',
|
|
||||||
'install',
|
|
||||||
'sea'
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!existsSync(installerDistributionDirectory)) {
|
|
||||||
log.error(
|
log.error(
|
||||||
`Could not find windows installer files located at '${installerDistributionDirectory}'`
|
`Unable to locate any source directories.\nRun |${bin_name} download| to generate the source directory.`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const installerDistributionDirectoryContents = await readdir(
|
if (!existsSync(machPath)) {
|
||||||
installerDistributionDirectory,
|
log.error(`Cannot locate the 'mach' binary within ${ENGINE_DIR}`)
|
||||||
{ withFileTypes: true }
|
}
|
||||||
|
|
||||||
|
const arguments_ = ['package']
|
||||||
|
|
||||||
|
log.info(
|
||||||
|
`Packaging \`${config.binaryName}\` with args ${JSON.stringify(
|
||||||
|
arguments_.slice(1, 0)
|
||||||
|
)}...`
|
||||||
)
|
)
|
||||||
const windowsInstallerFiles = installerDistributionDirectoryContents
|
|
||||||
|
const currentCWD = process.cwd()
|
||||||
|
|
||||||
|
if (!process.env.SURFER_SIGNING_MODE) {
|
||||||
|
await dispatch(machPath, arguments_, ENGINE_DIR, true)
|
||||||
|
|
||||||
|
log.info('Copying language packs')
|
||||||
|
|
||||||
|
await dispatch(
|
||||||
|
machPath,
|
||||||
|
['package-multi-locale', '--locales', ...(await getLocales())],
|
||||||
|
ENGINE_DIR,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info('Copying results up')
|
||||||
|
|
||||||
|
log.debug("Creating the dist directory if it doesn't exist")
|
||||||
|
if (!existsSync(DIST_DIR)) await mkdir(DIST_DIR, { recursive: true })
|
||||||
|
|
||||||
|
log.debug('Indexing files to copy')
|
||||||
|
const filesInMozillaDistrobution = await readdir(join(OBJ_DIR, 'dist'), {
|
||||||
|
withFileTypes: true,
|
||||||
|
})
|
||||||
|
const files = filesInMozillaDistrobution
|
||||||
.filter((entry) => entry.isFile())
|
.filter((entry) => entry.isFile())
|
||||||
.map((entry) => entry.name)
|
.map((entry) => entry.name)
|
||||||
|
|
||||||
for (const file of windowsInstallerFiles) {
|
for (const file of files) {
|
||||||
let newFileName = file
|
const destinationFile = join(DIST_DIR, file)
|
||||||
|
log.debug(`Copying ${file}`)
|
||||||
|
if (existsSync(destinationFile)) await unlink(destinationFile)
|
||||||
|
await copyFile(join(OBJ_DIR, 'dist', file), destinationFile)
|
||||||
|
}
|
||||||
|
|
||||||
// There are some special cases that I want to reformat the name for
|
// Windows has some special dist files that are available within the dist
|
||||||
if (file.includes('.installer.exe')) {
|
// directory.
|
||||||
newFileName = `${config.binaryName}.installer.exe`
|
if ((process as any).surferPlatform == 'win32') {
|
||||||
}
|
const installerDistributionDirectory = join(
|
||||||
if (file.includes('.installer-stub.exe')) {
|
OBJ_DIR,
|
||||||
newFileName = `${config.binaryName}.installer.pretty.exe`
|
'dist',
|
||||||
log.warning(
|
'install',
|
||||||
`The installer ${newFileName} requires that your binaries are available from the internet and everything is correctly configured. I recommend you ship '${config.binaryName}.installer.exe' if you have not set this up correctly yet`
|
'sea'
|
||||||
|
)
|
||||||
|
|
||||||
|
if (!existsSync(installerDistributionDirectory)) {
|
||||||
|
log.error(
|
||||||
|
`Could not find windows installer files located at '${installerDistributionDirectory}'`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actually copy
|
const installerDistributionDirectoryContents = await readdir(
|
||||||
const destinationFile = join(DIST_DIR, newFileName)
|
installerDistributionDirectory,
|
||||||
log.debug(`Copying ${file}`)
|
{ withFileTypes: true }
|
||||||
if (existsSync(destinationFile)) await unlink(destinationFile)
|
|
||||||
await copyFile(
|
|
||||||
join(installerDistributionDirectory, file),
|
|
||||||
destinationFile
|
|
||||||
)
|
)
|
||||||
|
const windowsInstallerFiles = installerDistributionDirectoryContents
|
||||||
|
.filter((entry) => entry.isFile())
|
||||||
|
.map((entry) => entry.name)
|
||||||
|
|
||||||
|
for (const file of windowsInstallerFiles) {
|
||||||
|
let newFileName = file
|
||||||
|
|
||||||
|
// There are some special cases that I want to reformat the name for
|
||||||
|
if (file.includes('.installer.exe')) {
|
||||||
|
newFileName = `${config.binaryName}.installer.exe`
|
||||||
|
}
|
||||||
|
if (file.includes('.installer-stub.exe')) {
|
||||||
|
newFileName = `${config.binaryName}.installer.pretty.exe`
|
||||||
|
log.warning(
|
||||||
|
`The installer ${newFileName} requires that your binaries are available from the internet and everything is correctly configured. I recommend you ship '${config.binaryName}.installer.exe' if you have not set this up correctly yet`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Actually copy
|
||||||
|
const destinationFile = join(DIST_DIR, newFileName)
|
||||||
|
log.debug(`Copying ${file}`)
|
||||||
|
if (existsSync(destinationFile)) await unlink(destinationFile)
|
||||||
|
await copyFile(
|
||||||
|
join(installerDistributionDirectory, file),
|
||||||
|
destinationFile
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -422,13 +422,7 @@ pref("devtools.selfxss.count", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUpdateURLs() {
|
function setUpdateURLs() {
|
||||||
let suffix = '';
|
const baseURL = `URL=https://@MOZ_APPUPDATE_HOST@/updates/browser/%BUILD_TARGET%/%CHANNEL%/update.xml`
|
||||||
if ((process as any).surferPlatform == 'darwin') {
|
|
||||||
if (compatMode == 'x86_64') {
|
|
||||||
suffix = '-generic';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const baseURL = `URL=https://@MOZ_APPUPDATE_HOST@/updates/browser/%BUILD_TARGET%/%CHANNEL%${suffix}/update.xml`
|
|
||||||
const appIni = join(ENGINE_DIR, 'build', 'application.ini.in')
|
const appIni = join(ENGINE_DIR, 'build', 'application.ini.in')
|
||||||
const appIniContents = readFileSync(appIni).toString()
|
const appIniContents = readFileSync(appIni).toString()
|
||||||
const updatedAppIni = appIniContents.replace(/URL=.*update.xml/g, baseURL)
|
const updatedAppIni = appIniContents.replace(/URL=.*update.xml/g, baseURL)
|
||||||
|
|
|
@ -59,12 +59,7 @@ function getReleaseMarName(releaseInfo: ReleaseInfo): string | undefined {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((process as any).surferPlatform == 'darwin') {
|
if ((process as any).surferPlatform == 'darwin') {
|
||||||
if (compatMode == 'x86_64') {
|
releaseMarName = 'macos.mar' // universal binary
|
||||||
releaseMarName = 'macos-x86_64.mar'
|
|
||||||
}
|
|
||||||
else if (compatMode == 'aarch64') {
|
|
||||||
releaseMarName = 'macos-aarch64.mar'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ((process as any).surferPlatform == 'linux') {
|
if ((process as any).surferPlatform == 'linux') {
|
||||||
if (compatMode == 'x86_64') {
|
if (compatMode == 'x86_64') {
|
||||||
|
@ -115,18 +110,12 @@ async function writeUpdateFileToDisk(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
let suffix = '';
|
|
||||||
if ((process as any).surferPlatform == 'darwin') {
|
|
||||||
if (compatMode == 'x86_64') {
|
|
||||||
suffix = '-generic';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const xmlPath = join(
|
const xmlPath = join(
|
||||||
DIST_DIR,
|
DIST_DIR,
|
||||||
'update',
|
'update',
|
||||||
'browser',
|
'browser',
|
||||||
target,
|
target,
|
||||||
channel + suffix,
|
channel,
|
||||||
'update.xml'
|
'update.xml'
|
||||||
)
|
)
|
||||||
const document = create(updateObject)
|
const document = create(updateObject)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue