From ca4952c02cbf2996a51fc9bfd746a735b0b80cc1 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 25 Jan 2025 00:44:40 +0100 Subject: [PATCH] Add build ID generation and pass to build workflows --- .github/workflows/build.yml | 24 +++++++++++++++++---- .github/workflows/linux-release-build.yml | 7 ++++++ .github/workflows/macos-release-build.yml | 7 ++++++ .github/workflows/windows-release-build.yml | 7 ++++++ 4 files changed, 41 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 75fa36403..66c177bb3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,6 +54,18 @@ jobs: echo "GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}" echo "GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}" + buildid: + name: Generate build ID + runs-on: ubuntu-latest + outputs: + buildids: ${{ steps.get.outputs.bid }} + steps: + - id: get + shell: bash -xe {0} + run: | + bdat=`date +"%Y%m%d%I%M%S"` + echo "bid=${bdat}" >> $GITHUB_OUTPUT + start-self-host: runs-on: ubuntu-latest needs: debug-inputs @@ -294,7 +306,7 @@ jobs: windows-step-1: name: Windows build step 1 (PGO build) uses: ./.github/workflows/windows-release-build.yml - needs: [build-data] + needs: [build-data, buildid] permissions: contents: write secrets: inherit @@ -303,6 +315,7 @@ jobs: generate-gpo: true profile-data-path-archive: zen-windows-profile-data-and-jarlog.zip release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} windows-step-2: name: Windows build step 2 (Generate profile data) @@ -322,11 +335,12 @@ jobs: permissions: contents: write secrets: inherit - needs: [build-data, windows-step-2, start-self-host] + needs: [build-data, windows-step-2, start-self-host, buildid] with: build-version: ${{ needs.build-data.outputs.version }} generate-gpo: false release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} linux: name: Linux build @@ -334,10 +348,11 @@ jobs: permissions: contents: write secrets: inherit - needs: [build-data, start-self-host] + needs: [build-data, start-self-host, buildid] with: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} mac: name: macOS build @@ -345,10 +360,11 @@ jobs: permissions: contents: write secrets: inherit - needs: [build-data] + needs: [build-data, buildid] with: build-version: ${{ needs.build-data.outputs.version }} release-branch: ${{ inputs.update_branch }} + MOZ_BUILD_DATE: ${{needs.buildid.outputs.buildids}} mac-uni: name: macOS build (Universal) diff --git a/.github/workflows/linux-release-build.yml b/.github/workflows/linux-release-build.yml index 6875bf682..d112eb5fd 100644 --- a/.github/workflows/linux-release-build.yml +++ b/.github/workflows/linux-release-build.yml @@ -11,6 +11,10 @@ on: description: 'The branch to build' required: true type: string + MOZ_BUILD_DATE: + type: string + required: true + default: "" jobs: build-linux: @@ -130,6 +134,9 @@ jobs: continue-on-error: true run: | export SURFER_PLATFORM="linux" + if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then + export MOZ_BUILD_DATE=${{ inputs.MOZ_BUILD_DATE }} + fi bash .github/workflows/src/release-build.sh - name: Package diff --git a/.github/workflows/macos-release-build.yml b/.github/workflows/macos-release-build.yml index a1b2e06b9..8c4d93622 100644 --- a/.github/workflows/macos-release-build.yml +++ b/.github/workflows/macos-release-build.yml @@ -11,6 +11,10 @@ on: description: 'The branch to build' required: true type: string + MOZ_BUILD_DATE: + type: string + required: true + default: "" jobs: mac-build: @@ -118,6 +122,9 @@ jobs: ZEN_RELEASE_BRANCH: ${{ inputs.release-branch }} run: | export SURFER_PLATFORM="darwin" + if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then + export MOZ_BUILD_DATE=${{ inputs.MOZ_BUILD_DATE }} + fi bash .github/workflows/src/release-build.sh - name: Package diff --git a/.github/workflows/windows-release-build.yml b/.github/workflows/windows-release-build.yml index c6333e8b0..6f0126e2f 100644 --- a/.github/workflows/windows-release-build.yml +++ b/.github/workflows/windows-release-build.yml @@ -18,6 +18,10 @@ on: description: 'The branch to build' required: true type: string + MOZ_BUILD_DATE: + type: string + required: true + default: "" jobs: windows-build: @@ -215,6 +219,9 @@ jobs: if test ${{ inputs.generate-gpo }} = true; then export ZEN_GA_GENERATE_PROFILE=1 fi + if [[ -n ${{ inputs.MOZ_BUILD_DATE }} ]];then + export MOZ_BUILD_DATE=${{ inputs.MOZ_BUILD_DATE }} + fi bash .github/workflows/src/release-build.sh - name: Package