forked from ZenBrowserMirrors/zen-desktop
166 lines
5.1 KiB
YAML
166 lines
5.1 KiB
YAML
name: Linux Release Build
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
build-version:
|
|
description: 'The version to build'
|
|
required: true
|
|
type: string
|
|
release-branch:
|
|
description: 'The branch to build'
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
build-linux:
|
|
permissions:
|
|
contents: write
|
|
runs-on: ${{ inputs.release-branch == 'release' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch: [x86_64, aarch64]
|
|
name: Build Linux - ${{ matrix.arch }}
|
|
|
|
steps:
|
|
- name: Free Disk Space (Ubuntu)
|
|
uses: jlumbroso/free-disk-space@main
|
|
with:
|
|
tool-cache: false
|
|
|
|
- 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 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: |
|
|
set -x
|
|
sudo apt-get update --fix-missing
|
|
sudo apt-get update
|
|
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
|
|
with:
|
|
script: |
|
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
|
|
|
- name: Setup sccache
|
|
env:
|
|
LINK: https://github.com/mozilla/sccache/releases/download
|
|
SCCACHE_VERSION: 0.2.13
|
|
run: |
|
|
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
|
|
mkdir -p $HOME/.local/bin
|
|
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
|
|
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
|
|
echo "$HOME/.local/bin" >> $GITHUB_PATH
|
|
|
|
- name: Save sccache
|
|
uses: actions/cache@v4
|
|
with:
|
|
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
|
|
|
|
- name: Load Surfer CI setup
|
|
run: pnpm surfer ci --brand ${{ inputs.release-branch }} --display-version ${{ inputs.build-version }}
|
|
|
|
- name: Download Firefox source and dependencies
|
|
run: pnpm surfer download
|
|
|
|
- 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
|
|
source $HOME/.cargo/env
|
|
|
|
if test "${{ matrix.arch }}" = "aarch64"; then
|
|
rustup target add aarch64-unknown-linux-gnu
|
|
else
|
|
rustup target add x86_64-unknown-linux-gnu
|
|
fi
|
|
|
|
- name: Import
|
|
env:
|
|
SURFER_COMPAT: ${{ matrix.arch }}
|
|
run: pnpm surfer import
|
|
|
|
- name: Build language packs
|
|
run: sh scripts/download-language-packs.sh
|
|
|
|
- name: Bootstrap
|
|
run: |
|
|
cd engine
|
|
export SURFER_PLATFORM="linux"
|
|
./mach --no-interactive bootstrap --application-choice browser
|
|
cd ..
|
|
|
|
- name: Build
|
|
env:
|
|
SURFER_COMPAT: ${{ matrix.arch }}
|
|
ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }}
|
|
continue-on-error: true
|
|
run: |
|
|
export SURFER_PLATFORM="linux"
|
|
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
|
|
run: |
|
|
mv dist/zen-*.tar.bz2 "zen.linux-${{ matrix.arch }}.tar.bz2"
|
|
mv dist/output.mar linux${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}.mar
|
|
|
|
- name: Upload build artifact (binary)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
retention-days: 5
|
|
name: zen.linux-${{ matrix.arch }}.tar.bz2
|
|
path: ./zen.linux-${{ matrix.arch }}.tar.bz2
|
|
|
|
- name: Upload build artifact (.mar)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
retention-days: 5
|
|
name: linux${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}.mar
|
|
path: ./linux${{ matrix.arch == 'aarch64' && '-aarch64' || '' }}.mar
|
|
|
|
- name: Upload build artifact (update manifests)
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
retention-days: 5
|
|
name: linux_update_manifest_${{ matrix.arch }}
|
|
path: ./dist/update
|