Skip to content

Commit 83acffe

Browse files
committed
Use Buildkite artifacts instead of S3 since we don't know the credentials from GHA.
1 parent b1a0451 commit 83acffe

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

.buildkite/commands/process-screenshots.sh

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,40 @@ cp -v fastlane/env/project.env.example ~/.configure/woocommerce-ios/secrets/proj
2121
echo "--- :gear: Setup Fastlane Dependencies"
2222
bundle exec fastlane run configure_apply
2323

24-
echo "--- :arrow_down: Download Generated Screenshots from S3"
24+
echo "--- :arrow_down: Download Generated Screenshots from CI Artifacts"
2525
cd fastlane
2626
mkdir -p screenshots
27-
aws s3 cp "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/" screenshots/ --recursive --exclude "*.html"
27+
# Download all screenshot artifacts from the take-screenshots jobs
28+
buildkite-agent artifact download "fastlane/screenshots-*/**/*" . --step "take-screenshots"
2829

2930
echo "--- :chart_with_upwards_trend: Generate Screenshot Summary"
3031
bundle exec fastlane create_screenshot_summary
31-
aws s3 cp screenshots/screenshots.html "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID}/screenshots/screenshots.html"
3232

3333
echo "--- :arrow_down: Install Promo Screenshot Fonts"
3434
cd ..
35-
aws s3 cp "s3://${S3_BUCKET}/fonts.zip" fonts.zip
36-
unzip fonts.zip
37-
38-
# Install fonts system-wide and user-level
39-
mkdir -p ~/Library/Fonts
40-
cp -v fonts/*.otf ~/Library/Fonts
41-
ls ~/Library/Fonts
42-
43-
mkdir -p /Library/Fonts
44-
sudo cp -v fonts/*.otf /Library/Fonts
45-
ls /Library/Fonts
46-
47-
# Reset the font server to recognize new fonts
48-
atsutil databases -removeUser
49-
atsutil server -shutdown
50-
atsutil server -ping
35+
# Download fonts from artifacts (assuming fonts are uploaded as artifacts in a separate step)
36+
buildkite-agent artifact download "fonts.zip" . --step "prepare-fonts" || echo "No fonts artifact found, continuing without promo fonts"
37+
if [ -f "fonts.zip" ]; then
38+
unzip fonts.zip
39+
fi
40+
41+
# Install fonts system-wide and user-level (only if fonts exist)
42+
if [ -d "fonts" ] && [ "$(ls -A fonts/*.otf 2>/dev/null)" ]; then
43+
mkdir -p ~/Library/Fonts
44+
cp -v fonts/*.otf ~/Library/Fonts
45+
ls ~/Library/Fonts
46+
47+
mkdir -p /Library/Fonts
48+
sudo cp -v fonts/*.otf /Library/Fonts
49+
ls /Library/Fonts
50+
51+
# Reset the font server to recognize new fonts
52+
atsutil databases -removeUser
53+
atsutil server -shutdown
54+
atsutil server -ping
55+
else
56+
echo "No fonts found, skipping font installation"
57+
fi
5158

5259
echo "--- :art: Generate Promo Screenshots"
5360
git lfs install && git lfs fetch && git lfs pull

.buildkite/commands/take-screenshots.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,11 @@ bundle exec fastlane take_screenshots \
2828
languages:"${SCREENSHOT_LANGUAGE}" \
2929
mode:"${SCREENSHOT_MODE}"
3030

31-
echo "--- :arrow_up: Upload Screenshots to S3"
31+
echo "--- :arrow_up: Upload Screenshots as CI Artifacts"
3232
# Create unique directory for this job's screenshots
3333
SCREENSHOT_DIR="fastlane/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}"
3434
if [ -d "fastlane/screenshots" ]; then
3535
mv fastlane/screenshots "${SCREENSHOT_DIR}"
36-
# Check if S3_BUCKET is set before uploading
37-
if [ -n "${S3_BUCKET:-}" ]; then
38-
aws s3 cp "${SCREENSHOT_DIR}" "s3://${S3_BUCKET}/${BUILDKITE_BUILD_ID:-unknown}/screenshots-${SCREENSHOT_LANGUAGE}-${SCREENSHOT_MODE}/" --recursive --exclude "*.html"
39-
else
40-
echo "S3_BUCKET not set, skipping upload"
41-
fi
36+
# Upload as Buildkite artifacts for later processing
37+
buildkite-agent artifact upload "${SCREENSHOT_DIR}/**/*" --job "${BUILDKITE_JOB_ID}"
4238
fi

0 commit comments

Comments
 (0)