Skip to content

Commit 039d369

Browse files
fix[ci]: fix commithash calculation for pypi release (vyperlang#4309)
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. it also adds a debug step to the relevant workflows so that we can debug the commit hash during the github action.
1 parent 8f9a8ca commit 039d369

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ jobs:
3131
# need to fetch unshallow so that setuptools_scm can infer the version
3232
fetch-depth: 0
3333

34+
# debug
35+
- name: Git shorthash
36+
run: git rev-parse --short HEAD
37+
3438
- name: Python
3539
uses: actions/setup-python@v5
3640
with:
@@ -60,6 +64,10 @@ jobs:
6064
# need to fetch unshallow so that setuptools_scm can infer the version
6165
fetch-depth: 0
6266

67+
# debug
68+
- name: Git shorthash
69+
run: git rev-parse --short HEAD
70+
6371
- name: Python
6472
uses: actions/setup-python@v5
6573
with:

.github/workflows/release-pypi.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ jobs:
2020

2121
steps:
2222
- uses: actions/checkout@v4
23+
with:
24+
# fetch unshallow so commit hash matches github release.
25+
# see https://github.com/vyperlang/vyper/blob/8f9a8cac49aafb3fbc9dde78f0f6125c390c32f0/.github/workflows/build.yml#L27-L32
26+
fetch-depth: 0
27+
28+
# debug
29+
- name: Git shorthash
30+
run: git rev-parse --short HEAD
2331

2432
- name: Python
2533
uses: actions/setup-python@v5

0 commit comments

Comments
 (0)