mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
171 lines
5.8 KiB
YAML
171 lines
5.8 KiB
YAML
name: macOS Alpha Build
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
build-version:
|
|
description: 'The version to build'
|
|
required: true
|
|
type: string
|
|
jobs:
|
|
mac-build:
|
|
name: Build macOS - ${{ matrix.arch }}
|
|
environment: production
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: aarch64
|
|
os: macos-14
|
|
- arch: x64
|
|
os: macos-13
|
|
|
|
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
|
|
with:
|
|
submodules: recursive
|
|
token: ${{ secrets.DEPLOY_KEY }}
|
|
|
|
- name: Setup git
|
|
run: |
|
|
git config --global user.email "mauro-balades@users.noreply.github.com"
|
|
git config --global user.name "mauro-balades"
|
|
|
|
- name: Install system dependencies
|
|
run: |
|
|
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
|
|
|
|
brew install watchman
|
|
|
|
- name: Force usage fo 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
|
|
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
|
|
- name: Load surfer CI setup
|
|
run: pnpm surfer ci --brand alpha --display-version ${{ inputs.build-version }}
|
|
|
|
- name: Download firefox source and dependancies
|
|
run: pnpm surfer download
|
|
|
|
- name: Bootstrap
|
|
run: |
|
|
cd engine
|
|
export PATH="$(python3 -m site --user-base)/bin":$PATH
|
|
./mach --no-interactive bootstrap --application-choice browser --no-system-changes
|
|
cd ..
|
|
|
|
- name: Import
|
|
env:
|
|
SURFER_COMPAT: ${{ matrix.arch == 'x64' }}
|
|
run: |
|
|
pnpm surfer import --verbose
|
|
|
|
- name: Build language packs
|
|
run: sh scripts/download-language-packs.sh
|
|
|
|
- name: build Zen
|
|
env:
|
|
SURFER_COMPAT: ${{ matrix.arch == 'x64' }}
|
|
run: |
|
|
if test "${{ matrix.arch }}" = "x64"; then
|
|
export ZEN_DISABLE_LTO=1
|
|
fi
|
|
sh .github/workflows/src/alpha-build.sh
|
|
|
|
- name: Rebuild Zen if failed
|
|
if: failure()
|
|
run: sh .github/workflows/src/alpha-build.sh
|
|
|
|
- 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 }}
|
|
|
|
- name: Package
|
|
env:
|
|
SURFER_COMPAT: ${{ matrix.arch == 'x64' }}
|
|
run: |
|
|
export MACOS_APPLE_DEVELOPER_ID="${{ secrets.macOS_AppleDeveloperId }}"
|
|
pnpm package
|
|
|
|
- name: Rename artifacts
|
|
run: |
|
|
mv ./dist/output.mar macos-${{ matrix.arch }}.mar
|
|
|
|
- name: Sign to .dmg
|
|
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 artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: zen.macos-${{ matrix.arch }}.dmg
|
|
path: ./zen.macos-${{ matrix.arch }}.dmg
|
|
|
|
- name: Upload mar
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos-${{ matrix.arch }}.mar
|
|
path: ./macos-${{ matrix.arch }}.mar
|
|
|
|
- name: Upload update manifests
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: macos_update_manifest_${{ matrix.arch }}
|
|
path: ./dist/update
|