Skip to content

Commit 744c71e

Browse files
committed
Test CI wheel artifact handling
1 parent 0dc1d77 commit 744c71e

File tree

5 files changed

+20
-29
lines changed

5 files changed

+20
-29
lines changed

.github/actions/upload-artifact-wheel/action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,30 @@ runs:
88
shell: bash
99
if:
1010
github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name ==
11-
'nightly' || github.ref_name == 'master')
11+
'nightly' || github.ref_name == 'master' || github.ref_name == 'test-ci')
1212
id: vars
1313
run: |
1414
if [ ! -d "./dist" ]; then
1515
echo "Error: dist directory not found"
1616
exit 1
1717
fi
1818
19-
ASSET_PATH=$(find ./dist -name "*.whl" -type f | xargs ls -t 2>/dev/null | head -n 1)
19+
ASSET_PATH=$(find ./dist -name "nautilus_trader-*.whl" -type f | xargs ls -t 2>/dev/null | head -n 1)
2020
2121
if [ -z "$ASSET_PATH" ]; then
22-
echo "Error: No .whl files found in dist directory"
22+
echo "Error: No nautilus_trader wheel files found in dist directory"
2323
exit 1
2424
fi
2525
26-
echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV
2726
echo "ASSET_NAME=$(basename "$ASSET_PATH")" >> $GITHUB_ENV
2827
2928
- name: Upload wheel artifact
3029
if:
3130
github.event_name == 'push' && (github.ref_name == 'develop' || github.ref_name ==
32-
'nightly' || github.ref_name == 'master')
31+
'nightly' || github.ref_name == 'master' || github.ref_name == 'test-ci')
3332
# https://github.com/actions/upload-artifact
33+
# Use wildcard to flatten dist/ prefix: path before first wildcard is stripped
3434
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3535
with:
3636
name: ${{ env.ASSET_NAME }}
37-
path: ${{ env.ASSET_PATH }}
37+
path: dist/nautilus_trader-*.whl

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ jobs:
416416
- name: Attest wheel provenance
417417
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
418418
with:
419-
subject-path: 'dist/*.whl'
419+
subject-path: 'dist/nautilus_trader-*.whl'
420420

421421
- name: Publish wheels to Cloudflare R2
422422
uses: ./.github/actions/publish-wheels
@@ -480,7 +480,7 @@ jobs:
480480
- name: Attest wheel provenance
481481
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
482482
with:
483-
subject-path: 'dist/*.whl'
483+
subject-path: 'dist/nautilus_trader-*.whl'
484484

485485
- name: Publish wheels to Cloudflare R2
486486
uses: ./.github/actions/publish-wheels
@@ -557,7 +557,7 @@ jobs:
557557
- name: Attest wheel provenance
558558
uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0
559559
with:
560-
subject-path: 'dist/*.whl'
560+
subject-path: 'dist/nautilus_trader-*.whl'
561561

562562
- name: Publish wheels to Cloudflare R2
563563
uses: ./.github/actions/publish-wheels
@@ -571,7 +571,7 @@ jobs:
571571
set +e
572572
success=false
573573
for i in {1..5}; do
574-
gh release upload "$TAG_NAME" dist/*.whl --clobber --repo "$GITHUB_REPOSITORY"
574+
gh release upload "$TAG_NAME" dist/nautilus_trader-*.whl --clobber --repo "$GITHUB_REPOSITORY"
575575
status=$?
576576
if [ $status -eq 0 ]; then
577577
success=true

scripts/ci/publish-wheels-generate-index.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ declare -A final_hashes=()
4545

4646
# First, calculate hashes for all new/updated wheels
4747
# These will override any existing hashes for the same filename
48-
for file in dist/all/*.whl; do
48+
for file in dist/nautilus_trader-*.whl; do
4949
if [[ -f "$file" ]]; then
5050
filename=$(basename "$file")
5151
hash=$(sha256sum "$file" | awk '{print $1}')
@@ -55,7 +55,7 @@ for file in dist/all/*.whl; do
5555
done
5656

5757
# Get list of all wheel files in bucket
58-
existing_files=$(aws s3 ls "${bucket_path}" --endpoint-url="${CLOUDFLARE_R2_URL}" | grep '\.whl$' | awk '{print $4}')
58+
existing_files=$(aws s3 ls "${bucket_path}" --endpoint-url="${CLOUDFLARE_R2_URL}" | grep 'nautilus_trader-.*\.whl$' | awk '{print $4}')
5959

6060
# For existing files, use hash from index if we don't have a new one
6161
for file in $existing_files; do

scripts/ci/publish-wheels-r2-upload-new-wheels.sh

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,18 @@ set -euo pipefail
33

44
echo "Uploading new wheels to Cloudflare R2..."
55

6-
echo "Initial dist/ contents:"
6+
echo "dist/ contents:"
77
ls -la dist/
8-
find dist/ -type f -name "*.whl" -ls
8+
find dist/ -type f -name "nautilus_trader-*.whl" -ls
99

10-
# Create clean directory for real files
11-
mkdir -p dist/all
12-
13-
# Copy all files into dist/all/ to resolve symlinks
14-
find dist/ -type f -name "*.whl" -exec cp -L {} dist/all/ \;
15-
16-
# First check for any wheels
17-
if ! find dist/all/ -type f -name "*.whl" > /dev/null 2>&1; then
18-
echo "No wheels found in dist/all/, exiting"
10+
# Verify wheels exist
11+
if ! find dist/ -type f -name "nautilus_trader-*.whl" -print -quit | grep -q .; then
12+
echo "ERROR: No wheels found in dist/"
1913
exit 1
2014
fi
2115

22-
echo "Contents of dist/all/:"
23-
ls -la dist/all/
24-
2516
wheel_count=0
26-
for file in dist/all/*.whl; do
17+
for file in dist/nautilus_trader-*.whl; do
2718
echo "File details for $file:"
2819
ls -l "$file"
2920
file "$file"

scripts/ci/validate-wheel-count.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ fi
1818

1919
echo "Validating wheel count in dist/ directory..."
2020

21-
wheel_count=$(find dist/ -name "*.whl" -type f | wc -l)
21+
wheel_count=$(find dist/ -name "nautilus_trader-*.whl" -type f | wc -l)
2222

2323
if [ "$wheel_count" -ne "$expected_count" ]; then
2424
echo "ERROR: Expected $expected_count wheels, found $wheel_count" >&2
2525
echo "Downloaded wheels:" >&2
26-
find dist/ -name "*.whl" -type f -ls >&2
26+
find dist/ -name "nautilus_trader-*.whl" -type f -ls >&2
2727
exit 1
2828
fi
2929

0 commit comments

Comments
 (0)