From 91141da3d5cf230b441dd5f579f0943132a4ef60 Mon Sep 17 00:00:00 2001 From: Alex Kontos Date: Wed, 4 Sep 2024 13:22:50 +0100 Subject: [PATCH] Update GHAs to support esr128 changes. --- .github/workflows/README | 7 - .github/workflows/build.yml | 264 ++++++--------------------------- .github/workflows/close-pr.yml | 20 --- .github/workflows/stage.yml | 2 +- 4 files changed, 43 insertions(+), 250 deletions(-) delete mode 100644 .github/workflows/README delete mode 100644 .github/workflows/close-pr.yml diff --git a/.github/workflows/README b/.github/workflows/README deleted file mode 100644 index 4e5f9713c7eca..0000000000000 --- a/.github/workflows/README +++ /dev/null @@ -1,7 +0,0 @@ -IMPORTANT - -All changes and/or additions to GitHub Workflows MUST be approved by the -Mozilla GitHub Enterprise Administrators Team. - -See https://mozilla-hub.atlassian.net/l/cp/f5ypVsa7 for contact information, or -reach out on Matrix: https://chat.mozilla.org/#/room/#github-admin:mozilla.org diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d348b3d740ce..e7c26df383e26 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,52 +80,24 @@ jobs: ARCH: x86_64-pc-mingw32 CARGO_INCREMENTAL: "0" CARGO_TERM_COLOR: always - SCCACHE_BUCKET: "waterfox-cache-win-x64-stage-1" - SCCACHE_ENDPOINT: "${{ secrets.CF_ENDPOINT }}" - SCCACHE_REGION: auto + SCCACHE_GHA_ENABLED: "true" outputs: versionout: "${{ steps.versionexport.outputs.version }}" steps: - - name: Install sccache - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - env: - LINK: https://github.com/mozilla/sccache/releases/download - SCCACHE_VERSION: "v0.8.1" - 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: Start sccache server - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - run: sccache --start-server + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.5 - name: "\U0001F4BF Build dependencies" run: | + sudo apt update sudo apt install msitools - rustup default 1.77.2 rustup target add x86_64-pc-windows-msvc - curl -L "https://www.7-zip.org/a/7z2300-linux-x64.tar.xz" | tar xJ + curl -L "https://www.7-zip.org/a/7z2408-linux-x64.tar.xz" | tar xJ sudo mv 7zz /usr/local/bin/7z curl https://rclone.org/install.sh | sudo bash - - name: "\U0001F9F0 win-cross Cache" - env: - SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 - id: cache-win-cross - uses: actions/cache@v4 - with: - path: ${HOME}/win-cross - key: clang-17 - - name: "\U0001F4BF Setup win-cross" - if: steps.cache-win-cross.outputs.cache-hit != 'true' - run: | - rclone copyto :s3:cdn/waterfox/libraries/toolchain/win-cross-102.tar.zst ./win-cross.tar.zst - tar -xvf win-cross.tar.zst -C $HOME/ - rclone copyto :s3:cdn/waterfox/libraries/toolchain/clang-17.tar.zst ./clang-17.tar.zst - mkdir -p $HOME/win-cross - tar -xvf clang-17.tar.zst -C $HOME/win-cross - name: "\U0001F4E4 Checkout" uses: actions/checkout@v4 + with: + submodules: 'true' - name: "\U0001F4E3 Override version_display.txt" if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} run: | @@ -151,10 +123,9 @@ jobs: echo "WFX_PRE_RELEASE should be 0. ${WFX_PRE_RELEASE}" fi export GEN_PGO=1 - ./mach python --virtualenv build ./taskcluster/scripts/misc/get_vs.py build/vs/vs2022.yaml $HOME/win-root fi ./mach build - - name: Stop sccache + - name: sccache stats if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} run: | sccache --stop-server @@ -169,10 +140,6 @@ jobs: name: windows-${{ env.ARCH }}-stage-1-${{ github.run_id }} path: | obj-${{ env.ARCH }}/dist/waterfox - - name: 🐛 Debug Session - if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 - timeout-minutes: 15 build-windows-x64-stage-2: name: Windows Stage 2 defaults: @@ -215,10 +182,6 @@ jobs: path: | merged.profdata en-US.log - - name: 🐛 Debug Session - if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 - timeout-minutes: 15 build-windows-x64-stage-3: name: Windows Stage 3 needs: @@ -234,55 +197,27 @@ jobs: ARCH: x86_64-pc-mingw32 CARGO_INCREMENTAL: "0" CARGO_TERM_COLOR: always - SCCACHE_BUCKET: "waterfox-cache-win-x64-stage-3" - SCCACHE_ENDPOINT: "${{ secrets.CF_ENDPOINT }}" - SCCACHE_REGION: auto + SCCACHE_GHA_ENABLED: "true" permissions: id-token: write contents: read steps: - - name: Install sccache - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - env: - LINK: https://github.com/mozilla/sccache/releases/download - SCCACHE_VERSION: "v0.8.1" - 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: Start sccache server - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - run: sccache --start-server + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.5 - name: "\U0001F4BF Build dependencies" run: | + sudo apt update sudo apt install msitools - rustup default 1.77.2 rustup target add x86_64-pc-windows-msvc - curl -L https://github.com/ebourg/jsign/releases/download/5.0/jsign_5.0_all.deb --output jsign_5.0_all.deb - sudo apt install -y ./jsign_5.0_all.deb - curl -L "https://www.7-zip.org/a/7z2300-linux-x64.tar.xz" | tar xJ + curl -L https://github.com/ebourg/jsign/releases/download/6.0/jsign_6.0_all.deb --output jsign_6.0_all.deb + sudo apt install -y ./jsign_6.0_all.deb + curl -L "https://www.7-zip.org/a/7z2408-linux-x64.tar.xz" | tar xJ sudo mv 7zz /usr/local/bin/7z curl https://rclone.org/install.sh | sudo bash - - name: "\U0001F9F0 win-cross Cache" - env: - SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 - id: cache-win-cross - uses: actions/cache@v4 - with: - path: ${HOME}/win-cross - key: win-cross-102 - - name: "\U0001F4BF Setup win-cross" - if: steps.cache-win-cross.outputs.cache-hit != 'true' - run: | - rclone copyto :s3:cdn/waterfox/libraries/toolchain/win-cross-102.tar.zst ./win-cross.tar.zst - tar -xvf win-cross.tar.zst -C $HOME/ - rclone copyto :s3:cdn/waterfox/libraries/toolchain/clang-17.tar.zst ./clang-17.tar.zst - mkdir -p $HOME/win-cross - tar -xvf clang-17.tar.zst -C $HOME/win-cross - name: "\U0001F4E4 Checkout" uses: actions/checkout@v4 + with: + submodules: 'true' - name: "\U0001F4E3 Override version_display.txt" if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} run: | @@ -310,13 +245,8 @@ jobs: echo "WFX_PRE_RELEASE should be 0. ${WFX_PRE_RELEASE}" fi export USE_PGO=1 - ./mach python --virtualenv build ./taskcluster/scripts/misc/get_vs.py build/vs/vs2022.yaml $HOME/win-root fi ./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: | @@ -470,10 +400,6 @@ jobs: Install\ Waterfox.exe waterfox-${{ env.VERSION_DISPLAY }}.complete.mar update.xml - - name: 🐛 Debug Session - if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 - timeout-minutes: 15 build-macos-multi-stage-1: name: macOS Stage 1 runs-on: @@ -490,37 +416,19 @@ jobs: MOZCONFIG: ".mozconfig-${{ matrix.arch }}" CARGO_INCREMENTAL: "0" CARGO_TERM_COLOR: always - SCCACHE_ENDPOINT: "${{ secrets.CF_ENDPOINT }}" - SCCACHE_REGION: auto + SCCACHE_GHA_ENABLED: "true" steps: - - name: Install sccache - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - env: - LINK: https://github.com/mozilla/sccache/releases/download - SCCACHE_VERSION: "v0.8.1" - 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-stage-1" >> $GITHUB_ENV - - name: Export sccache bucket - if: "${{ matrix.ARCH == 'aarch64-apple-darwin' }}" - run: | - echo "SCCACHE_BUCKET=waterfox-cache-mac-aarch64-stage-1" >> $GITHUB_ENV - - name: Start sccache server - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - run: sccache --start-server + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.5 + with: + version: "v0.7.4" - name: "\U0001F4BF Build dependencies" run: | + sudo apt update sudo apt install nasm rustup default 1.77.2 rustup target add ${{ matrix.arch }} - curl -L "https://www.7-zip.org/a/7z2300-linux-x64.tar.xz" | tar xJ + curl -L "https://www.7-zip.org/a/7z2408-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" @@ -531,15 +439,10 @@ jobs: 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-17.tar.zst ./clang-17.tar.zst - tar -xvf clang-17.tar.zst -C $HOME/macos-cross - name: "\U0001F4E4 Checkout" uses: actions/checkout@v4 + with: + submodules: 'true' - name: "\U0001F4E3 Override version_display.txt" if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} run: | @@ -564,10 +467,6 @@ jobs: fi export GEN_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: | @@ -581,10 +480,6 @@ jobs: ./obj-${{ matrix.arch }}/dist/waterfox/*.app ./obj-${{ matrix.arch }}/dist/host/bin/mar retention-days: 1 - - name: 🐛 Debug Session - if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 - timeout-minutes: 15 build-macos-multi-stage-2: name: macOS Stage 2 runs-on: ${{ matrix.runs-on }} @@ -598,6 +493,9 @@ jobs: arch: x86_64-apple-darwin - runs-on: warp-macos-13-arm64-6x arch: aarch64-apple-darwin + env: + UPLOAD_PATH: 'logs' + MOZ_FETCHES_DIR: 'moz-fetch-dir' needs: - build-macos-multi-stage-1 steps: @@ -608,9 +506,6 @@ jobs: with: name: macos-${{ matrix.arch }}-stage-1-${{ github.run_id }} path: obj-${{ matrix.arch }}/dist/ - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - name: "\U0001F3D7 Run PGO" run: | python --version @@ -645,10 +540,6 @@ jobs: path: | merged.profdata en-US.log - - name: 🐛 Debug Session - if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 - timeout-minutes: 15 build-macos-multi-stage-3: name: macOS Stage 3 runs-on: @@ -667,56 +558,22 @@ jobs: MOZCONFIG: ".mozconfig-${{ matrix.arch }}" CARGO_INCREMENTAL: "0" CARGO_TERM_COLOR: always - SCCACHE_ENDPOINT: "${{ secrets.CF_ENDPOINT }}" - SCCACHE_REGION: auto + SCCACHE_GHA_ENABLED: "true" steps: - - name: Install sccache - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - env: - LINK: https://github.com/mozilla/sccache/releases/download - SCCACHE_VERSION: "v0.8.1" - 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-stage-3" >> $GITHUB_ENV - - name: Export sccache bucket - if: "${{ matrix.ARCH == 'aarch64-apple-darwin' }}" - run: | - echo "SCCACHE_BUCKET=waterfox-cache-mac-aarch64-stage-3" >> $GITHUB_ENV - - name: Start sccache server - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - run: sccache --start-server + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.5 - name: "\U0001F4BF Build dependencies" run: | + sudo apt update sudo apt install nasm - rustup default 1.77.2 rustup target add ${{ matrix.arch }} - curl -L "https://www.7-zip.org/a/7z2300-linux-x64.tar.xz" | tar xJ + curl -L "https://www.7-zip.org/a/7z2408-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@v4 - 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-17.tar.zst ./clang-17.tar.zst - tar -xvf clang-17.tar.zst -C $HOME/macos-cross - name: "\U0001F4E4 Checkout" uses: actions/checkout@v4 + with: + submodules: 'recursive' - name: "\U0001F4E3 Override version_display.txt" if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} run: | @@ -746,10 +603,6 @@ jobs: 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: | @@ -766,10 +619,6 @@ jobs: ./obj-${{ matrix.arch }}/dist/waterfox/*.app ./obj-${{ matrix.arch }}/dist/host/bin/mar retention-days: 1 - - name: 🐛 Debug Session - if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 - timeout-minutes: 15 macos-unify: name: macOS Universal if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} @@ -800,9 +649,6 @@ jobs: with: name: macos-${{ env.ARCH-ARM64 }}-stage-3-${{ github.run_id }} path: "./obj-${{ env.ARCH-ARM64 }}/dist/" - - uses: actions/setup-python@v5 - with: - python-version: '3.11' - name: "\U0001D33B Unify .app(s)" run: | MOZCONFIG=.mozconfig-${{ env.ARCH-X64 }} ./mach python toolkit/mozapps/installer/unify.py obj-${{ env.ARCH-X64 }}/dist/waterfox/*.app obj-${{ env.ARCH-ARM64 }}/dist/waterfox/*.app @@ -910,10 +756,6 @@ jobs: Waterfox ${{ env.VERSION_DISPLAY }}.dmg.sha512 waterfox-${{ env.VERSION_DISPLAY }}.complete.mar update.xml - - name: 🐛 Debug Session - if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 - timeout-minutes: 15 build-linux-x64: name: Linux runs-on: @@ -926,32 +768,18 @@ jobs: ARCH: x86_64-pc-linux-gnu CARGO_INCREMENTAL: "0" CARGO_TERM_COLOR: always - SCCACHE_BUCKET: "waterfox-cache-linux-x64-stage-1" - SCCACHE_ENDPOINT: "${{ secrets.CF_ENDPOINT }}" - SCCACHE_REGION: auto + SCCACHE_GHA_ENABLED: "true" steps: - - name: Install sccache - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - env: - LINK: https://github.com/mozilla/sccache/releases/download - SCCACHE_VERSION: "v0.8.1" - 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: Start sccache server - if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} - run: sccache --start-server + - name: Run sccache-cache + uses: mozilla-actions/sccache-action@v0.0.5 - name: "\U0001F4BF Setup build packages" run: | - curl -L "https://www.7-zip.org/a/7z2300-linux-x64.tar.xz" | tar xJ + curl -L "https://www.7-zip.org/a/7z2408-linux-x64.tar.xz" | tar xJ sudo mv 7zz /usr/local/bin/7z - name: "\U0001F4E4 Checkout" uses: actions/checkout@v4 - - name: "🦀 Pin Rust version" - run: rustup default 1.77.2 + with: + submodules: 'recursive' - name: "\U0001F4E3 Override version_display.txt" if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} run: | @@ -1003,10 +831,6 @@ jobs: 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: | @@ -1072,10 +896,6 @@ jobs: sed -i "s/SIZE/$SIZE/g" update.xml sed -i "s/HASH/"$SHA512"/g" update.xml - - name: 🐛 Debug Session - if: ${{ failure() }} - uses: Warpbuilds/gha-debug@v1.3 - timeout-minutes: 15 - name: "\U0001F199 Upload artifact" if: ${{ inputs.TRIGGER_EVENT == 'workflow_dispatch' }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/close-pr.yml b/.github/workflows/close-pr.yml deleted file mode 100644 index a881cde247f6c..0000000000000 --- a/.github/workflows/close-pr.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: close pull request -on: - pull_request_target: - types: [opened, reopened] -jobs: - run: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - with: - sparse-checkout: "README.txt" - sparse-checkout-cone-mode: false - - name: close - env: - GH_TOKEN: ${{ github.token }} - PR: ${{ github.event.number }} - run: | - gh pr close ${{ env.PR }} --comment "(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html" - gh pr lock ${{ env.PR }} diff --git a/.github/workflows/stage.yml b/.github/workflows/stage.yml index 06681a8705563..d490093cc3ca9 100644 --- a/.github/workflows/stage.yml +++ b/.github/workflows/stage.yml @@ -30,7 +30,7 @@ env: jobs: stage: name: Multi-platform - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest outputs: versionout: '${{ steps.versionexport.outputs.version }}' steps: