1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 21:49:58 +02:00

Replace pnpm with npm in workflows and scripts for consistency across the project

This commit is contained in:
mr. M 2025-02-03 21:20:29 +01:00
parent ff1c57c5a3
commit 24d8e7a5d7
No known key found for this signature in database
GPG key ID: CBD57A2AEDBDA1FB
12 changed files with 50 additions and 116 deletions

View file

@ -142,18 +142,9 @@ jobs:
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
- name: Setup pnpm
run: npm install -g pnpm
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies - name: Install dependencies
run: | run: |
pnpm install npm install
- name: Setup Surfer - name: Setup Surfer
run: | run: |
@ -162,12 +153,12 @@ jobs:
- name: Bump version - name: Bump version
if: ${{ inputs.update_version && inputs.update_branch == 'release' }} if: ${{ inputs.update_version && inputs.update_branch == 'release' }}
run: | run: |
pnpm surfer ci --brand ${{ inputs.update_branch }} --bump prerelease npm run surfer ci --brand ${{ inputs.update_branch }} --bump prerelease
- name: Bump version without new version - name: Bump version without new version
if: ${{ !inputs.update_version || inputs.update_branch == 'twilight' }} if: ${{ !inputs.update_version || inputs.update_branch == 'twilight' }}
run: | run: |
pnpm surfer ci --brand ${{ inputs.update_branch }} npm run surfer ci --brand ${{ inputs.update_branch }}
- name: Debug - name: Debug
run: | run: |
@ -211,18 +202,9 @@ jobs:
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
- name: Setup pnpm
run: npm install -g pnpm
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies - name: Install dependencies
run: | run: |
pnpm install npm install
- name: Setup Surfer - name: Setup Surfer
run: | run: |
@ -231,14 +213,14 @@ jobs:
- name: Activate Surfer CLI - name: Activate Surfer CLI
run: | 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 }} npm run surfer ci --brand ${{ inputs.update_branch }} --display-version ${{ needs.build-data.outputs.version }}
- name: Check version - name: Check version
run: | run: |
echo "$(pwd)" echo "$(pwd)"
ls . ls .
echo "version=$(pnpm surfer get version | xargs)" >> $GITHUB_OUTPUT echo "version=$(npm run surfer get version | xargs)" >> $GITHUB_OUTPUT
if [[ $(pnpm surfer get version | xargs) == ${{ needs.build-data.outputs.version }} ]]; then if [[ $(npm run surfer get version | xargs) == ${{ needs.build-data.outputs.version }} ]]; then
echo ">>> Version matches" echo ">>> Version matches"
else else
echo ">>> Version mismatch" echo ">>> Version mismatch"
@ -268,27 +250,18 @@ jobs:
git config --global user.email "mauro-balades@users.noreply.github.com" git config --global user.email "mauro-balades@users.noreply.github.com"
git config --global user.name "mauro-balades" git config --global user.name "mauro-balades"
- name: Setup pnpm
run: npm install -g pnpm
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies - name: Install dependencies
run: | run: |
pnpm install npm 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 }} run: npm run surfer ci --brand ${{ inputs.update_branch }} --display-version ${{ needs.build-data.outputs.version }}
- name: Download Firefox source and dependencies - name: Download Firefox source and dependencies
run: pnpm surfer download --verbose run: npm run download --verbose
- name: Import - name: Import
run: pnpm surfer import --verbose run: npm run import -- --verbose
- name: Compress - name: Compress
run: | run: |
@ -400,7 +373,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
npm install -g pnpm npm install
sudo apt-get update sudo apt-get update
sudo apt-get -y install libfuse2 desktop-file-utils appstream sudo apt-get -y install libfuse2 desktop-file-utils appstream

View file

@ -27,11 +27,8 @@ jobs:
- name: Setup autopep8 - name: Setup autopep8
run: sudo apt install python3-autopep8 run: sudo apt install python3-autopep8
- name: Setup pnpm
run: npm install -g pnpm
- name: Install dependencies - name: Install dependencies
run: pnpm install run: npm install
- name: Lint - name: Lint
run: pnpm lint run: npm run lint

View file

@ -81,24 +81,15 @@ jobs:
path: /home/runner/.cache/sccache path: /home/runner/.cache/sccache
key: ${{ runner.os }}-sccache key: ${{ runner.os }}-sccache
- name: Setup pnpm
run: npm install -g pnpm
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies - name: Install dependencies
run: | run: |
pnpm install npm install
- name: Load Surfer CI setup - name: Load Surfer CI setup
run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} run: npm run 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 run: npm run download
- name: Fix Rust version - name: Fix Rust version
run: | run: |
@ -115,7 +106,7 @@ jobs:
- name: Import - name: Import
env: env:
SURFER_COMPAT: ${{ matrix.arch }} SURFER_COMPAT: ${{ matrix.arch }}
run: pnpm surfer import run: npm run import
- name: Build language packs - name: Build language packs
run: sh scripts/download-language-packs.sh run: sh scripts/download-language-packs.sh
@ -146,7 +137,7 @@ jobs:
run: | run: |
export SURFER_PLATFORM="linux" export SURFER_PLATFORM="linux"
export ZEN_RELEASE=1 export ZEN_RELEASE=1
pnpm package npm run package
- name: Rename artifacts - name: Rename artifacts
run: | run: |

View file

@ -81,24 +81,15 @@ jobs:
echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh
source ~/.bash_profile source ~/.bash_profile
- name: Setup pnpm
run: npm install -g pnpm
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies - name: Install dependencies
run: | run: |
pnpm install npm install
- name: Load surfer CI setup - name: Load surfer CI setup
run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} run: npm run 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 run: npm run download
- name: Bootstrap - name: Bootstrap
run: | run: |
@ -111,7 +102,7 @@ jobs:
- name: Import - name: Import
env: env:
SURFER_COMPAT: ${{ matrix.arch }} SURFER_COMPAT: ${{ matrix.arch }}
run: pnpm surfer import --verbose run: npm run import -- --verbose
- name: Build language packs - name: Build language packs
run: sh scripts/download-language-packs.sh run: sh scripts/download-language-packs.sh
@ -134,7 +125,7 @@ jobs:
run: | run: |
export SURFER_PLATFORM="darwin" export SURFER_PLATFORM="darwin"
export ZEN_RELEASE=1 export ZEN_RELEASE=1
pnpm package npm run package
- name: Rename artifacts - name: Rename artifacts
run: | run: |

View file

@ -68,24 +68,15 @@ jobs:
echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh
source ~/.bash_profile source ~/.bash_profile
- name: Setup pnpm
run: npm install -g pnpm
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Install dependencies - name: Install dependencies
run: | run: |
pnpm install npm install
- name: Load surfer CI setup - name: Load surfer CI setup
run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} run: npm run 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 run: npm run download
- name: Bootstrap - name: Bootstrap
run: | run: |
@ -96,13 +87,13 @@ jobs:
cd .. cd ..
- name: Import - name: Import
run: pnpm surfer import run: npm run import
- name: Populate mozconfig - name: Populate mozconfig
env: env:
SURFER_MOZCONFIG_ONLY: true SURFER_MOZCONFIG_ONLY: true
run: | run: |
pnpm build npm run build
cd engine cd engine
./mach configure ./mach configure
@ -252,7 +243,7 @@ jobs:
export MAR=$(pwd)/zen-macos-host-mar export MAR=$(pwd)/zen-macos-host-mar
chmod +x $MAR chmod +x $MAR
echo "MAR=$MAR" echo "MAR=$MAR"
pnpm package --verbose npm run package -- --verbose
mv ./dist/output.mar ./macos.mar mv ./dist/output.mar ./macos.mar
- name: Upload build artifact (.mar) - name: Upload build artifact (.mar)

View file

@ -19,14 +19,11 @@ jobs:
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
- name: Setup pnpm
run: npm install -g pnpm
- name: Install Surfer - name: Install Surfer
run: npm i -g @zen-browser/surfer run: npm i -g @zen-browser/surfer
- name: Install dependencies - name: Install dependencies
run: pnpm install run: npm install
- name: Download Firefox and dependencies - name: Download Firefox and dependencies
run: surfer download run: surfer download

View file

@ -17,12 +17,12 @@ if command -v Xvfb &> /dev/null; then
export DISPLAY=:2 export DISPLAY=:2
fi fi
export ZEN_RELEASE=1 export ZEN_RELEASE=1
pnpm build npm run build
else else
echo "Xvfb could not be found, running without it" echo "Xvfb could not be found, running without it"
echo "ASSUMING YOU ARE RUNNING THIS ON MACOS" echo "ASSUMING YOU ARE RUNNING THIS ON MACOS"
set -v set -v
export ZEN_RELEASE=1 export ZEN_RELEASE=1
pnpm build npm run build
fi fi

View file

@ -41,14 +41,11 @@ jobs:
git config --global user.email "mauro-balades@users.noreply.github.com" git config --global user.email "mauro-balades@users.noreply.github.com"
git config --global user.name "mauro-balades" git config --global user.name "mauro-balades"
- name: Setup pnpm
run: npm install -g pnpm
- name: Install Surfer - name: Install Surfer
run: npm i -g @zen-browser/surfer run: npm i -g @zen-browser/surfer
- name: Load Surfer CI setup - name: Load Surfer CI setup
run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} run: npm run surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }}
- name: Download artifact - name: Download artifact
if: ${{ matrix.arch == 'x86_64' }} if: ${{ matrix.arch == 'x86_64' }}
@ -74,13 +71,13 @@ jobs:
if: ${{ matrix.arch == 'x86_64' }} if: ${{ matrix.arch == 'x86_64' }}
run: | run: |
git config --global core.safecrlf false git config --global core.safecrlf false
pnpm surfer download npm run download
- name: Import patches - name: Import patches
if: ${{ matrix.arch == 'x86_64' }} if: ${{ matrix.arch == 'x86_64' }}
env: env:
SURFER_NO_BRANDING_PATCH: true SURFER_NO_BRANDING_PATCH: true
run: pnpm surfer import run: npm run import
- name: Generate - name: Generate
if: ${{ matrix.arch == 'x86_64' }} if: ${{ matrix.arch == 'x86_64' }}

View file

@ -52,9 +52,6 @@ jobs:
with: with:
node-version-file: '.nvmrc' node-version-file: '.nvmrc'
- name: Setup pnpm
run: npm install -g pnpm
- name: Setup Git - name: Setup Git
run: | run: |
git config --global user.email "mauro-balades@users.noreply.github.com" git config --global user.email "mauro-balades@users.noreply.github.com"
@ -62,16 +59,16 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
pnpm install npm install
sudo apt-get update sudo apt-get update
sudo apt-get install -y python3 python3-pip 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 --fix-missing sudo apt-get install -y python3 python3-pip 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 --fix-missing
- name: Load Surfer CI setup - name: Load Surfer CI setup
run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }} run: npm run surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }}
- name: Download Firefox and dependencies - name: Download Firefox and dependencies
if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }}
run: pnpm surfer download run: npm run download
- name: win-cross Cache - name: win-cross Cache
env: env:
@ -152,9 +149,8 @@ jobs:
cd engine/ cd engine/
chmod -R +x "$(echo ~)/win-cross/vs2022" || true chmod -R +x "$(echo ~)/win-cross/vs2022" || true
cd .. cd ..
npm install -g pnpm
export SURFER_PLATFORM="win32" export SURFER_PLATFORM="win32"
pnpm surfer bootstrap npm run bootstrap
cd engine/ cd engine/
ls ~/.mozbuild/clang/lib/clang/ ls ~/.mozbuild/clang/lib/clang/
echo "export LIB=\"$(cd ~/.mozbuild/clang/lib/clang/* && cd lib/windows && pwd)\"" >> ../configs/common/mozconfig echo "export LIB=\"$(cd ~/.mozbuild/clang/lib/clang/* && cd lib/windows && pwd)\"" >> ../configs/common/mozconfig
@ -185,7 +181,7 @@ jobs:
if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }}
env: env:
SURFER_COMPAT: ${{ matrix.arch }} SURFER_COMPAT: ${{ matrix.arch }}
run: pnpm surfer import --verbose run: npm run import -- --verbose
- name: Build language packs - name: Build language packs
if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }} if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }}
@ -235,8 +231,8 @@ jobs:
export SURFER_PLATFORM="win32" export SURFER_PLATFORM="win32"
export ZEN_CROSS_COMPILING=1 export ZEN_CROSS_COMPILING=1
export ZEN_RELEASE=1 export ZEN_RELEASE=1
pnpm package npm run package
mv ./dist/zen-$(pnpm surfer get version | xargs).en-US.win64${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}.zip zen.win64.zip mv ./dist/zen-$(npm run surfer get version | xargs).en-US.win64${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}.zip zen.win64.zip
ls ./dist ls ./dist
ls . ls .

View file

@ -29,7 +29,7 @@ echo "Downloaded x86_64 artifacts"
mkdir engine\obj-x86_64-pc-windows-msvc\ -ErrorAction SilentlyContinue mkdir engine\obj-x86_64-pc-windows-msvc\ -ErrorAction SilentlyContinue
pnpm surfer ci --brand release npm run surfer ci --brand release
function SignAndPackage($name) { function SignAndPackage($name) {
echo "Executing on $name" echo "Executing on $name"
@ -53,7 +53,7 @@ function SignAndPackage($name) {
} }
echo "Compat Mode? $env:SURFER_COMPAT" echo "Compat Mode? $env:SURFER_COMPAT"
pnpm surfer package --verbose npm run surfer package --verbose
# In the release script, we do the following: # In the release script, we do the following:
# tar -xvf .github/workflows/object/windows-x64-signed-x86_64.tar.gz -C windows-x64-signed-x86_64 # tar -xvf .github/workflows/object/windows-x64-signed-x86_64.tar.gz -C windows-x64-signed-x86_64

View file

@ -23,7 +23,8 @@
"pretty": "prettier . --write && autopep8 -r --in-place scripts/ src/", "pretty": "prettier . --write && autopep8 -r --in-place scripts/ src/",
"lint": "npx prettier . --check && autopep8 --diff scripts/ src/", "lint": "npx prettier . --check && autopep8 --diff scripts/ src/",
"prepare": "husky", "prepare": "husky",
"reset-ff": "surfer reset" "reset-ff": "surfer reset",
"surfer": "surfer"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -18,8 +18,8 @@ def update_rc(last_version: str):
with open("surfer.json", "w") as f: with open("surfer.json", "w") as f:
data["version"]["candidate"] = rc_version data["version"]["candidate"] = rc_version
json.dump(data, f, indent=2) json.dump(data, f, indent=2)
print("Download the new engine by running 'pnpm download'.") print("Download the new engine by running 'npm run download'.")
os.system("pnpm download") os.system("npm run download")
else: else:
print("No new Firefox RC version available.") print("No new Firefox RC version available.")
@ -28,7 +28,7 @@ def update_ff(is_rc: bool = False, last_version: str = ""):
"""Runs the npm command to update the 'ff' component.""" """Runs the npm command to update the 'ff' component."""
if is_rc: if is_rc:
return update_rc(last_version) return update_rc(last_version)
result = os.system("pnpm update-ff:raw") result = os.system("npm run update-ff:raw")
if result != 0: if result != 0:
raise RuntimeError("Failed to update 'ff' component.") raise RuntimeError("Failed to update 'ff' component.")