Skip to content

Commit 4f8a701

Browse files
committed
build(system-tests): fetch manylinux builds from ddtrace
1 parent db67384 commit 4f8a701

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/build_layer.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,32 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v4
2020

21+
- name: Generate token
22+
id: generate_token
23+
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
24+
with:
25+
app-id: ${{ secrets.GH_APP_ID }}
26+
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
27+
28+
- name: Download ddtrace wheel from GitHub workflow artifacts
29+
env:
30+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
31+
32+
run: |
33+
WORKFLOWS=$(curl --silent --fail --show-error -H "Authorization: token $GH_TOKEN" "https://api.github.com/repos/DataDog/dd-trace-py/actions/workflows/build_deploy.yml/runs?per_page=100")
34+
ARTIFACT_URL=$(echo "$WORKFLOWS" | jq -r '[.workflow_runs[] | select(.conclusion != "failure" and .head_branch == "main" and .status == "completed")][0] | .artifacts_url')
35+
ARTIFACTS=$(curl --silent --fail --show-error -H "Authorization: token $GH_TOKEN" "$ARTIFACT_URL")
36+
37+
VERSION_NO_DOT=$(echo ${{ matrix.python_version }} | sed 's/\.//g')
38+
DDTRACE_ARCH=$(if [ "${{ matrix.arch }}" == "arm64" ]; then echo "aarch64"; else echo "x86_64"; fi)
39+
ARTIFACT_NAME=wheels-cp${VERSION_NO_DOT}-manylinux_${DDTRACE_ARCH}
40+
41+
ARCHIVE_URL=$(echo "$ARTIFACTS" | jq -r '.artifacts[] | select(.name == "'"${ARTIFACT_NAME}"'") | .archive_download_url')
42+
43+
curl --silent --fail --show-error -H "Authorization: token $GH_TOKEN" -L "$ARCHIVE_URL" --output artifacts.zip
44+
unzip artifacts.zip
45+
46+
2147
- name: Patch pyproject.toml
2248
run: |
2349
echo "Patching pyproject.toml to use main branch of dd-trace-py"

0 commit comments

Comments
 (0)