diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cd2de6f6..4b037f71 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,8 +58,8 @@ jobs: runs-on: ubuntu-latest needs: [debug-inputs] steps: - - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} @@ -95,17 +95,18 @@ jobs: version: ${{ steps.data.outputs.version }} build_time: ${{ steps.data.outputs.buildtime }} steps: - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - - name: Install pnpm + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup pnpm run: npm install -g pnpm - name: Get pnpm store directory @@ -146,7 +147,8 @@ jobs: echo "version=$(surfer get version | xargs)" >> $GITHUB_OUTPUT echo "buildtime=$(date +"%H:%M:%S")" >> $GITHUB_OUTPUT - - uses: stefanzweifel/git-auto-commit-action@v4 + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v5 if: ${{ inputs.update_version }} with: commit_message: 🔖 Update version to ${{ steps.data.outputs.version }} @@ -157,17 +159,18 @@ jobs: runs-on: ubuntu-latest needs: [build-data] steps: - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - - name: Install pnpm + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup pnpm run: npm install -g pnpm - name: Get pnpm store directory @@ -180,13 +183,13 @@ jobs: run: | pnpm install - - name: Setup surfer + - name: Setup Surfer run: | npm i -g @zen-browser/surfer - - name: Activate surfer CLI + - name: Activate Surfer CLI run: | - echo "There's a bug in the surfer CLI, we run this so that surfer sets everything up correctly" + echo "There's a bug in the Surfer CLI, we run this so that Surfer sets everything up correctly" pnpm surfer ci --brand ${{ inputs.update_branch }} --display-version ${{ needs.build-data.outputs.version }} - name: Check version @@ -208,22 +211,23 @@ jobs: needs: [build-data, check-release] steps: - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - - name: Setup git + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup Git run: | git config --global user.email "mauro-balades@users.noreply.github.com" git config --global user.name "mauro-balades" - - name: Install pnpm + - name: Setup pnpm run: npm install -g pnpm - name: Get pnpm store directory @@ -236,10 +240,10 @@ jobs: run: | pnpm install - - name: Load surfer CI setup + - name: Load Surfer CI setup run: pnpm surfer ci --brand ${{ inputs.update_branch }} --display-version ${{ needs.build-data.outputs.version }} - - name: Download firefox source and dependancies + - name: Download Firefox source and dependencies run: pnpm surfer download --verbose - name: Import @@ -248,7 +252,6 @@ jobs: - name: Compress run: | cd engine - # -h is used to dereference symlinks tar --use-compress-program=zstd -hcf ../zen.source.tar.gz * cd .. @@ -327,23 +330,24 @@ jobs: arch: [x86_64, x86_64-v3, aarch64] needs: [linux] steps: - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dependencies run: | npm install -g pnpm sudo apt-get update sudo apt-get -y install libfuse2 desktop-file-utils appstream - - name: Download linux build + - name: Download Linux build uses: actions/download-artifact@v4 with: name: zen.linux-${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'aarch64' }}.tar.bz2 @@ -398,21 +402,23 @@ jobs: name: ${{ inputs.update_branch == 'alpha' && 'Deploy-Release' || 'Deploy-Twilight' }} steps: - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - - name: Git Pull + - name: Git pull run: | git pull - - uses: actions/download-artifact@v4 + - name: Download artifact + uses: actions/download-artifact@v4 - name: List run: find . - - name: Clone updates repo + - name: Checkout updates repository uses: actions/checkout@v4 with: repository: zen-browser/updates-server @@ -446,17 +452,18 @@ jobs: cp -a ../macos_update_manifest_aarch64/. updates/ cp -a ../macos_update_manifest_x86_64/. updates/ - - uses: stefanzweifel/git-auto-commit-action@v4 + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: 🚀 Update update manifests commit_user_name: Zen Browser Robot commit_user_email: zen-browser-auto@users.noreply.github.com repository: ./updates-server - # If we are on twilight, we want to just update the twilight tag's release - - name: Update twilight tag + # If we are on Twilight, we want to just update the Twilight tag's release + - name: Update Twilight tag if: ${{ inputs.update_branch == 'twilight' }} - uses: 'marvinpinto/action-automatic-releases@latest' + uses: marvinpinto/action-automatic-releases@master with: files: | zen.source.tar.gz @@ -493,8 +500,8 @@ jobs: env: GITHUB_REPOSITORY: ${{ github.repository }} - - name: release-github - uses: 'marvinpinto/action-automatic-releases@latest' + - name: Release + uses: marvinpinto/action-automatic-releases@master if: ${{ inputs.update_branch == 'alpha' }} with: repo_token: '${{ secrets.DEPLOY_KEY }}' @@ -537,7 +544,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Clone flatpak repo + - name: Checkout Flatpak repository uses: actions/checkout@v4 with: repository: zen-browser/release-utils @@ -549,18 +556,19 @@ jobs: sudo apt-get update npm install - - name: Generate new flatpak release + - name: Generate new Flatpak release run: | npm run build-flatpak -- \ --version ${{ needs.build-data.outputs.version }} - - uses: stefanzweifel/git-auto-commit-action@v4 + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: 🚀 Update releases for flatpak + commit_message: 🚀 Update releases for Flatpak commit_user_name: Zen Browser Robot commit_user_email: zen-browser-auto@users.noreply.github.com - - name: Clone flatpak repo + - name: Checkout Flatpak repository uses: actions/checkout@v4 with: repository: zen-browser/flatpak @@ -576,14 +584,15 @@ jobs: # output the version to the file echo -n ${{ needs.build-data.outputs.version }} > ./flatpak/version - - uses: stefanzweifel/git-auto-commit-action@v4 + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: '[release]: Update flatpak manifest' + commit_message: '[release]: Update Flatpak manifest' commit_user_name: Zen Browser Robot commit_user_email: zen-browser-auto@users.noreply.github.com repository: ./flatpak - - name: Wait 4 minutes for the flatpak repo to update + - name: Wait 4 minutes for the Flatpak repo to update run: sleep 240 release-flatpak: @@ -594,33 +603,33 @@ jobs: runs-on: ubuntu-latest steps: - - name: Clone flatpak repo + - name: Checkout Flatpak repository uses: actions/checkout@v4 with: repository: flathub/io.github.zen_browser.zen token: ${{ secrets.DEPLOY_KEY }} - - name: Download linux generic build + - name: Download Linux generic build uses: actions/download-artifact@v4 with: name: zen.linux-generic.tar.bz2 - - name: Update repo + - name: Update repository uses: actions/checkout@v4 with: path: zen-browser token: ${{ secrets.DEPLOY_KEY }} - - name: Download flatpak archive + - name: Download Flatpak archive run: | wget https://github.com/zen-browser/flatpak/releases/latest/download/archive.tar -O archive.tar - - name: Setup git + - name: Setup Git run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - - name: Prepare flatpak manifest + - name: Prepare Flatpak manifest run: | python3 ./zen-browser/scripts/prepare-flatpak-release.py \ --flatpak-archive archive.tar \ @@ -640,14 +649,14 @@ jobs: rm -rf archive.tar rm -rf zen.linux-generic.tar.bz2 - - name: Upload flatpak manifest + - name: Upload Flatpak manifest uses: actions/upload-artifact@v4 with: name: io.github.zen_browser.zen.yml path: ./io.github.zen_browser.zen.yml - name: Create pull request - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 env: GIT_TRACE: 1 GIT_CURL_VERBOSE: 1 @@ -672,13 +681,13 @@ jobs: runs-on: macos-latest steps: - - name: Set up Homebrew + - name: Setup Homebrew uses: Homebrew/actions/setup-homebrew@master with: cask: true test-bot: false - - name: Setup git + - name: Setup Git uses: Homebrew/actions/git-user-config@master with: username: zen-browser-auto diff --git a/.github/workflows/clear-cache.yml b/.github/workflows/clear-cache.yml index 4972601d..1bed1ec5 100644 --- a/.github/workflows/clear-cache.yml +++ b/.github/workflows/clear-cache.yml @@ -9,9 +9,10 @@ permissions: jobs: clear-cache: runs-on: ubuntu-latest + steps: - name: Clear cache - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | console.log("About to clear") @@ -19,12 +20,14 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }) + for (const cache of caches.data.actions_caches) { console.log(cache) - github.rest.actions.deleteActionsCacheById({ + await github.rest.actions.deleteActionsCacheById({ owner: context.repo.owner, repo: context.repo.repo, cache_id: cache.id, }) } + console.log("Clear completed") diff --git a/.github/workflows/linux-release-build.yml b/.github/workflows/linux-release-build.yml index ea46d01c..75ee474b 100644 --- a/.github/workflows/linux-release-build.yml +++ b/.github/workflows/linux-release-build.yml @@ -1,4 +1,5 @@ name: Linux Release Build + on: workflow_call: inputs: @@ -13,7 +14,6 @@ on: jobs: build-linux: - permissions: contents: write runs-on: ubuntu-latest @@ -27,21 +27,20 @@ jobs: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB tool-cache: false - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - - name: Setup git + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup Git run: | git config --global user.email "mauro-balades@users.noreply.github.com" git config --global user.name "mauro-balades" @@ -51,7 +50,7 @@ jobs: set -x sudo apt-get update --fix-missing sudo apt-get update - sudo apt-get install dos2unix yasm nasm build-essential libgtk2.0-dev libpython3-dev m4 uuid libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdrm-dev libdbus-glib-1-dev libdbus-glib-1-dev libgtk-3-dev libpulse-dev libx11-xcb-dev libxt-dev xvfb lld llvm + sudo apt-get install -y dos2unix yasm nasm build-essential libgtk2.0-dev libpython3-dev m4 uuid libasound2-dev libcurl4-openssl-dev libdbus-1-dev libdrm-dev libdbus-glib-1-dev libgtk-3-dev libpulse-dev libx11-xcb-dev libxt-dev xvfb lld llvm - name: Configure sccache uses: actions/github-script@v7 @@ -60,7 +59,7 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Install sccache + - name: Setup sccache env: LINK: https://github.com/mozilla/sccache/releases/download SCCACHE_VERSION: 0.2.13 @@ -72,13 +71,12 @@ jobs: echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Save sccache - uses: actions/cache@v3 - continue-on-error: false + uses: actions/cache@v4 with: path: /home/runner/.cache/sccache key: ${{ runner.os }}-sccache - - name: Install pnpm + - name: Setup pnpm run: npm install -g pnpm - name: Get pnpm store directory @@ -91,13 +89,13 @@ jobs: run: | pnpm install - - name: Load surfer CI setup + - name: Load Surfer CI setup run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} - - name: Download firefox source and dependencies + - name: Download Firefox source and dependencies run: pnpm surfer download - - name: Fix rust version + - name: Fix Rust version run: | # Install a rust version compatible with LLVM 18 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.79 @@ -152,19 +150,19 @@ jobs: mv dist/zen-*.tar.bz2 "zen.linux-${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'aarch64' }}.tar.bz2" mv dist/output.mar linux${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-aarch64' || '' }}.mar - - name: Upload binary + - name: Upload build artifact (binary) uses: actions/upload-artifact@v4 with: name: zen.linux-${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'aarch64' }}.tar.bz2 path: ./zen.linux-${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'aarch64' }}.tar.bz2 - - name: Upload mar + - name: Upload build artifact (.mar) uses: actions/upload-artifact@v4 with: name: linux${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-aarch64' || '' }}.mar path: ./linux${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-aarch64' || '' }}.mar - - name: Upload update manifests + - name: Upload build artifact (update manifests) uses: actions/upload-artifact@v4 with: name: linux_update_manifest_${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'aarch64' }} diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index 55c09ffc..538ffce0 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -1,4 +1,5 @@ name: macOS Release Build + on: workflow_call: inputs: @@ -14,29 +15,31 @@ on: jobs: mac-build: name: Build macOS - ${{ matrix.arch }} - runs-on: macos-14 + strategy: fail-fast: false matrix: arch: [x86_64, aarch64] steps: - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 20 - - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - - name: Setup git + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Setup Git run: | git config --global user.email "mauro-balades@users.noreply.github.com" git config --global user.name "mauro-balades" @@ -44,49 +47,38 @@ jobs: - name: Install system dependencies run: | brew update - brew install cairo sccache gnu-tar mercurial sudo pip install setuptools - # completly uninstall python3 and python3.12 brew uninstall --ignore-dependencies python3.12 -f export PATH="$(python3 -m site --user-base)/bin":$PATH python3 -m pip install --user mercurial - rm '/usr/local/bin/2to3-3.11' # fix Could not symlink bin/2to3-3.11 - rm '/usr/local/bin/2to3-3.12' # fix Could not symlink bin/2to3-3.12 - rm /usr/local/bin/2to3 # fix Could not symlink bin/2to3 - rm '/usr/local/bin/idle3.11' #fix Could not symlink bin/idle3.11 - rm '/usr/local/bin/idle3.12' # fix Could not symlink bin/idle3.12 - rm '/usr/local/bin/idle3' # fix Could not symlink bin/idle3 - rm '/usr/local/bin/pydoc3.11' # fix Could not symlink bin/pydoc3.11 - rm '/usr/local/bin/pydoc3.12' # fix Could not symlink bin/pydoc3.12 - rm '/usr/local/bin/pydoc3' # fix Could not symlink bin/pydoc3 - rm '/usr/local/bin/python3.11' # fix Could not symlink bin/python3.11 - rm '/usr/local/bin/python3.12' # fix Could not symlink bin/python3.12 - rm '/usr/local/bin/python3' # fix Could not symlink bin/python3 - rm '/usr/local/bin/python3.11-config' # fix Could not symlink bin/python3.11-config - rm '/usr/local/bin/python3.12-config' # fix Could not symlink bin/python3.12-config - rm '/usr/local/bin/python3-config' # fix Could not symlink bin/python3-config + rm '/usr/local/bin/2to3-3.11' '/usr/local/bin/2to3-3.12' '/usr/local/bin/2to3' + rm '/usr/local/bin/idle3.11' '/usr/local/bin/idle3.12' '/usr/local/bin/idle3' + rm '/usr/local/bin/pydoc3.11' '/usr/local/bin/pydoc3.12' '/usr/local/bin/pydoc3' + rm '/usr/local/bin/python3.11' '/usr/local/bin/python3.12' '/usr/local/bin/python3' + rm '/usr/local/bin/python3.11-config' '/usr/local/bin/python3.12-config' '/usr/local/bin/python3-config' brew install watchman curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.79 source $HOME/.cargo/env + if test "${{ matrix.arch }}" = "aarch64"; then rustup target add aarch64-apple-darwin else rustup target add x86_64-apple-darwin fi - - name: Force usage fo gnu-tar + - name: Force usage of gnu-tar run: | echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.bash_profile echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh source ~/.bash_profile - - name: Install pnpm + - name: Setup pnpm run: npm install -g pnpm - name: Get pnpm store directory @@ -102,7 +94,7 @@ jobs: - name: Load surfer CI setup run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} - - name: Download firefox source and dependancies + - name: Download Firefox source and dependencies run: pnpm surfer download - name: Bootstrap @@ -116,13 +108,12 @@ jobs: - name: Import env: SURFER_COMPAT: ${{ matrix.arch }} - run: | - pnpm surfer import --verbose + run: pnpm surfer import --verbose - name: Build language packs run: sh scripts/download-language-packs.sh - - name: build Zen + - name: Build Zen env: SURFER_COMPAT: ${{ matrix.arch }} run: | @@ -138,8 +129,8 @@ jobs: export SURFER_PLATFORM="darwin" sh .github/workflows/src/release-build.sh - - name: import APPLE DEVELOPER ID CERTIFICATE for .app - uses: apple-actions/import-codesign-certs@v3 + - name: Import APPLE DEVELOPER ID CERTIFICATE for .app + uses: Apple-Actions/import-codesign-certs@v3 with: p12-file-base64: ${{ secrets.macOS_CERTIFICATES_P12_For_App_BASE64 }} p12-password: ${{ secrets.macOS_CERTIFICATES_P12_PASSWORD }} @@ -156,7 +147,7 @@ jobs: run: | mv ./dist/output.mar macos-${{ matrix.arch }}.mar - - name: Sign to .dmg + - name: Sign .dmg run: | set -ex hdiutil convert ./dist/*.dmg -format UDZO -imagekey zlib-level=9 -o zen.macos-${{ matrix.arch }}.dmg @@ -169,19 +160,19 @@ jobs: --wait xcrun stapler staple "zen.macos-${{ matrix.arch }}.dmg" - - name: Upload artifact + - name: Upload build artifact uses: actions/upload-artifact@v4 with: name: zen.macos-${{ matrix.arch }}.dmg path: ./zen.macos-${{ matrix.arch }}.dmg - - name: Upload mar + - name: Upload build artifact (.mar) uses: actions/upload-artifact@v4 with: name: macos-${{ matrix.arch }}.mar path: ./macos-${{ matrix.arch }}.mar - - name: Upload update manifests + - name: Upload build artifact (update manifests) uses: actions/upload-artifact@v4 with: name: macos_update_manifest_${{ matrix.arch }} diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index aa18c621..e48b3acf 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -1,4 +1,3 @@ - name: Pull request test on: @@ -11,26 +10,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: - submodules: 'recursive' + submodules: recursive - - name: Install Node.js and pnpm - uses: actions/setup-node@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: 20 - - name: Install pnpm + - name: Setup pnpm run: npm install -g pnpm - name: Install Surfer - run: | - npm i -g @zen-browser/surfer + run: npm i -g @zen-browser/surfer - - name: Download firefox - run: | - surfer download + - name: Download Firefox and dependencies + run: surfer download - name: Import patches - run: | - surfer i + run: surfer i diff --git a/.github/workflows/src/release-build.sh b/.github/workflows/src/release-build.sh index 818ed93f..d1825ec1 100644 --- a/.github/workflows/src/release-build.sh +++ b/.github/workflows/src/release-build.sh @@ -1,14 +1,14 @@ +#!/bin/bash + set -ex -if command -v apt-get &> /dev/null -then +if command -v apt-get &> /dev/null; then sudo apt-get update sudo apt-get install -y xvfb fi ulimit -n 4096 -# Check if xfvb is installed if ! command -v Xvfb &> /dev/null; then if ! test "$ZEN_CROSS_COMPILING"; then Xvfb :2 -screen 0 1024x768x24 & @@ -16,10 +16,11 @@ if ! command -v Xvfb &> /dev/null; then export DISPLAY=:2 fi export ZEN_RELEASE=1 - pnpm build + pnpm build else echo "Xvfb could not be found, running without it" echo "ASSUMING YOU ARE RUNNING THIS ON MACOS" + set -v export ZEN_RELEASE=1 pnpm build diff --git a/.github/workflows/twilight-release-schedule.yml b/.github/workflows/twilight-release-schedule.yml index 431bd662..417f70a6 100644 --- a/.github/workflows/twilight-release-schedule.yml +++ b/.github/workflows/twilight-release-schedule.yml @@ -1,4 +1,5 @@ name: Zen Twilight Scheduled Releases + on: schedule: - cron: '0 0 * * *' @@ -20,11 +21,11 @@ jobs: runs-on: ubuntu-latest needs: twilight-release-schedule steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 - - name: Install Node.js and pnpm - uses: actions/setup-node@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: 20 diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml index baf55228..c5e82caf 100644 --- a/.github/workflows/update-submodules.yml +++ b/.github/workflows/update-submodules.yml @@ -1,4 +1,3 @@ - name: Update Components Submodules on: @@ -6,25 +5,27 @@ on: branches: - dev workflow_dispatch: - workflow_call: # This is a custom event that we will trigger manually + workflow_call: jobs: update-submodules: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[skip ci]')" + steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: - submodules: 'recursive' + submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - name: Update submodules run: | git submodule update --remote --merge - - uses: stefanzweifel/git-auto-commit-action@v4 + - name: Commit + uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: "[skip ci] 📦 Update Submodules!" + commit_message: "[skip ci] 📦 Update submodules" commit_user_name: Zen Browser Robot commit_user_email: zen-browser-auto@users.noreply.github.com diff --git a/.github/workflows/windows-profile-build.yml b/.github/workflows/windows-profile-build.yml index fbf3aa5f..aa1487c7 100644 --- a/.github/workflows/windows-profile-build.yml +++ b/.github/workflows/windows-profile-build.yml @@ -1,4 +1,5 @@ name: Windows PGO Builds + on: workflow_call: inputs: @@ -17,37 +18,44 @@ on: jobs: windows-profile-build: - name: Windows Profile Build - ${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'arm64' }} + name: | + Windows Profile Build - ${{ matrix.arch == 'x86_64' && 'generic' || + matrix.arch == 'x86_64-v3' && 'specific' || + matrix.arch == 'aarch64' && 'arm64' }} strategy: fail-fast: false matrix: arch: [x86_64, x86_64-v3, aarch64] + runs-on: windows-latest - # Script edited from https://github.com/Floorp-Projects/Floorp/blob/ESR115/.github/workflows/window-generate-profile-data-and-jarlog.yml + steps: - - name: Checkout + - name: Checkout repository uses: actions/checkout@v4 - - name: Install Node.js and pnpm - uses: actions/setup-node@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 with: node-version: 20 - - name: Setup git + - name: Setup Git run: | git config --global user.email "mauro-balades@users.noreply.github.com" git config --global user.name "mauro-balades" - - name: Install pnpm + + - name: Setup pnpm run: npm install -g pnpm - name: Install Surfer - run: | - npm i -g @zen-browser/surfer - - uses: actions/download-artifact@v4 - name: Download artifact + run: npm i -g @zen-browser/surfer + + - name: Download artifact + uses: actions/download-artifact@v4 with: path: C:\artifact - name: ${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'generic' }}-zen-windows-profile-data-and-jarlog.zip + name: ${{ matrix.arch == 'x86_64' && 'generic' || + matrix.arch == 'x86_64-v3' && 'specific' || + matrix.arch == 'aarch64' && 'generic' }}-zen-windows-profile-data-and-jarlog.zip - name: Unpack artifact run: | @@ -55,11 +63,13 @@ jobs: ls Expand-Archive -Path .\${{ inputs.profile-data-path-archive }} -DestinationPath C:\artifact ls + - name: Setup run: | - (New-Object System.Net.WebClient).DownloadFile("https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe","C:\MozillaBuildSetup-Latest.exe") + (New-Object System.Net.WebClient).DownloadFile("https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe", "C:\MozillaBuildSetup-Latest.exe") C:\MozillaBuildSetup-Latest.exe /S | out-null - - name: Download firefox + + - name: Download Firefox and dependencies run: | git config --global core.safecrlf false pnpm surfer download @@ -73,7 +83,7 @@ jobs: run: | ls $Env:USE_MINTTY = "0" - $workspace_dir_current = [regex]::replace($env:GITHUB_WORKSPACE, "^([A-Z]):", { "/" + $args.value.Substring(0, 1).toLower() }) -replace "\\","/" + $workspace_dir_current = [regex]::replace($env:GITHUB_WORKSPACE, "^([A-Z]):", { "/" + $args.value.Substring(0, 1).toLower() }) -replace "\\", "/" $workspace_dir = $workspace_dir_current + "/engine" echo $workspace_dir echo "cd $workspace_dir" '' >> mozilla-build-run.sh @@ -83,9 +93,9 @@ jobs: echo 'LLVM_PROFDATA=/c/Users/runneradmin/.mozbuild/clang/bin/llvm-profdata.exe JARLOG_FILE=en-US.log ./mach python build/pgo/profileserver.py --binary /c/artifact/zen/zen.exe' '' >> mozilla-build-run.sh C:\mozilla-build\start-shell.bat $workspace_dir_current\mozilla-build-run.sh - - name: 🐛 Debug Session + - name: Debug session if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 + uses: WarpBuilds/action-debugger@v1.3 timeout-minutes: 15 - name: Move profile data @@ -95,10 +105,12 @@ jobs: mv engine/merged.profdata merged.profdata mv engine/en-US.log en-US.log - - name: Publish artifacts + - name: Upload artifacts uses: actions/upload-artifact@v4 with: path: | merged.profdata en-US.log - name: windows-profdata-${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'arm64' }} + name: windows-profdata-${{ matrix.arch == 'x86_64' && 'generic' || + matrix.arch == 'x86_64-v3' && 'specific' || + matrix.arch == 'aarch64' && 'arm64' }} diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index 1f5a2541..07e36beb 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -1,4 +1,5 @@ name: Windows Release Build + on: workflow_call: inputs: @@ -22,6 +23,7 @@ jobs: windows-build: name: Build Windows - ${{ matrix.arch == 'x86_64' && 'Generic' || matrix.arch == 'x86_64-v3' && 'Specific' || matrix.arch == 'aarch64' && 'ARM64' }} runs-on: ubuntu-latest + strategy: fail-fast: false matrix: @@ -31,24 +33,23 @@ jobs: - name: Free Disk Space (Ubuntu) uses: jlumbroso/free-disk-space@main with: - # this might remove tools that are actually needed, - # if set to "true" but frees about 6 GB tool-cache: false - - name: Install Node.js and pnpm - uses: actions/setup-node@v3 - with: - node-version: 20 - - - uses: actions/checkout@v4 + - name: Checkout repository + uses: actions/checkout@v4 with: submodules: recursive token: ${{ secrets.DEPLOY_KEY }} - - name: Install pnpm + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Setup pnpm run: npm install -g pnpm - - name: Setup git + - name: Setup Git run: | git config --global user.email "mauro-balades@users.noreply.github.com" git config --global user.name "mauro-balades" @@ -57,13 +58,13 @@ jobs: run: | pnpm install - - name: Load surfer CI setup + - name: Load Surfer CI setup run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} - - name: Download + - name: Download Firefox and dependencies run: pnpm surfer download - - name: 'win-cross Cache' + - name: win-cross Cache env: SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 id: cache-win-cross @@ -79,18 +80,16 @@ jobs: core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Setup For Windows + - name: Setup for Windows if: steps.cache-win-cross.outputs.cache-hit != 'true' run: | set -x mkdir -p ~/win-cross cd engine/ - echo Setup wine aria2c "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-1.toolchains.v3.linux64-wine.latest/artifacts/public%2Fbuild%2Fwine.tar.zst" -o wine.tar.zst tar --zstd -xvf wine.tar.zst -C ~/win-cross rm wine.tar.zst - echo Setup Visual Studio sudo apt install -y msitools python3-pip ./mach python --virtualenv build taskcluster/scripts/misc/get_vs.py build/vs/vs2022.yaml ~/win-cross/vs2022 @@ -99,32 +98,25 @@ jobs: run: | set -x cd engine/ - chmod -R +x "$(echo ~)/win-cross/vs2022" || true - cd .. npm install -g pnpm export SURFER_PLATFORM="win32" pnpm surfer bootstrap - cd engine/ ls ~/.mozbuild/clang/lib/clang/ echo "export LIB=\"$(cd ~/.mozbuild/clang/lib/clang/* && cd lib/windows && pwd)\"" >> ../configs/common/mozconfig cat ../configs/common/mozconfig - sudo apt-get update sudo apt-get install dos2unix - ls ~/win-cross/wine || true ls ~/win-cross/vs2022 || true - - name: setup Rust + - name: Setup Rust run: | cd engine/ - # Install a rust version compatible with 17 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.79 source $HOME/.cargo/env - if test "${{ matrix.arch }}" = "aarch64"; then rustup target add aarch64-pc-windows-msvc else @@ -132,9 +124,7 @@ jobs: fi cargo install cargo-download cargo download -x windows=0.58.0 - #? https://github.com/mozilla/sccache#known-caveats export CARGO_INCREMENTAL=0 - echo "" >> ../configs/common/mozconfig echo "export MOZ_WINDOWS_RS_DIR=$(pwd)/windows-0.58.0" >> ../configs/common/mozconfig @@ -146,8 +136,8 @@ jobs: - name: Build language packs run: sh scripts/download-language-packs.sh - - uses: actions/download-artifact@v4 - name: Download artifact if use profdata + - name: Download artifact (if use profdata) + uses: actions/download-artifact@v4 if: ${{ !inputs.generate-gpo }} with: path: ~/artifact @@ -159,7 +149,6 @@ jobs: ls ~/artifact ls ~/artifact/en-US.log ls ~/artifact/merged.profdata - chmod +x ~/artifact/en-US.log chmod +x ~/artifact/merged.profdata @@ -187,9 +176,9 @@ jobs: ls ./dist ls . - - name: 🐛 Debug Session + - name: Debug session if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 + uses: WarpBuilds/action-debugger@v1.3 timeout-minutes: 15 - name: Move package for PGO upload @@ -205,7 +194,7 @@ jobs: mv ./dist/output.mar windows${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-arm64' || '' }}.mar mv ./dist/zen.installer.exe ./zen.installer${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-arm64' || '' }}.exe - - name: Upload PGO build + - name: Upload artifact (PGO) uses: actions/upload-artifact@v4 if: ${{ inputs.generate-gpo }} with: @@ -231,28 +220,28 @@ jobs: name: windows-x64-obj-${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'arm64' }} path: engine/obj-${{ matrix.arch == 'aarch64' && 'aarch64' || 'x86_64' }}-pc-windows-msvc/ - - name: Upload zip file if twilight branch + - name: Upload artifact (if Twilight branch, binary) if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-gpo }} uses: actions/upload-artifact@v4 with: name: zen.win-${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'arm64' }}.zip path: ./zen.win-${{ matrix.arch == 'x86_64' && 'generic' || matrix.arch == 'x86_64-v3' && 'specific' || matrix.arch == 'aarch64' && 'arm64' }}.zip - - name: Upload installer if twilight branch + - name: Upload artifact (if Twilight branch, installer) if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-gpo }} uses: actions/upload-artifact@v4 with: name: zen.installer${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-arm64' || '' }}.exe path: ./zen.installer${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-arm64' || '' }}.exe - - name: Upload mar if twilight branch + - name: Upload artifact (if Twilight branch, .mar) if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-gpo }} uses: actions/upload-artifact@v4 with: name: windows${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-arm64' || '' }}.mar path: ./windows${{ matrix.arch == 'x86_64' && '-generic' || matrix.arch == 'aarch64' && '-arm64' || '' }}.mar - - name: Upload update manifests if twilight branch + - name: Upload artifact (if Twilight branch, update manifests) if: ${{ inputs.release-branch == 'twilight' && !inputs.generate-gpo }} uses: actions/upload-artifact@v4 with: