Skip to content

Commit beb5f67

Browse files
committed
🧪 Add hashes reusable-cibuildwheel artifacts
1 parent 308ff62 commit beb5f67

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

‎.github/workflows/reusable-cibuildwheel.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,25 @@ jobs:
5252
runs-on: ${{ inputs.runner-vm-os }}
5353
timeout-minutes: ${{ inputs.qemu && 60 || 20 }}
5454
steps:
55+
- name: Compute GHA artifact name ending
56+
id: gha-artifact-name
57+
run: |
58+
from hashlib import sha512
59+
from os import environ
60+
from pathlib import Path
61+
62+
FILE_APPEND_MODE = 'a'
63+
64+
inputs_json_str = """${{ toJSON(inputs) }}"""
65+
66+
hash = sha512(inputs_json_str.encode()).hexdigest()
67+
68+
with Path(environ['GITHUB_OUTPUT']).open(
69+
mode=FILE_APPEND_MODE,
70+
) as outputs_file:
71+
print(f'hash={hash}', file=outputs_file)
72+
shell: python
73+
5574
- name: Retrieve the project source from an sdist inside the GHA artifact
5675
uses: re-actors/checkout-python-sdist@release/v2
5776
with:
@@ -96,7 +115,8 @@ jobs:
96115
name: ${{ inputs.dists-artifact-name }}-
97116
${{ inputs.runner-vm-os }}-
98117
${{ inputs.qemu }}-
99-
${{ inputs.tag }}
118+
${{ inputs.tag }}-
119+
${{ steps.gha-artifact-name.outputs.hash }}
100120
path: ./wheelhouse/*.whl
101121

102122
...

0 commit comments

Comments
 (0)