Skip to content

Commit e7e9633

Browse files
committed
fix(ci): don't noodle through the simple index when hashing the build artifacts
1 parent 4f90307 commit e7e9633

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/_build.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ jobs:
107107
108108
# Find the paths to the artifact files that will be included in the release, compute
109109
# the SHA digest for all the release files and encode them using Base64, and export it
110-
# from this job.
110+
# from this job. Note that using -maxdepth 1 prevents searching through the generated
111+
# Simple Index, which contains duplicated sdist and wheel files.
111112
- name: Compute package hash
112113
if: matrix.os == env.ARTIFACT_OS && matrix.python == env.ARTIFACT_PYTHON
113114
id: compute-hash
@@ -116,12 +117,12 @@ jobs:
116117
set -euo pipefail
117118
TARBALL_PATH=$(find dist/ -maxdepth 1 -type f -name "*.tar.gz")
118119
WHEEL_PATH=$(find dist/ -maxdepth 1 -type f -name "*.whl")
119-
SIMPLE_INDEX_PATH=$(find dist/ -type f -name "*-simple-index.tar")
120-
REQUIREMENTS_PATH=$(find dist/ -type f -name "*-requirements.txt")
121-
SBOM_PATH=$(find dist/ -type f -name "*-sbom.json")
122-
SBOM_GO_PATH=$(find dist/ -type f -name "*-sbom-go.json")
123-
HTML_DOCS_PATH=$(find dist/ -type f -name "*-docs-html.zip")
124-
BUILD_EPOCH_PATH=$(find dist/ -type f -name "*-build-epoch.txt")
120+
SIMPLE_INDEX_PATH=$(find dist/ -maxdepth 1 -type f -name "*-simple-index.tar")
121+
REQUIREMENTS_PATH=$(find dist/ -maxdepth 1 -type f -name "*-requirements.txt")
122+
SBOM_PATH=$(find dist/ -maxdepth 1 -type f -name "*-sbom.json")
123+
SBOM_GO_PATH=$(find dist/ -maxdepth 1 -type f -name "*-sbom-go.json")
124+
HTML_DOCS_PATH=$(find dist/ -maxdepth 1 -type f -name "*-docs-html.zip")
125+
BUILD_EPOCH_PATH=$(find dist/ -maxdepth 1 -type f -name "*-build-epoch.txt")
125126
DIGEST=$(sha256sum "$TARBALL_PATH" "$WHEEL_PATH" "$SIMPLE_INDEX_PATH" "$REQUIREMENTS_PATH" "$SBOM_PATH" \
126127
"$SBOM_GO_PATH" "$HTML_DOCS_PATH" "$BUILD_EPOCH_PATH" | base64 -w0)
127128
echo "Digest of artifacts is $DIGEST."

0 commit comments

Comments
 (0)