Skip to content

Commit

Permalink
Update build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlex94 committed Jul 11, 2023
1 parent 04762af commit f45c715
Showing 1 changed file with 159 additions and 6 deletions.
165 changes: 159 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ jobs:
Install\ Waterfox.exe
waterfox-${{ env.VERSION_DISPLAY }}.complete.mar
update.xml
build-macos-multi:
name: macOS
build-macos-multi-stage-1:
name: macOS Stage 1
runs-on:
- buildjet-16vcpu-ubuntu-2204
strategy:
Expand Down Expand Up @@ -547,6 +547,7 @@ jobs:
echo "WFX_PRE_RELEASE should be 0. ${WFX_PRE_RELEASE}"
fi
fi
export GEN_PGO=1
./mach build
- name: Stop sccache
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
Expand All @@ -568,12 +569,164 @@ jobs:
./obj-${{ matrix.arch }}/dist/waterfox/*.app
./obj-${{ matrix.arch }}/dist/host/bin/mar
retention-days: 1
build-macos-multi-stage-2:
name: macOS Stage 2
runs-on: tartelet
concurrency:
group: "${{ github.head_ref }}-macos-multi-stage-2"
cancel-in-progress: true
env:
ARCH: aarch64-apple-darwin
needs:
- build-macos-multi-stage-1
steps:
- name: "\U0001F4E4 Checkout"
uses: actions/checkout@v3
- name: ⏬ Download Stage 1 macOS artifact
uses: actions/download-artifact@v3
with:
name: macos-${{ env.ARCH }}-stage-1-${{ github.run_id }}
path: obj-${{ env.ARCH }}/dist/
- name: "\U0001F3D7 Run PGO"
run: |
ls obj-${{ env.ARCH }}/dist/
ls obj-${{ env.ARCH }}/dist/waterfox
sudo xattr -dr com.apple.quarantine ./obj-${{ env.ARCH }}/dist/waterfox/Waterfox.app
sudo spctl --add ./obj-${{ env.ARCH }}/dist/waterfox/Waterfox.app
rm .mozconfig
./mach --no-interactive bootstrap --application-choice=browser
LLVM_PROFDATA=$HOME/.mozbuild/clang/bin/llvm-profdata JARLOG_FILE=en-US.log ./mach python build/pgo/profileserver.py --binary ./obj-${{ env.ARCH }}/dist/waterfox/Waterfox.app/Contents/MacOS/waterfox
- name: "\U0001F199 Upload Stage 2 Artifact"
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: macos-${{ env.arch }}-stage-2-${{ github.run_id }}
path: |
merged.profdata
en-US.log
build-macos-multi-stage-3:
name: macOS Stage 3
runs-on:
- buildjet-16vcpu-ubuntu-2204
needs:
- build-macos-multi-stage-2
strategy:
matrix:
arch:
- aarch64-apple-darwin
concurrency:
group: "${{ github.ref }}-${{ matrix.arch }}-macos-multi"
cancel-in-progress: true
env:
MOZCONFIG: ".mozconfig-${{ matrix.arch }}"
CARGO_INCREMENTAL: "0"
CARGO_TERM_COLOR: always
SCCACHE_ENDPOINT: "${{ secrets.CF_ENDPOINT }}"
SCCACHE_REGION: auto
steps:
- name: Install sccache
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: "v0.5.3"
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: Export sccache bucket
if: "${{ matrix.ARCH == 'x86_64-apple-darwin' }}"
run: |
echo "SCCACHE_BUCKET=waterfox-cache-mac-x64" >> $GITHUB_ENV
- name: Export sccache bucket
if: "${{ matrix.ARCH == 'aarch64-apple-darwin' }}"
run: |
echo "SCCACHE_BUCKET=waterfox-cache-mac-aarch64" >> $GITHUB_ENV
- name: Start sccache server
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
run: sccache --start-server
- name: "\U0001F4BF Build dependencies"
run: |
sudo apt install nasm
rustup update
rustup target add ${{ matrix.arch }}
curl -L "https://www.7-zip.org/a/7z2300-linux-x64.tar.xz" | tar xJ
sudo mv 7zz /usr/local/bin/7z
curl https://rclone.org/install.sh | sudo bash
- name: "\U0001F9F0 macos-cross Cache"
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5
id: cache-macos-cross
uses: actions/cache@v3
with:
path: ${HOME}/macos-cross
key: macos-cross-115
- name: "\U0001F4BF Setup macos-cross"
if: steps.cache-macos-cross.outputs.cache-hit != 'true'
run: |
rclone copyto :s3:cdn/waterfox/libraries/toolchain/macos-cross-102.tar.zst ./macos-cross.tar.zst
tar -xvf macos-cross.tar.zst -C $HOME/
rclone copyto :s3:cdn/waterfox/libraries/toolchain/clang-16.tar.zst ./clang-16.tar.zst
tar -xvf clang-16.tar.zst -C $HOME/macos-cross
- name: "\U0001F4E4 Checkout"
uses: actions/checkout@v3
- name: "\U0001F4E3 Override version_display.txt"
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
run: |
if [[ -n ${{ inputs.TAG_VERSION }} ]]; then
echo ${{ inputs.TAG_VERSION }} > browser/config/version_display.txt
fi
echo 'VERSION_DISPLAY<<EOF' >> $GITHUB_ENV
cat browser/config/version_display.txt >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: ⏬ Download Stage 2 ARM64 artifact
uses: actions/download-artifact@v3
with:
name: macos-${{ matrix.ARCH }}-stage-2-${{ github.run_id }}
path: ${{ env.GITHUB_WORKSPACE }}
- name: "\U0001F3D7 Build"
run: |
export MOZ_BUILD_DATE=$(date +'%Y%m%d%H0000')
if [[ ${{ inputs.TRIGGER_EVENT }} == 'workflow_dispatch' ]]; then
if [[ $PRE_RELEASE == 'true' ]]; then
export WFX_PRE_RELEASE=1
echo "Set WFX_PRE_RELEASE as ${WFX_PRE_RELEASE}"
echo "WFX_RELEASE should be 0. ${WFX_RELEASE}"
else
export WFX_RELEASE=1
echo "Set WFX_RELEASE as ${WFX_RELEASE}"
echo "WFX_PRE_RELEASE should be 0. ${WFX_PRE_RELEASE}"
fi
fi
export USE_PGO=1
./mach build
- name: Stop sccache
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
run: |
sccache --stop-server
- name: "\U0001F4E6 Package"
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
run: |
./mach package
if [ -d "$PWD"/waterfox/browser/locales/en-GB ]; then
./mach package-multi-locale --locales ar cs da de el en-GB en-US es-ES es-MX fr hu id it ja ko lt nl nn-NO pl pt-BR pt-PT ru sv-SE th vi zh-CN zh-TW
fi
- name: "\U0001F199 Upload Stage 1 Artifacts"
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
uses: actions/upload-artifact@v3
with:
name: macos-${{ matrix.arch }}-stage-3-${{ github.run_id }}
path: |
./obj-${{ matrix.arch }}/dist/waterfox/*.app
./obj-${{ matrix.arch }}/dist/host/bin/mar
retention-days: 1
macos-unify:
name: macOS Universal
if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }}
needs:
- build-macos-multi
runs-on: macos-12
- build-macos-multi-stage-3
runs-on: tartelet
env:
ARCH-X64: x86_64-apple-darwin
ARCH-ARM64: aarch64-apple-darwin
Expand All @@ -593,10 +746,10 @@ jobs:
with:
name: macos-${{ env.ARCH-X64 }}-stage-1-${{ github.run_id }}
path: "./obj-${{ env.ARCH-X64 }}/dist/"
- name: ⏬ Download Stage 1 ARM64 artifact
- name: ⏬ Download Stage 3 ARM64 artifact
uses: actions/download-artifact@v3
with:
name: macos-${{ env.ARCH-ARM64 }}-stage-1-${{ github.run_id }}
name: macos-${{ env.ARCH-ARM64 }}-stage-3-${{ github.run_id }}
path: "./obj-${{ env.ARCH-ARM64 }}/dist/"
- name: "\U0001D33B Unify .app(s)"
run: |
Expand Down

0 comments on commit f45c715

Please sign in to comment.