From 7f36905917c2ce9b5e0184ae467d5b9ca99e988f Mon Sep 17 00:00:00 2001 From: Ponchale Date: Fri, 13 Oct 2023 17:35:01 -0500 Subject: [PATCH] Migrate to Workflow_call --- .github/workflows/deployments.yml | 84 +++++++++---------- ...indow-generate-profile-data-and-jarlog.yml | 71 ++++++++++++++++ .github/workflows/windows-build.yml | 2 +- 3 files changed, 110 insertions(+), 47 deletions(-) create mode 100644 .github/workflows/window-generate-profile-data-and-jarlog.yml diff --git a/.github/workflows/deployments.yml b/.github/workflows/deployments.yml index 3d2196d209d..0f0276d669b 100644 --- a/.github/workflows/deployments.yml +++ b/.github/workflows/deployments.yml @@ -82,46 +82,10 @@ jobs: Part2-win-x86_64-gen-profdata-and-jarlog: needs: Part1-win-x86_64-build-with-profgen-zstd - runs-on: windows-2022 - - steps: - - uses: actions/download-artifact@v3 - name: Download artifact 📥 - with: - name: midori-windows-x86_64-build-with-profgen-zstd - path: C:\artifact - - - name: Unpack artifact - run: | - cd C:\artifact - zstd -d midori-*.tar.zst - 7z x midori-*.tar - - - uses: actions/checkout@v3 - name: Clone 🧬 - - - name: Setup 🪛 - run: | - (New-Object System.Net.WebClient).DownloadFile("https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe","C:\MozillaBuildSetup-Latest.exe") - C:\MozillaBuildSetup-Latest.exe /S | out-null - - - name: Generate 🔄 - run: | - $workspace_dir = [regex]::replace($env:GITHUB_WORKSPACE, "^([A-Z]):", { "/" + $args.value.Substring(0, 1).toLower() }) -replace "\\","/" - - echo "cd $workspace_dir" '' >> mozilla-build-run.sh - echo 'export PATH=/c/mozilla-build/msys2/usr/bin:$PATH' '' >> mozilla-build-run.sh - echo './mach --no-interactive bootstrap --application-choice browser' '' >> mozilla-build-run.sh - echo 'LLVM_PROFDATA=/c/Users/runneradmin/.mozbuild/clang/bin/llvm-profdata.exe JARLOG_FILE=en-US.log ./mach python build/pgo/profileserver.py --binary /c/artifact/midori/midori.exe' '' >> mozilla-build-run.sh - C:\mozilla-build\start-shell.bat $workspace_dir\mozilla-build-run.sh - - - name: Publish 🎁 - uses: actions/upload-artifact@v3 - with: - name: midori-windows-x86_64-profdata-and-jarlog - path: | - merged.profdata - en-US.log +uses: ./.github/workflows/window-generate-profile-data-and-jarlog.yml + with: + browser-artifact-name: midori-windows-x86_64-build-with-profgen-zstd + arch: x86_64 Part3-win-x86_64-build-with-profdata-and-jarlog: needs: [Part2-win-x86_64-gen-profdata-and-jarlog, get-buildid] @@ -136,19 +100,40 @@ jobs: MOZ_BUILD_DATE: ${{needs.get-buildid.outputs.buildids}} release-note-url: ${{ inputs.release-note-url }} -################################################################ ↑ Windows x86_64 Build #################################################################################### +################################################################ ↑ Windows x86_64 Build ################################################################################### - Part1-linux-x86_64-build-with-PGO: - uses: ./.github/workflows/linux-build.yml - needs: [get-buildid] + Part1-win-x86-build-with-profgen-zstd: + uses: ./.github/workflows/windows-build.yml + with: + profgen: true + aarch64: false + build32bit: true + zstd: true + buildjet: ${{ inputs.buildjet }} + + Part2-win-x86-gen-profdata-and-jarlog: + needs: Part1-win-x86-build-with-profgen-zstd + uses: ./.github/workflows/window-generate-profile-data-and-jarlog.yml + with: + browser-artifact-name: midori-windows-x86-build-with-profgen-zstd + arch: x86 + + Part3-win-x86-build-with-profdata-and-jarlog: + needs: [Part2-win-x86-gen-profdata-and-jarlog, get-buildid] + uses: ./.github/workflows/windows-build.yml with: aarch64: false - beta: false mar: true + build32bit: true + beta: false buildjet: ${{ inputs.buildjet }} + profdata_jarlog_artifact_name: "midori-windows-x86-profdata-and-jarlog" + out_artifact_name: please-use-this-midori-windows-x86-package-build-with-profdata-and-jarlog MOZ_BUILD_DATE: ${{needs.get-buildid.outputs.buildids}} release-note-url: ${{ inputs.release-note-url }} +################################################################ ↑ Windows x86 Build #################################################################################### + ################################################################ ↑ Linux x86_64 Build #################################################################################### Part1-linux-aarch64-build: uses: ./.github/workflows/linux-build.yml @@ -284,7 +269,7 @@ jobs: ####################################################################### macOS Universal ####################################################################### Deploy-to-installer: - needs: [Part1-linux-x86_64-build-with-PGO, Part1-linux-aarch64-build, Part4-macOS-Universal-package-and-sign, Part3-win-x86_64-build-with-profdata-and-jarlog, get-display-version] + needs: [Part1-linux-x86_64-build-with-PGO, Part1-linux-aarch64-build, Part4-macOS-Universal-package-and-sign, Part3-win-x86_64-build-with-profdata-and-jarlog, Part3-win-x86-build-with-profdata-and-jarlog, get-display-version] runs-on: ubuntu-latest environment: name: Deploy-to-installer-release @@ -302,6 +287,7 @@ jobs: mkdir -p ~/downloads/artifacts/linux-x64 mkdir -p ~/downloads/artifacts/linux-aarch64 mkdir -p ~/downloads/artifacts/windows-x64 + mkdir -p ~/downloads/artifacts/windows-x86 mkdir -p ~/downloads/artifacts/macOS-x64 - name: download Linux x86_64 build artifact 📥 @@ -322,6 +308,12 @@ jobs: name: please-use-this-midori-windows-x86_64-package-build-with-profdata-and-jarlog path: ~/downloads/artifacts/windows-x64 + - name: download Windows x86 build artifact📥 + uses: actions/download-artifact@v3 + with: + name: please-use-this-midori-windows-x86-package-build-with-profdata-and-jarlog + path: ~/downloads/artifacts/windows-x86 + - name: download macOS Universal build artifact📥 uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/window-generate-profile-data-and-jarlog.yml b/.github/workflows/window-generate-profile-data-and-jarlog.yml new file mode 100644 index 00000000000..c88c3801930 --- /dev/null +++ b/.github/workflows/window-generate-profile-data-and-jarlog.yml @@ -0,0 +1,71 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +# Please write our copyright if you use this file. +# © 2023 Midori Projects & Contributors + +on: + workflow_call: + inputs: + browser-artifact-name: + description: 'Artifact to download' + required: true + default: 'midori-windows-x86_64-build-with-profgen-zstd' + type: string + arch: + description: 'Architecture to output' + required: true + default: 'x86_64' + type: string + workflow_dispatch: + inputs: + browser-artifact: + description: 'Artifact to download' + required: true + default: 'midori-windows-x86_64-build-with-profgen-zstd' + type: string + arch: + description: 'Architecture to output' + required: true + default: 'x86_64' + type: string +jobs: + Integration: + runs-on: Generate-Profile-data-and-jarlog + steps: + - uses: actions/download-artifact@v3 + name: Download artifact 📥 + with: + name: ${{ inputs.browser-artifact-name }} + path: C:\artifact + + - name: Unpack artifact + run: | + cd C:\artifact + zstd -d midori-*.tar.zst + 7z x midori-*.tar + - uses: actions/checkout@v3 + name: Clone 🧬 + + - name: Setup 🪛 + run: | + (New-Object System.Net.WebClient).DownloadFile("https://ftp.mozilla.org/pub/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe","C:\MozillaBuildSetup-Latest.exe") + C:\MozillaBuildSetup-Latest.exe /S | out-null + - name: Generate 🔄 + run: | + $workspace_dir = [regex]::replace($env:GITHUB_WORKSPACE, "^([A-Z]):", { "/" + $args.value.Substring(0, 1).toLower() }) -replace "\\","/" + + echo "cd $workspace_dir" '' >> mozilla-build-run.sh + echo 'export PATH=/c/mozilla-build/msys2/usr/bin:$PATH' '' >> mozilla-build-run.sh + echo './mach --no-interactive bootstrap --application-choice browser' '' >> mozilla-build-run.sh + echo 'LLVM_PROFDATA=/c/Users/runneradmin/.mozbuild/clang/bin/llvm-profdata.exe JARLOG_FILE=en-US.log ./mach python build/pgo/profileserver.py --binary /c/artifact/midori/midori.exe' '' >> mozilla-build-run.sh + C:\mozilla-build\start-shell.bat $workspace_dir\mozilla-build-run.sh + + - name: Publish 🎁 + uses: actions/upload-artifact@v3 + with: + name: midori-windows-${{ inputs.arch }}-profdata-and-jarlog + path: | + merged.profdata + en-US.log \ No newline at end of file diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 4cf5d85adcd..6146a1c799d 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -349,7 +349,7 @@ jobs: fs.appendFileSync(process.env.GITHUB_ENV, `ARTIFACT_NAME=${name}`); env: GHA_out_artifact_name : ${{inputs.out_artifact_name}} - GHA_default_name: midori-windows-${{fromJson('["x86_64","aarch64"]')[inputs.aarch64]}}-${{fromJson('["package","build-with-profgen"]')[inputs.profgen]}}${{fromJson('["","-zstd"]')[inputs.zstd]}} + GHA_default_name: midori-windows-${{fromJson('["x86","aarch"]')[inputs.aarch64]}}-${{fromJson('["_64",""]')[inputs.build32bit]}}-${{fromJson('["package","build-with-profgen"]')[inputs.profgen]}}${{fromJson('["","-zstd"]')[inputs.zstd]}} - name: Publish Package🎁 uses: actions/upload-artifact@v3