Merge branch 'dev' into macos-credentials-fix

Signed-off-by: mr. m  <91018726+mauro-balades@users.noreply.github.com>
This commit is contained in:
mr. m
2025-01-07 18:03:29 +01:00
committed by GitHub
138 changed files with 3572 additions and 6722 deletions

View File

@@ -16,10 +16,10 @@ on:
update_branch:
description: 'Update branch with new version'
required: true
default: 'stable'
default: 'release'
type: 'choice'
options:
- 'stable'
- 'release'
- 'twilight'
workflow_call:
inputs:
@@ -36,7 +36,7 @@ on:
update_branch:
description: 'Update branch with new version'
required: true
default: 'stable'
default: 'release'
type: 'string'
jobs:
@@ -121,7 +121,7 @@ jobs:
npm i -g @zen-browser/surfer
- name: Bump version
if: ${{ inputs.update_version && inputs.update_branch == 'stable' }}
if: ${{ inputs.update_version && inputs.update_branch == 'release' }}
run: |
pnpm surfer ci --brand ${{ inputs.update_branch }} --bump prerelease
@@ -152,9 +152,34 @@ jobs:
commit_user_name: Zen Browser Robot
commit_user_email: zen-browser-auto@users.noreply.github.com
check-release:
lint:
runs-on: ubuntu-latest
needs: [build-data]
steps:
- 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-file: '.nvmrc'
- name: Setup pnpm
run: npm install -g pnpm
- name: Install dependencies
run: |
pnpm install
- name: Lint
run: pnpm lint
check-release:
runs-on: ubuntu-latest
needs: [build-data, lint]
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -249,15 +274,15 @@ jobs:
- name: Compress
run: |
cd engine
tar --use-compress-program=zstd -hcf ../zen.source.tar.gz *
tar --use-compress-program=zstd -hcf ../zen.source.tar.zst *
cd ..
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
retention-days: 5
name: zen.source.tar.gz
path: ./zen.source.tar.gz
name: zen.source.tar.zst
path: ./zen.source.tar.zst
windows-step-1:
name: Windows build step 1 (PGO build)
@@ -359,7 +384,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-stable/StartupWMClass=zen-twilight/g' AppDir/zen.desktop
sed -i -e 's/StartupWMClass=zen-release/StartupWMClass=zen-twilight/g' AppDir/zen.desktop
fi
APPDIR=AppDir
@@ -396,10 +421,10 @@ jobs:
if: ${{ inputs.create_release || inputs.update_branch == 'twilight' }}
permissions: write-all
name: Release
needs: [build-data, linux, windows-step-3, check-release, mac, appimage, source]
needs: [build-data, linux, windows-step-3, check-release, mac, appimage, source, lint]
runs-on: ubuntu-latest
environment:
name: ${{ inputs.update_branch == 'stable' && 'Deploy-Release' || 'Deploy-Twilight' }}
name: ${{ inputs.update_branch == 'release' && 'Deploy-Release' || 'Deploy-Twilight' }}
steps:
- name: Checkout repository
@@ -438,7 +463,7 @@ jobs:
cp -a ../linux_update_manifest_x86_64/. updates/
cp -a ../linux_update_manifest_aarch64/. updates/
if [[ $RELEASE_BRANCH == 'stable' ]]; then
if [[ $RELEASE_BRANCH == 'release' ]]; 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
@@ -463,7 +488,7 @@ jobs:
uses: marvinpinto/action-automatic-releases@master
with:
files: |
zen.source.tar.gz
zen.source.tar.zst
zen.linux-x86_64.tar.bz2
zen.linux-aarch64.tar.bz2
zen-x86_64.AppImage
@@ -486,20 +511,20 @@ jobs:
title: 'Twilight build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }} at ${{ needs.build-data.outputs.build_time }})'
draft: false
prerelease: true
repo_token: ${{ github.token }}
repo_token: ${{ secrets.DEPLOY_KEY }}
env:
GITHUB_REPOSITORY: ${{ github.repository }}
- name: Release
uses: marvinpinto/action-automatic-releases@master
if: ${{ inputs.update_branch == 'stable' }}
if: ${{ inputs.update_branch == 'release' }}
with:
repo_token: '${{ secrets.DEPLOY_KEY }}'
automatic_release_tag: ${{ needs.build-data.outputs.version }}
prerelease: false
title: 'Stable build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})'
title: 'Release build - ${{ needs.build-data.outputs.version }} (${{ needs.build-data.outputs.build_date }})'
files: |
zen.source.tar.gz
zen.source.tar.zst
zen.linux-x86_64.tar.bz2
zen.linux-aarch64.tar.bz2
zen-x86_64.AppImage
@@ -520,7 +545,7 @@ jobs:
zen.macos-aarch64.dmg
prepare-flatpak:
if: ${{ inputs.create_release && inputs.update_branch == 'stable' }}
if: ${{ inputs.create_release && inputs.update_branch == 'release' }}
permissions: write-all
name: Prepare Flatpak
needs: [release, linux, build-data]
@@ -579,7 +604,7 @@ jobs:
run: sleep 120
release-flatpak:
if: ${{ inputs.create_release && inputs.update_branch == 'stable' }}
if: ${{ inputs.create_release && inputs.update_branch == 'release' }}
permissions: write-all
name: Release Flatpak
needs: [prepare-flatpak, build-data]

View File

@@ -6,20 +6,20 @@ on:
workflow_dispatch:
jobs:
check_tag:
check_candidates:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- 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: 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
- 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 || true

View File

@@ -20,7 +20,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
})
for (const cache of caches.data.actions_caches) {
console.log(cache)
await github.rest.actions.deleteActionsCacheById({
@@ -29,5 +29,5 @@ jobs:
cache_id: cache.id,
})
}
console.log("Clear completed")

33
.github/workflows/code-linter.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Code Linter
on:
push:
branches:
- dev
workflow_dispatch:
pull_request:
branches:
- dev
jobs:
pr-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Setup pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm lint

View File

@@ -10,56 +10,55 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.DEPLOY_KEY }}
- name: Checkout code
uses: actions/checkout@v2
with:
token: ${{ secrets.DEPLOY_KEY }}
- name: Get dates for last month
shell: bash
run: |
# Get the current date
current_date=$(date +'%Y-%m-%d')
- name: Get dates for last month
shell: bash
run: |
# Get the current date
current_date=$(date +'%Y-%m-%d')
# Calculate the previous month
previous_date=$(date -d "$current_date -1 month" +'%Y-%m-%d')
# Calculate the previous month
previous_date=$(date -d "$current_date -1 month" +'%Y-%m-%d')
# Extract the year and month from the previous date
previous_year=$(date -d "$previous_date" +'%Y')
previous_month=$(date -d "$previous_date" +'%m')
# Extract the year and month from the previous date
previous_year=$(date -d "$previous_date" +'%Y')
previous_month=$(date -d "$previous_date" +'%m')
# Calculate the first day of the previous month
first_day=$(date -d "$previous_year-$previous_month-01" +'%Y-%m-%d')
# Calculate the first day of the previous month
first_day=$(date -d "$previous_year-$previous_month-01" +'%Y-%m-%d')
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +'%Y-%m-%d')
# Calculate the last day of the previous month
last_day=$(date -d "$first_day +1 month -1 day" +'%Y-%m-%d')
echo "$first_day..$last_day"
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
echo "last_month_year=$previous_year" >> "$GITHUB_ENV"
echo "$first_day..$last_day"
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
echo "last_month_year=$previous_year" >> "$GITHUB_ENV"
- name: Run issue-metrics tool
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.DEPLOY_KEY }}
HIDE_AUTHOR: true
HIDE_TIME_TO_ANSWER: true
SEARCH_QUERY: 'repo:zen-browser/desktop is:issue created:${{ env.last_month }}'
- name: Run issue-metrics tool
uses: github/issue-metrics@v2
env:
GH_TOKEN: ${{ secrets.DEPLOY_KEY }}
HIDE_AUTHOR: true
HIDE_TIME_TO_ANSWER: true
SEARCH_QUERY: 'repo:zen-browser/desktop is:issue created:${{ env.last_month }}'
- name: Move metrics to docs folder
run: |
mkdir -p docs/issue-metrics
rm -f docs/issue-metrics/${{ env.last_month_year }}_${{ env.last_month }}.md
mv issue_metrics.md docs/issue-metrics/${{ env.last_month_year }}_${{ env.last_month }}.md
- name: Move metrics to docs folder
run: |
mkdir -p docs/issue-metrics
rm -f docs/issue-metrics/${{ env.last_month_year }}_${{ env.last_month }}.md
mv issue_metrics.md docs/issue-metrics/${{ env.last_month_year }}_${{ env.last_month }}.md
- name: Remove metrisc JSON
run: |
rm -f issue_metrics.json
- name: Remove metrisc JSON
run: |
rm -f issue_metrics.json
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Update monthly issue metrics'
commit_user_name: Zen Browser Robot
commit_user_email: zen-browser-auto@users.noreply.github.com
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Update monthly issue metrics'
commit_user_name: Zen Browser Robot
commit_user_email: zen-browser-auto@users.noreply.github.com

View File

@@ -16,7 +16,7 @@ jobs:
build-linux:
permissions:
contents: write
runs-on: ubuntu-latest
runs-on: ${{ inputs.release-branch == 'release' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
@@ -125,24 +125,18 @@ jobs:
- name: Build
env:
SURFER_COMPAT: ${{ matrix.arch }}
ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }}
continue-on-error: true
run: |
export SURFER_PLATFORM="linux"
sh .github/workflows/src/release-build.sh
- name: Build again if it failed
if: failure()
env:
SURFER_COMPAT: ${{ matrix.arch }}
run: |
export SURFER_PLATFORM="linux"
sh .github/workflows/src/release-build.sh
bash .github/workflows/src/release-build.sh
- name: Package
env:
SURFER_COMPAT: ${{ matrix.arch }}
run: |
export SURFER_PLATFORM="linux"
export ZEN_RELEASE=1
pnpm package
- name: Rename artifacts

View File

@@ -15,7 +15,7 @@ on:
jobs:
mac-build:
name: Build macOS - ${{ matrix.arch }}
runs-on: macos-14
runs-on: ${{ inputs.release-branch == 'release' && 'warp-macos-14-arm64-6x' || 'macos-14' }}
strategy:
fail-fast: false
@@ -115,18 +115,10 @@ jobs:
- name: Build Zen
env:
SURFER_COMPAT: ${{ matrix.arch }}
ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }}
run: |
export SURFER_PLATFORM="darwin"
if test "${{ matrix.arch }}" = "x86_64"; then
export ZEN_DISABLE_LTO=1
fi
sh .github/workflows/src/release-build.sh
- name: Rebuild Zen if failed
if: failure()
run: |
export SURFER_PLATFORM="darwin"
sh .github/workflows/src/release-build.sh
bash .github/workflows/src/release-build.sh
- name: Import APPLE DEVELOPER ID CERTIFICATE for .app
uses: Apple-Actions/import-codesign-certs@v3
@@ -143,6 +135,7 @@ jobs:
run: |
export SURFER_PLATFORM="darwin"
export MACOS_APPLE_DEVELOPER_ID="${{ secrets.macOS_AppleDeveloperId }}"
export ZEN_RELEASE=1
pnpm package
- name: Rename artifacts
@@ -162,20 +155,6 @@ jobs:
--wait
xcrun stapler staple "zen.macos-${{ matrix.arch }}.dmg"
- name: Sign .dmg again if failed
if: failure()
run: |
set -ex
hdiutil convert ./dist/*.dmg -format UDZO -imagekey zlib-level=9 -o zen.macos-${{ matrix.arch }}.dmg
xattr -cr zen.macos-${{ matrix.arch }}.dmg
codesign -s "${{ secrets.macOS_AppleDeveloperId }}" zen.macos-${{ matrix.arch }}.dmg
xcrun notarytool submit "zen.macos-${{ matrix.arch }}.dmg" \
--apple-id "${{ secrets.macOS_AppleAccountId }}" \
--team-id "${{ secrets.macOS_AppleDeveloperIdTeamId }}" \
--password "${{ secrets.macOS_AppleDeveloperIdPassword }}" \
--wait
xcrun stapler staple "zen.macos-${{ matrix.arch }}.dmg"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:

View File

@@ -25,6 +25,9 @@ jobs:
- name: Install Surfer
run: npm i -g @zen-browser/surfer
- name: Install dependencies
run: pnpm install
- name: Download Firefox and dependencies
run: surfer download

View File

@@ -1,17 +1,19 @@
#!/bin/bash
set -ex
set -xe
if command -v apt-get &> /dev/null; then
sudo apt-get update
sudo apt-get install -y xvfb
sudo add-apt-repository ppa:kisak/kisak-mesa
sudo apt update
sudo apt upgrade
sudo apt-get install -y xvfb libnvidia-egl-wayland1 mesa-utils libgl1-mesa-dri
fi
ulimit -n 4096
if ! command -v Xvfb &> /dev/null; then
if command -v Xvfb &> /dev/null; then
if ! test "$ZEN_CROSS_COMPILING"; then
Xvfb :2 -screen 0 1024x768x24 &
Xvfb :2 -nolisten tcp -noreset -screen 0 1024x768x24 &
export LLVM_PROFDATA=$HOME/.mozbuild/clang/bin/llvm-profdata
export DISPLAY=:2
fi
@@ -20,7 +22,7 @@ if ! command -v Xvfb &> /dev/null; then
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

View File

@@ -2,7 +2,7 @@ name: Zen Twilight Scheduled Releases
on:
schedule:
- cron: '0 0 * * *'
- cron: '0 23 * * *'
workflow_dispatch:
jobs:
@@ -28,5 +28,3 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# TODO:

View File

@@ -11,7 +11,7 @@ jobs:
update-submodules:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout repository
uses: actions/checkout@v4
@@ -26,6 +26,6 @@ jobs:
- 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

View File

@@ -38,8 +38,8 @@ jobs:
- name: Setup Git
run: |
git config --global user.email "mr-cheff@users.noreply.github.com"
git config --global user.name "mr-cheff"
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

View File

@@ -22,7 +22,7 @@ on:
jobs:
windows-build:
name: Build Windows - ${{ matrix.arch }}
runs-on: ubuntu-latest
runs-on: ${{ (inputs.release-branch == 'release' && !(inputs.generate-gpo && matrix.arch == 'aarch64')) && 'warp-ubuntu-latest-x64-6x' || 'ubuntu-latest' }}
strategy:
fail-fast: false
@@ -156,6 +156,7 @@ jobs:
if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }}
env:
SURFER_COMPAT: ${{ matrix.arch }}
ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }}
run: |
set -x
dos2unix configs/windows/mozconfig
@@ -164,7 +165,7 @@ jobs:
if test ${{ inputs.generate-gpo }} = true; then
export ZEN_GA_GENERATE_PROFILE=1
fi
sh .github/workflows/src/release-build.sh
bash .github/workflows/src/release-build.sh
- name: Package
if: ${{ !(inputs.generate-gpo && matrix.arch == 'aarch64') }}
@@ -173,6 +174,8 @@ jobs:
run: |
set -x
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
ls ./dist