From 6bd582113bf24c06629a4fb2ebef240485fbb35e Mon Sep 17 00:00:00 2001 From: Charles Cooper Date: Tue, 15 Oct 2024 08:54:02 -0400 Subject: [PATCH] fix[ci]: fix commithash calculation for pypi release there is a mismatch between the commit hash in the binary of the github release vs the pypi release. for example, ```bash ~ $ vyper --version # pipx install vyper==0.4.0 0.4.0+commit.e9db8d9 ``` ```bash ~ $ .vvm/vyper-0.4.0 --version 0.4.0+commit.e9db8d9f ``` this is due to how git computes the shorthash. when checkout is run for release-pypi.yml, it doesn't fetch the full commit history, and so there are fewer commits, so `git rev-parse --short HEAD` returns a smaller fingerprint for the commit hash. this commit amends the pypi release checkout step so that it matches the github release workflow. --- .github/workflows/release-pypi.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-pypi.yml b/.github/workflows/release-pypi.yml index d09aeb9adc..4d824906b8 100644 --- a/.github/workflows/release-pypi.yml +++ b/.github/workflows/release-pypi.yml @@ -20,6 +20,10 @@ jobs: steps: - uses: actions/checkout@v4 + with: + # fetch unshallow so commit hash matches github release. + # see https://github.com/vyperlang/vyper/blob/8f9a8cac49aafb3fbc9dde78f0f6125c390c32f0/.github/workflows/build.yml#L27-L32 + fetch-depth: 0 - name: Python uses: actions/setup-python@v5