Skip to content

Commit e4b528d

Browse files
alexlianfacebook-github-bot
authored andcommitted
Refactor version info propagation
Summary: Re-use GITHUB_OUTPUTs to grab version information and simplify the build step. Reviewed By: Will-MingLun-Li Differential Revision: D72233407 fbshipit-source-id: baf6b5a692fef84f39d36bc450d28039501ac2cb
1 parent 135cb54 commit e4b528d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

.github/workflows/upload_buck2.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ jobs:
4646
build:
4747
needs:
4848
- get_prelude_hash
49+
- set_version_info
4950
strategy:
5051
fail-fast: false
5152
matrix:
@@ -111,6 +112,10 @@ jobs:
111112
- name: Build
112113
shell: bash
113114
env:
115+
# BUCK2 prefixed variables used within the build to stamp in a version information
116+
# BUCK2_SET_EXPLICIT_VERSION will populate the buck2 --version string
117+
BUCK2_RELEASE_TIMESTAMP: ${{ github.event.repository.updated_at }}
118+
BUCK2_SET_EXPLICIT_VERSION: ${{ needs.set_version_info.outputs.buck2_version }}
114119
RUSTFLAGS: "-C strip=debuginfo -C codegen-units=1"
115120
run: |
116121
# aarch64-linux builds need JEMALLOC_SYS_WITH_LG_PAGE=16
@@ -124,10 +129,6 @@ jobs:
124129
else
125130
CARGO=cargo
126131
fi
127-
# Specify the release version information
128-
commit_date=$(echo "${{ github.event.repository.updated_at }}" | sed 's/T.*//')
129-
export BUCK2_SET_EXPLICIT_VERSION="$commit_date-${{ github.sha }}"
130-
export BUCK2_RELEASE_TIMESTAMP="${{ github.event.repository.updated_at }}"
131132
$CARGO build --release --bin buck2 --bin rust-project --target ${{ matrix.target.triple }}
132133
- name: Sanity check with examples/with_prelude
133134
if: ${{ !matrix.target.cross }}

0 commit comments

Comments
 (0)