mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-06 03:18:19 +00:00
49
.github/workflows/windows-release-build.yml
vendored
49
.github/workflows/windows-release-build.yml
vendored
@@ -1,4 +1,5 @@
|
|||||||
name: Windows Release Build
|
name: Windows Release Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -22,6 +23,7 @@ jobs:
|
|||||||
windows-build:
|
windows-build:
|
||||||
name: Build Windows - ${{ matrix.arch == 'x86_64' && 'Generic' || matrix.arch == 'x86_64-v3' && 'Specific' || matrix.arch == 'aarch64' && 'ARM64' }}
|
name: Build Windows - ${{ matrix.arch == 'x86_64' && 'Generic' || matrix.arch == 'x86_64-v3' && 'Specific' || matrix.arch == 'aarch64' && 'ARM64' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -31,24 +33,23 @@ jobs:
|
|||||||
- name: Free Disk Space (Ubuntu)
|
- name: Free Disk Space (Ubuntu)
|
||||||
uses: jlumbroso/free-disk-space@main
|
uses: jlumbroso/free-disk-space@main
|
||||||
with:
|
with:
|
||||||
# this might remove tools that are actually needed,
|
|
||||||
# if set to "true" but frees about 6 GB
|
|
||||||
tool-cache: false
|
tool-cache: false
|
||||||
|
|
||||||
- name: Install Node.js and pnpm
|
- name: Checkout repository
|
||||||
uses: actions/setup-node@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
token: ${{ secrets.DEPLOY_KEY }}
|
token: ${{ secrets.DEPLOY_KEY }}
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
|
||||||
|
- name: Setup pnpm
|
||||||
run: npm install -g 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"
|
||||||
git config --global user.name "mauro-balades"
|
git config --global user.name "mauro-balades"
|
||||||
@@ -63,7 +64,7 @@ jobs:
|
|||||||
- name: Download
|
- name: Download
|
||||||
run: pnpm surfer download
|
run: pnpm surfer download
|
||||||
|
|
||||||
- name: 'win-cross Cache'
|
- name: win-cross Cache
|
||||||
env:
|
env:
|
||||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
|
||||||
id: cache-win-cross
|
id: cache-win-cross
|
||||||
@@ -79,18 +80,16 @@ jobs:
|
|||||||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
|
||||||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
|
||||||
|
|
||||||
- name: Setup For Windows
|
- name: Setup for Windows
|
||||||
if: steps.cache-win-cross.outputs.cache-hit != 'true'
|
if: steps.cache-win-cross.outputs.cache-hit != 'true'
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
mkdir -p ~/win-cross
|
mkdir -p ~/win-cross
|
||||||
cd engine/
|
cd engine/
|
||||||
|
|
||||||
echo Setup wine
|
echo Setup wine
|
||||||
aria2c "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-1.toolchains.v3.linux64-wine.latest/artifacts/public%2Fbuild%2Fwine.tar.zst" -o wine.tar.zst
|
aria2c "https://firefox-ci-tc.services.mozilla.com/api/index/v1/task/gecko.cache.level-1.toolchains.v3.linux64-wine.latest/artifacts/public%2Fbuild%2Fwine.tar.zst" -o wine.tar.zst
|
||||||
tar --zstd -xvf wine.tar.zst -C ~/win-cross
|
tar --zstd -xvf wine.tar.zst -C ~/win-cross
|
||||||
rm wine.tar.zst
|
rm wine.tar.zst
|
||||||
|
|
||||||
echo Setup Visual Studio
|
echo Setup Visual Studio
|
||||||
sudo apt install -y msitools python3-pip
|
sudo apt install -y msitools python3-pip
|
||||||
./mach python --virtualenv build taskcluster/scripts/misc/get_vs.py build/vs/vs2022.yaml ~/win-cross/vs2022
|
./mach python --virtualenv build taskcluster/scripts/misc/get_vs.py build/vs/vs2022.yaml ~/win-cross/vs2022
|
||||||
@@ -99,32 +98,25 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
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
|
npm install -g pnpm
|
||||||
export SURFER_PLATFORM="win32"
|
export SURFER_PLATFORM="win32"
|
||||||
pnpm surfer bootstrap
|
pnpm surfer 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
|
||||||
cat ../configs/common/mozconfig
|
cat ../configs/common/mozconfig
|
||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install dos2unix
|
sudo apt-get install dos2unix
|
||||||
|
|
||||||
ls ~/win-cross/wine || true
|
ls ~/win-cross/wine || true
|
||||||
ls ~/win-cross/vs2022 || true
|
ls ~/win-cross/vs2022 || true
|
||||||
|
|
||||||
- name: setup Rust
|
- name: Setup Rust
|
||||||
run: |
|
run: |
|
||||||
cd engine/
|
cd engine/
|
||||||
# Install a rust version compatible with 17
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.79
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.79
|
||||||
source $HOME/.cargo/env
|
source $HOME/.cargo/env
|
||||||
|
|
||||||
if test "${{ matrix.arch }}" = "aarch64"; then
|
if test "${{ matrix.arch }}" = "aarch64"; then
|
||||||
rustup target add aarch64-pc-windows-msvc
|
rustup target add aarch64-pc-windows-msvc
|
||||||
else
|
else
|
||||||
@@ -132,9 +124,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
cargo install cargo-download
|
cargo install cargo-download
|
||||||
cargo download -x windows=0.58.0
|
cargo download -x windows=0.58.0
|
||||||
#? https://github.com/mozilla/sccache#known-caveats
|
|
||||||
export CARGO_INCREMENTAL=0
|
export CARGO_INCREMENTAL=0
|
||||||
|
|
||||||
echo "" >> ../configs/common/mozconfig
|
echo "" >> ../configs/common/mozconfig
|
||||||
echo "export MOZ_WINDOWS_RS_DIR=$(pwd)/windows-0.58.0" >> ../configs/common/mozconfig
|
echo "export MOZ_WINDOWS_RS_DIR=$(pwd)/windows-0.58.0" >> ../configs/common/mozconfig
|
||||||
|
|
||||||
@@ -146,8 +136,8 @@ jobs:
|
|||||||
- name: Build language packs
|
- name: Build language packs
|
||||||
run: sh scripts/download-language-packs.sh
|
run: sh scripts/download-language-packs.sh
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
- name: Download artifact if use profdata
|
||||||
name: Download artifact if use profdata
|
uses: actions/download-artifact@v4
|
||||||
if: ${{ !inputs.generate-gpo }}
|
if: ${{ !inputs.generate-gpo }}
|
||||||
with:
|
with:
|
||||||
path: ~/artifact
|
path: ~/artifact
|
||||||
@@ -159,7 +149,6 @@ jobs:
|
|||||||
ls ~/artifact
|
ls ~/artifact
|
||||||
ls ~/artifact/en-US.log
|
ls ~/artifact/en-US.log
|
||||||
ls ~/artifact/merged.profdata
|
ls ~/artifact/merged.profdata
|
||||||
|
|
||||||
chmod +x ~/artifact/en-US.log
|
chmod +x ~/artifact/en-US.log
|
||||||
chmod +x ~/artifact/merged.profdata
|
chmod +x ~/artifact/merged.profdata
|
||||||
|
|
||||||
@@ -187,9 +176,9 @@ jobs:
|
|||||||
ls ./dist
|
ls ./dist
|
||||||
ls .
|
ls .
|
||||||
|
|
||||||
- name: 🐛 Debug Session
|
- name: Debug session
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
uses: Warpbuilds/gha-debug@v1.3
|
uses: WarpBuilds/action-debugger@v1.3
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
- name: Move package for PGO upload
|
- name: Move package for PGO upload
|
||||||
@@ -223,7 +212,7 @@ jobs:
|
|||||||
find engine/obj-x86_64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type d -not -name 'dist' -exec rm -rf {} \;
|
find engine/obj-x86_64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type d -not -name 'dist' -exec rm -rf {} \;
|
||||||
find engine/obj-x86_64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type f -not -name 'dist' -exec rm -f {} \;
|
find engine/obj-x86_64-pc-windows-msvc/ -mindepth 1 -maxdepth 1 -type f -not -name 'dist' -exec rm -f {} \;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Upload dist object
|
- name: Upload dist object
|
||||||
if: ${{ !inputs.generate-gpo }}
|
if: ${{ !inputs.generate-gpo }}
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
Reference in New Issue
Block a user