1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 14:55:30 +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:
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
run: |
pnpm install
npm install
- name: Setup Surfer
run: |
@ -162,12 +153,12 @@ jobs:
- name: Bump version
if: ${{ inputs.update_version && inputs.update_branch == 'release' }}
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
if: ${{ !inputs.update_version || inputs.update_branch == 'twilight' }}
run: |
pnpm surfer ci --brand ${{ inputs.update_branch }}
npm run surfer ci --brand ${{ inputs.update_branch }}
- name: Debug
run: |
@ -211,18 +202,9 @@ jobs:
with:
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
run: |
pnpm install
npm install
- name: Setup Surfer
run: |
@ -231,14 +213,14 @@ jobs:
- name: Activate Surfer CLI
run: |
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
run: |
echo "$(pwd)"
ls .
echo "version=$(pnpm surfer get version | xargs)" >> $GITHUB_OUTPUT
if [[ $(pnpm surfer get version | xargs) == ${{ needs.build-data.outputs.version }} ]]; then
echo "version=$(npm run surfer get version | xargs)" >> $GITHUB_OUTPUT
if [[ $(npm run surfer get version | xargs) == ${{ needs.build-data.outputs.version }} ]]; then
echo ">>> Version matches"
else
echo ">>> Version mismatch"
@ -268,27 +250,18 @@ jobs:
git config --global user.email "mauro-balades@users.noreply.github.com"
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
run: |
pnpm install
npm install
- 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
run: pnpm surfer download --verbose
run: npm run download --verbose
- name: Import
run: pnpm surfer import --verbose
run: npm run import -- --verbose
- name: Compress
run: |
@ -400,7 +373,7 @@ jobs:
- name: Install dependencies
run: |
npm install -g pnpm
npm install
sudo apt-get update
sudo apt-get -y install libfuse2 desktop-file-utils appstream

View file

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

View file

@ -81,24 +81,15 @@ jobs:
path: /home/runner/.cache/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
run: |
pnpm install
npm install
- 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
run: pnpm surfer download
run: npm run download
- name: Fix Rust version
run: |
@ -115,7 +106,7 @@ jobs:
- name: Import
env:
SURFER_COMPAT: ${{ matrix.arch }}
run: pnpm surfer import
run: npm run import
- name: Build language packs
run: sh scripts/download-language-packs.sh
@ -146,7 +137,7 @@ jobs:
run: |
export SURFER_PLATFORM="linux"
export ZEN_RELEASE=1
pnpm package
npm run package
- name: Rename artifacts
run: |

View file

@ -81,24 +81,15 @@ jobs:
echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh
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
run: |
pnpm install
npm install
- 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
run: pnpm surfer download
run: npm run download
- name: Bootstrap
run: |
@ -111,7 +102,7 @@ jobs:
- name: Import
env:
SURFER_COMPAT: ${{ matrix.arch }}
run: pnpm surfer import --verbose
run: npm run import -- --verbose
- name: Build language packs
run: sh scripts/download-language-packs.sh
@ -134,7 +125,7 @@ jobs:
run: |
export SURFER_PLATFORM="darwin"
export ZEN_RELEASE=1
pnpm package
npm run package
- name: Rename artifacts
run: |

View file

@ -68,24 +68,15 @@ jobs:
echo 'export PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"' >> ~/.zsh
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
run: |
pnpm install
npm install
- 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
run: pnpm surfer download
run: npm run download
- name: Bootstrap
run: |
@ -96,13 +87,13 @@ jobs:
cd ..
- name: Import
run: pnpm surfer import
run: npm run import
- name: Populate mozconfig
env:
SURFER_MOZCONFIG_ONLY: true
run: |
pnpm build
npm run build
cd engine
./mach configure
@ -252,7 +243,7 @@ jobs:
export MAR=$(pwd)/zen-macos-host-mar
chmod +x $MAR
echo "MAR=$MAR"
pnpm package --verbose
npm run package -- --verbose
mv ./dist/output.mar ./macos.mar
- name: Upload build artifact (.mar)

View file

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

View file

@ -17,12 +17,12 @@ if command -v Xvfb &> /dev/null; then
export DISPLAY=:2
fi
export ZEN_RELEASE=1
pnpm build
npm run 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
npm run build
fi

View file

@ -41,14 +41,11 @@ jobs:
git config --global user.email "mauro-balades@users.noreply.github.com"
git config --global user.name "mauro-balades"
- name: Setup pnpm
run: npm install -g pnpm
- name: Install Surfer
run: npm i -g @zen-browser/surfer
- 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
if: ${{ matrix.arch == 'x86_64' }}
@ -74,13 +71,13 @@ jobs:
if: ${{ matrix.arch == 'x86_64' }}
run: |
git config --global core.safecrlf false
pnpm surfer download
npm run download
- name: Import patches
if: ${{ matrix.arch == 'x86_64' }}
env:
SURFER_NO_BRANDING_PATCH: true
run: pnpm surfer import
run: npm run import
- name: Generate
if: ${{ matrix.arch == 'x86_64' }}

View file

@ -52,9 +52,6 @@ jobs:
with:
node-version-file: '.nvmrc'
- name: Setup pnpm
run: npm install -g pnpm
- name: Setup Git
run: |
git config --global user.email "mauro-balades@users.noreply.github.com"
@ -62,16 +59,16 @@ jobs:
- name: Install dependencies
run: |
pnpm install
npm install
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
- 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
if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }}
run: pnpm surfer download
run: npm run download
- name: win-cross Cache
env:
@ -152,9 +149,8 @@ jobs:
cd engine/
chmod -R +x "$(echo ~)/win-cross/vs2022" || true
cd ..
npm install -g pnpm
export SURFER_PLATFORM="win32"
pnpm surfer bootstrap
npm run bootstrap
cd engine/
ls ~/.mozbuild/clang/lib/clang/
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') }}
env:
SURFER_COMPAT: ${{ matrix.arch }}
run: pnpm surfer import --verbose
run: npm run import -- --verbose
- name: Build language packs
if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }}
@ -235,8 +231,8 @@ jobs:
export SURFER_PLATFORM="win32"
export ZEN_CROSS_COMPILING=1
export ZEN_RELEASE=1
pnpm package
mv ./dist/zen-$(pnpm surfer get version | xargs).en-US.win64${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}.zip zen.win64.zip
npm run package
mv ./dist/zen-$(npm run surfer get version | xargs).en-US.win64${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}.zip zen.win64.zip
ls ./dist
ls .

View file

@ -29,7 +29,7 @@ echo "Downloaded x86_64 artifacts"
mkdir engine\obj-x86_64-pc-windows-msvc\ -ErrorAction SilentlyContinue
pnpm surfer ci --brand release
npm run surfer ci --brand release
function SignAndPackage($name) {
echo "Executing on $name"
@ -53,7 +53,7 @@ function SignAndPackage($name) {
}
echo "Compat Mode? $env:SURFER_COMPAT"
pnpm surfer package --verbose
npm run surfer package --verbose
# 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

View file

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

View file

@ -18,8 +18,8 @@ def update_rc(last_version: str):
with open("surfer.json", "w") as f:
data["version"]["candidate"] = rc_version
json.dump(data, f, indent=2)
print("Download the new engine by running 'pnpm download'.")
os.system("pnpm download")
print("Download the new engine by running 'npm run download'.")
os.system("npm run download")
else:
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."""
if is_rc:
return update_rc(last_version)
result = os.system("pnpm update-ff:raw")
result = os.system("npm run update-ff:raw")
if result != 0:
raise RuntimeError("Failed to update 'ff' component.")