mirror of
https://github.com/zen-browser/surfer.git
synced 2025-07-07 17:05:33 +02:00
bump version to 1.8.2 and add support for candidate builds in Firefox source setup
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
0b109c2dd4
commit
c0d4dd8eef
5 changed files with 32 additions and 11 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@zen-browser/surfer",
|
"name": "@zen-browser/surfer",
|
||||||
"version": "1.7.0",
|
"version": "1.8.2",
|
||||||
"description": "Simplifying building firefox forks!",
|
"description": "Simplifying building firefox forks!",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import {
|
||||||
resolveAddonDownloadUrl,
|
resolveAddonDownloadUrl,
|
||||||
unpackAddon,
|
unpackAddon,
|
||||||
} from './addon'
|
} from './addon'
|
||||||
import { configPath } from '../../utils'
|
import { configPath, shouldUseCandidate } from '../../utils'
|
||||||
import fs from 'fs-extra'
|
import fs from 'fs-extra'
|
||||||
|
|
||||||
export function shouldSetupFirefoxSource() {
|
export function shouldSetupFirefoxSource() {
|
||||||
|
@ -30,8 +30,8 @@ export function shouldSetupFirefoxSource() {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function setupFirefoxSource(version: string) {
|
export async function setupFirefoxSource(version: string, isCandidate = false) {
|
||||||
const firefoxSourceTar = await downloadFirefoxSource(version)
|
const firefoxSourceTar = await downloadFirefoxSource(version, isCandidate)
|
||||||
|
|
||||||
await unpackFirefoxSource(firefoxSourceTar)
|
await unpackFirefoxSource(firefoxSourceTar)
|
||||||
|
|
||||||
|
@ -108,8 +108,12 @@ async function unpackFirefoxSource(name: string): Promise<void> {
|
||||||
log.info(`Unpacked Firefox source to ${ENGINE_DIR}`)
|
log.info(`Unpacked Firefox source to ${ENGINE_DIR}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function downloadFirefoxSource(version: string) {
|
async function downloadFirefoxSource(version: string, isCandidate = false) {
|
||||||
const base = `https://archive.mozilla.org/pub/firefox/releases/${version}/source/`
|
let base = `https://archive.mozilla.org/pub/firefox/releases/${version}/source/`;
|
||||||
|
if (isCandidate) {
|
||||||
|
console.log('Using candidate build')
|
||||||
|
base = `https://archive.mozilla.org/pub/firefox/candidates/${version}-candidates/build1/source/`;
|
||||||
|
}
|
||||||
const filename = `firefox-${version}.source.tar.xz`
|
const filename = `firefox-${version}.source.tar.xz`
|
||||||
|
|
||||||
const url = base + filename
|
const url = base + filename
|
||||||
|
@ -141,9 +145,11 @@ async function downloadFirefoxSource(version: string) {
|
||||||
export async function downloadInternals({
|
export async function downloadInternals({
|
||||||
version,
|
version,
|
||||||
force,
|
force,
|
||||||
|
isCandidate = shouldUseCandidate()
|
||||||
}: {
|
}: {
|
||||||
version: string
|
version: string
|
||||||
force?: boolean
|
force?: boolean,
|
||||||
|
isCandidate?: boolean
|
||||||
}) {
|
}) {
|
||||||
// Provide a legible error if there is no version specified
|
// Provide a legible error if there is no version specified
|
||||||
if (!version) {
|
if (!version) {
|
||||||
|
@ -153,6 +159,10 @@ export async function downloadInternals({
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isCandidate) {
|
||||||
|
version = config.version.candidate as string;
|
||||||
|
}
|
||||||
|
|
||||||
if (force && existsSync(ENGINE_DIR)) {
|
if (force && existsSync(ENGINE_DIR)) {
|
||||||
log.info('Removing existing workspace')
|
log.info('Removing existing workspace')
|
||||||
rmSync(ENGINE_DIR, { recursive: true })
|
rmSync(ENGINE_DIR, { recursive: true })
|
||||||
|
@ -168,7 +178,7 @@ export async function downloadInternals({
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!existsSync(ENGINE_DIR)) {
|
if (!existsSync(ENGINE_DIR)) {
|
||||||
await setupFirefoxSource(version)
|
await setupFirefoxSource(version, isCandidate)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const addon of getAddons()) {
|
for (const addon of getAddons()) {
|
||||||
|
|
|
@ -297,15 +297,15 @@ function configureBrandingNsis(
|
||||||
!define HelpLink "https://github.com/zen-browser/desktop/issues"
|
!define HelpLink "https://github.com/zen-browser/desktop/issues"
|
||||||
|
|
||||||
; The OFFICIAL define is a workaround to support different urls for Release and
|
; The OFFICIAL define is a workaround to support different urls for Release and
|
||||||
; Beta since they share the same branding when building with other branches that
|
; Stable since they share the same branding when building with other branches that
|
||||||
; set the update channel to beta.
|
; set the update channel to stable.
|
||||||
!define OFFICIAL
|
!define OFFICIAL
|
||||||
!define URLStubDownloadX86 "https://download.mozilla.org/?os=win&lang=\${AB_CD}&product=firefox-latest"
|
!define URLStubDownloadX86 "https://download.mozilla.org/?os=win&lang=\${AB_CD}&product=firefox-latest"
|
||||||
!define URLStubDownloadAMD64 "https://download.mozilla.org/?os=win64&lang=\${AB_CD}&product=firefox-latest"
|
!define URLStubDownloadAMD64 "https://download.mozilla.org/?os=win64&lang=\${AB_CD}&product=firefox-latest"
|
||||||
!define URLStubDownloadAArch64 "https://download.mozilla.org/?os=win64-aarch64&lang=\${AB_CD}&product=firefox-latest"
|
!define URLStubDownloadAArch64 "https://download.mozilla.org/?os=win64-aarch64&lang=\${AB_CD}&product=firefox-latest"
|
||||||
!define URLManualDownload "https://zen-browser.app/download"
|
!define URLManualDownload "https://zen-browser.app/download"
|
||||||
!define URLSystemRequirements "https://www.mozilla.org/firefox/system-requirements/"
|
!define URLSystemRequirements "https://www.mozilla.org/firefox/system-requirements/"
|
||||||
!define Channel "release"
|
!define Channel "stable"
|
||||||
|
|
||||||
# The installer's certificate name and issuer expected by the stub installer
|
# The installer's certificate name and issuer expected by the stub installer
|
||||||
!define CertNameDownload "${brandingConfig.brandFullName}"
|
!define CertNameDownload "${brandingConfig.brandFullName}"
|
||||||
|
|
|
@ -131,6 +131,10 @@ export interface Config {
|
||||||
* The version of the selected product you are forking
|
* The version of the selected product you are forking
|
||||||
*/
|
*/
|
||||||
version?: string
|
version?: string
|
||||||
|
/*
|
||||||
|
* Release candidate version
|
||||||
|
*/
|
||||||
|
candidate?: string
|
||||||
}
|
}
|
||||||
buildOptions: {
|
buildOptions: {
|
||||||
windowsUseSymbolicLinks: boolean
|
windowsUseSymbolicLinks: boolean
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { log } from '../log'
|
import { log } from '../log'
|
||||||
import { SupportedProducts } from './config'
|
import { SupportedProducts } from './config'
|
||||||
|
import { config } from '..'
|
||||||
|
import { dynamicConfig } from '.'
|
||||||
|
|
||||||
const firefoxTargets = JSON.parse(`{
|
const firefoxTargets = JSON.parse(`{
|
||||||
"${SupportedProducts.Firefox}": "LATEST_FIREFOX_VERSION",
|
"${SupportedProducts.Firefox}": "LATEST_FIREFOX_VERSION",
|
||||||
|
@ -13,6 +15,11 @@ const firefoxTargets = JSON.parse(`{
|
||||||
"${SupportedProducts.FirefoxNightly}": "FIREFOX_NIGHTLY"
|
"${SupportedProducts.FirefoxNightly}": "FIREFOX_NIGHTLY"
|
||||||
}`)
|
}`)
|
||||||
|
|
||||||
|
export const shouldUseCandidate = (): boolean => {
|
||||||
|
const brandingKey = dynamicConfig.get('brand')
|
||||||
|
return brandingKey !== 'stable' && (config.version.version !== config.version.candidate);
|
||||||
|
}
|
||||||
|
|
||||||
export const getLatestFF = async (
|
export const getLatestFF = async (
|
||||||
product: SupportedProducts = SupportedProducts.Firefox
|
product: SupportedProducts = SupportedProducts.Firefox
|
||||||
): Promise<string> => {
|
): Promise<string> => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue