From a389621cf1ebfccaa2a8ed4b6cc0a0574c9e45ef Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Mon, 30 Dec 2024 23:19:11 +0100 Subject: [PATCH 1/5] Update dependencies and modify branding for stable release --- .github/workflows/build.yml | 26 ++++--- .github/workflows/check-candidate-release.yml | 25 +++++++ AppDir/zen.desktop | 2 +- build/winsign/sign.ps1 | 2 +- package.json | 2 +- pnpm-lock.yaml | 10 +-- scripts/check-rc-response.py | 63 +++++++++++++++++ .../content/navigator-toolbox-inc-xhtml.patch | 16 ++--- .../CustomizableUI-sys-mjs.patch | 32 ++++----- .../CustomizeMenu/_CustomizeMenu-scss.patch | 11 --- .../CustomizeMenu/_zenNewTabGlobals.scss | 5 -- .../tabbrowser/content/tabbrowser-js.patch | 68 +++++++++---------- .../tabbrowser/content/tabs-js.patch | 40 +++++------ .../themes/BuiltInThemeConfig-sys-mjs.patch | 4 +- .../themes/shared/browser-shared-css.patch | 36 ---------- .../shared/preferences/preferences-css.patch | 13 ---- .../widgets/browser-custom-element-js.patch | 10 +-- surfer.json | 7 +- 18 files changed, 194 insertions(+), 178 deletions(-) create mode 100644 .github/workflows/check-candidate-release.yml create mode 100644 scripts/check-rc-response.py delete mode 100644 src/browser/components/newtab/content-src/components/CustomizeMenu/_CustomizeMenu-scss.patch delete mode 100644 src/browser/components/newtab/content-src/components/CustomizeMenu/_zenNewTabGlobals.scss delete mode 100644 src/browser/themes/shared/browser-shared-css.patch delete mode 100644 src/browser/themes/shared/preferences/preferences-css.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d2088a22..ed6f484a3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,10 @@ on: update_branch: description: 'Update branch with new version' required: true - default: 'beta' + default: 'stable' type: 'choice' options: - - 'beta' + - 'stable' - 'twilight' workflow_call: inputs: @@ -36,7 +36,7 @@ on: update_branch: description: 'Update branch with new version' required: true - default: 'beta' + default: 'stable' type: 'string' jobs: @@ -72,9 +72,7 @@ jobs: git status git branch --show-current branch="${{ inputs.update_branch }}" - if [[ $branch == "beta" ]]; then - branch="stable" - elif [[ $branch == "twilight" ]]; then + if [[ $branch == "twilight" ]]; then branch="dev" fi if [[ $(git branch --show-current) != $branch ]]; then @@ -124,7 +122,7 @@ jobs: npm i -g @zen-browser/surfer - name: Bump version - if: ${{ inputs.update_version && inputs.update_branch == 'beta' }} + if: ${{ inputs.update_version && inputs.update_branch == 'stable' }} run: | pnpm surfer ci --brand ${{ inputs.update_branch }} --bump prerelease @@ -362,7 +360,7 @@ jobs: if [ "${{ inputs.update_branch }}" = "twilight" ]; then sed -i -e 's/Name=Zen Browser/Name=Zen Twilight/g' AppDir/zen.desktop - sed -i -e 's/StartupWMClass=zen-beta/StartupWMClass=zen-twilight/g' AppDir/zen.desktop + sed -i -e 's/StartupWMClass=zen-stable/StartupWMClass=zen-twilight/g' AppDir/zen.desktop fi APPDIR=AppDir @@ -402,7 +400,7 @@ jobs: needs: [build-data, linux, windows-step-3, check-release, mac, appimage, source] runs-on: ubuntu-latest environment: - name: ${{ inputs.update_branch == 'beta' && 'Deploy-Release' || 'Deploy-Twilight' }} + name: ${{ inputs.update_branch == 'stable' && 'Deploy-Release' || 'Deploy-Twilight' }} steps: - name: Checkout repository @@ -441,7 +439,7 @@ jobs: cp -a ../linux_update_manifest_x86_64/. updates/ cp -a ../linux_update_manifest_aarch64/. updates/ - if [[ $RELEASE_BRANCH == 'beta' ]]; then + if [[ $RELEASE_BRANCH == 'stable' ]]; then cp -a ../.github/workflows/object/windows-x64-signed-x86_64/update_manifest/. updates/ cp -a ../.github/workflows/object/windows-x64-signed-arm64/update_manifest/. updates/ else @@ -495,12 +493,12 @@ jobs: - name: Release uses: marvinpinto/action-automatic-releases@master - if: ${{ inputs.update_branch == 'beta' }} + if: ${{ inputs.update_branch == 'stable' }} with: repo_token: '${{ secrets.DEPLOY_KEY }}' automatic_release_tag: ${{ needs.build-data.outputs.version }} prerelease: false - title: 'Beta build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})' + title: 'Stable build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})' files: | zen.source.tar.gz zen.linux-x86_64.tar.bz2 @@ -523,7 +521,7 @@ jobs: zen.macos-aarch64.dmg prepare-flatpak: - if: ${{ inputs.create_release && inputs.update_branch == 'beta' }} + if: ${{ inputs.create_release && inputs.update_branch == 'stable' }} permissions: write-all name: Prepare Flatpak needs: [release, linux, build-data] @@ -582,7 +580,7 @@ jobs: run: sleep 120 release-flatpak: - if: ${{ inputs.create_release && inputs.update_branch == 'beta' }} + if: ${{ inputs.create_release && inputs.update_branch == 'stable' }} permissions: write-all name: Release Flatpak needs: [prepare-flatpak, build-data] diff --git a/.github/workflows/check-candidate-release.yml b/.github/workflows/check-candidate-release.yml new file mode 100644 index 000000000..c348a30ce --- /dev/null +++ b/.github/workflows/check-candidate-release.yml @@ -0,0 +1,25 @@ +name: Check Firefox Candidate Release + +on: + schedule: + - cron: '0 21 * * 1' + workflow_dispatch: + +jobs: + check_tag: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v2 + + - name: Fetch JSON Response + run: | + curl -s "https://hg.mozilla.org/releases/mozilla-release/json-tags" > rc-response.json + + - name: Check for any updates + env: + DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} + DISCORD_PING_IDS: ${{ secrets.DISCORD_PING_IDS }} + run: | + python3 scripts/check-rc-response.py diff --git a/AppDir/zen.desktop b/AppDir/zen.desktop index 4a79413a9..a533fbbdb 100644 --- a/AppDir/zen.desktop +++ b/AppDir/zen.desktop @@ -5,7 +5,7 @@ Exec=zen %u Icon=zen Type=Application MimeType=text/html;text/xml;application/xhtml+xml;x-scheme-handler/http;x-scheme-handler/https;application/x-xpinstall;application/pdf;application/json; -StartupWMClass=zen-beta +StartupWMClass=zen-stable Categories=Network;WebBrowser; StartupNotify=true Terminal=false diff --git a/build/winsign/sign.ps1 b/build/winsign/sign.ps1 index 004a6cf03..cba28ca4c 100644 --- a/build/winsign/sign.ps1 +++ b/build/winsign/sign.ps1 @@ -29,7 +29,7 @@ echo "Downloaded x86_64 artifacts" mkdir engine\obj-x86_64-pc-windows-msvc\ -ErrorAction SilentlyContinue -pnpm surfer ci --brand beta +pnpm surfer ci --brand stable function SignAndPackage($name) { echo "Executing on $name" diff --git a/package.json b/package.json index 3241185ec..5d096bd61 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ }, "homepage": "https://github.com/zen-browser/core#readme", "dependencies": { - "@zen-browser/surfer": "^1.7.0" + "@zen-browser/surfer": "^1.8.2" }, "devDependencies": { "husky": "^9.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d7d3390c6..da596b154 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@zen-browser/surfer': - specifier: ^1.7.0 - version: 1.7.0 + specifier: ^1.8.2 + version: 1.8.2 devDependencies: husky: specifier: ^9.1.5 @@ -119,8 +119,8 @@ packages: '@types/node@17.0.45': resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} - '@zen-browser/surfer@1.7.0': - resolution: {integrity: sha512-LKpMfcXvzf9VmXHydVF9sO4srtTdgjdrNYHHwDucNmnqIdamIYmP7KWAlZViohdBLdXPWODYY0IsZPAKNf3BCg==} + '@zen-browser/surfer@1.8.2': + resolution: {integrity: sha512-6odt1j7haMFjOffz+nt4+AWXJC8X3DW+ha7+nVdvqD6/mBiTtT8LnDQ0COQbZt0FMBTNB9nRlglm1jtHCOzE6g==} hasBin: true ansi-escapes@7.0.0: @@ -1003,7 +1003,7 @@ snapshots: '@types/node@17.0.45': {} - '@zen-browser/surfer@1.7.0': + '@zen-browser/surfer@1.8.2': dependencies: '@resvg/resvg-js': 1.4.0 async-icns: 1.0.2 diff --git a/scripts/check-rc-response.py b/scripts/check-rc-response.py new file mode 100644 index 000000000..205dbf309 --- /dev/null +++ b/scripts/check-rc-response.py @@ -0,0 +1,63 @@ +import json +import sys +import os +import requests + +RESPONSE = 'rc-response.json' +METADATA = 'surfer.json' + +def get_current_version(): + with open(METADATA) as f: + metadata = json.load(f) + return metadata['version']['candidate'] + +def get_rc_response(): + with open(RESPONSE) as f: + data = json.load(f) + for tag_dict in data['tags']: + tag = tag_dict['tag'] + is_valid_tag = (tag.startswith('FIREFOX') and tag.endswith('_BUILD1') + and not 'ESR' in tag and not 'b' in tag) + if is_valid_tag: + return tag.replace('FIREFOX_', '').replace('_BUILD1', '').replace('_', '.') + return None + +def get_pings(): + pings = "" + for ping in os.getenv('DISCORD_PING_IDS').split(','): + pings += "<@%s> " % ping + return pings + +def send_webhook(rc: str): + text = "Sending a PR to update the current version to %s goo %s" % (rc, get_pings()) + webhook_url = os.getenv('DISCORD_WEBHOOK_URL') #os.getenv('DISCORD_WEBHOOK_URL') + message = { + "content": text, + "username": "GO-WORK", + "avatar_url": "https://zen-browser.app/favicon.svg", + } + response = requests.post(webhook_url, json=message) + if response.status_code == 204: + print("Message sent successfully!") + else: + print(f"Failed to send message: {response.status_code}") + +def main(): + current = get_current_version() + if not current: + print('Could not find current version') + return 1 + rc = get_rc_response() + if not rc: + print('Could not find RC version') + return 1 + if current != rc: + print('Current version is %s, but RC version is %s' % (current, rc)) + # Here, we should update the current version in surfer.json + send_webhook(rc) + return 0 + print('Current version is %s, and RC version is %s' % (current, rc)) + return 1 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/src/browser/base/content/navigator-toolbox-inc-xhtml.patch b/src/browser/base/content/navigator-toolbox-inc-xhtml.patch index 9dfba3614..d696af063 100644 --- a/src/browser/base/content/navigator-toolbox-inc-xhtml.patch +++ b/src/browser/base/content/navigator-toolbox-inc-xhtml.patch @@ -5,11 +5,11 @@ index eb2d8670874bd5bcaf9253caafb98444cb8cfcd9..51e6c01c279e0105ec8ac08df0763027 @@ -2,7 +2,7 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. - -- -+ + +- ++