-
Notifications
You must be signed in to change notification settings - Fork 121
[iOS Screenshots CI] Fix screenshots generation GitHub Action #15822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 37 commits
06476ef
2caeee9
9b2e082
afd89c0
7816c79
f719660
4038f98
444a6e1
a4f18d0
d9674d6
dd81581
ebc89b3
9f6eb2e
52aa932
040dd35
b1a0451
83acffe
91cbef9
3408a99
97d7b69
ad1db4f
d34e8b1
b733d22
2d980bc
79a93a2
3e30316
9768ce0
9eed136
c941377
495d3ca
9ea46a5
14c7a7c
d7d8a5f
c7b8073
ab3944a
df09ae6
aca0843
dfa74a8
580a40f
f90287c
602c99c
01278a7
172b470
5112f63
6f118d2
f02111c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,16 +5,13 @@ on: | |||||||
| types: [opened, synchronize, reopened, labeled, unlabeled] | ||||||||
|
|
||||||||
| env: | ||||||||
| S3_BUCKET: ${{ secrets.S3_BUCKET }} | ||||||||
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||||||||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||||||||
| CONFIGURE_ENCRYPTION_KEY: ${{ secrets.CONFIGURE_ENCRYPTION_KEY }} | ||||||||
|
|
||||||||
| jobs: | ||||||||
| build: | ||||||||
| name: Build Application | ||||||||
| if: contains(github.event.pull_request.labels.*.name, 'generate screenshots') | ||||||||
| runs-on: macos-latest | ||||||||
| runs-on: macos-15 | ||||||||
|
|
||||||||
| steps: | ||||||||
| - name: "Check out Project" | ||||||||
|
|
@@ -30,26 +27,20 @@ jobs: | |||||||
| - name: Compile the App | ||||||||
| run: bundle exec fastlane build_screenshots | ||||||||
|
|
||||||||
| - name: Archive App | ||||||||
| - name: Archive Build Products | ||||||||
| uses: actions/upload-artifact@v4 | ||||||||
| with: | ||||||||
| name: screenshot-app | ||||||||
| path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app | ||||||||
|
|
||||||||
| - name: Archive Runner | ||||||||
| uses: actions/upload-artifact@v4 | ||||||||
| with: | ||||||||
| name: screenshot-runner | ||||||||
| path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app | ||||||||
| name: screenshot-build-products | ||||||||
| path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably not worth it for the storage reclaim per se, but maybe worth it to make it clearer that these are discardable adding something like:
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, updated in f02111c. |
||||||||
|
|
||||||||
| capture: | ||||||||
| name: Capture | ||||||||
| needs: build | ||||||||
| runs-on: macos-latest | ||||||||
| runs-on: macos-15 | ||||||||
|
|
||||||||
| strategy: | ||||||||
| matrix: | ||||||||
| language: [ar, de-DE, en-US, es-ES, fr-FR, he, id, it, ja, ko, nl-NL, pt-BR, ru, sv, tr, zh-Hans, zh-Hant] | ||||||||
| language: [en-US, zh-Hant] | ||||||||
| mode: [dark, light] | ||||||||
| steps: | ||||||||
| - uses: actions/checkout@v4 | ||||||||
|
|
@@ -61,17 +52,11 @@ jobs: | |||||||
| - name: Install Fastlane Dependencies | ||||||||
| run: bundle exec fastlane run configure_apply | ||||||||
|
|
||||||||
| - name: Download Screenshot App | ||||||||
| - name: Download Build Products | ||||||||
| uses: actions/download-artifact@v4 | ||||||||
| with: | ||||||||
| name: screenshot-app | ||||||||
| path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app | ||||||||
|
|
||||||||
| - name: Download Screenshot Runner | ||||||||
| uses: actions/download-artifact@v4 | ||||||||
| with: | ||||||||
| name: screenshot-runner | ||||||||
| path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerceScreenshots-Runner.app | ||||||||
| name: screenshot-build-products | ||||||||
| path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/ | ||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗒️ There are more files required for later steps than just the |
||||||||
|
|
||||||||
| - name: Generate Screenshots | ||||||||
| run: | | ||||||||
|
|
@@ -85,14 +70,15 @@ jobs: | |||||||
| path: fastlane/logs | ||||||||
|
|
||||||||
| - name: Archive Generated Screenshots | ||||||||
| run: | | ||||||||
| cd fastlane && mkdir $GITHUB_RUN_ID && mv screenshots $GITHUB_RUN_ID | ||||||||
| aws s3 cp $GITHUB_RUN_ID s3://$S3_BUCKET/$GITHUB_RUN_ID --recursive --exclude "*.html" | ||||||||
| uses: actions/upload-artifact@v4 | ||||||||
| with: | ||||||||
| name: "screenshots-${{ matrix.language }}-${{ matrix.mode }}" | ||||||||
| path: fastlane/screenshots/ | ||||||||
|
|
||||||||
| process: | ||||||||
| name: "Process Screenshots" | ||||||||
| needs: capture | ||||||||
| runs-on: macos-latest | ||||||||
| runs-on: macos-15 | ||||||||
|
|
||||||||
| steps: | ||||||||
| - uses: actions/checkout@v4 | ||||||||
|
|
@@ -101,6 +87,7 @@ jobs: | |||||||
| run: | | ||||||||
| brew install imagemagick@7 | ||||||||
| brew link imagemagick@7 --force | ||||||||
| brew install automattic/build-tools/drawText | ||||||||
|
|
||||||||
| - name: "Set up Ruby" | ||||||||
| uses: ruby/setup-ruby@v1 | ||||||||
|
|
@@ -114,42 +101,48 @@ jobs: | |||||||
| run: bundle exec fastlane run configure_apply | ||||||||
|
|
||||||||
| - name: Download Generated Screenshots | ||||||||
| run: | | ||||||||
| cd fastlane | ||||||||
| aws s3 cp s3://$S3_BUCKET/$GITHUB_RUN_ID/screenshots screenshots/ --recursive --exclude "*.html" | ||||||||
| uses: actions/download-artifact@v4 | ||||||||
| with: | ||||||||
| pattern: "screenshots-*" | ||||||||
| path: fastlane/screenshots/ | ||||||||
| merge-multiple: true | ||||||||
|
|
||||||||
| - name: Generate and Upload Screenshot Summary | ||||||||
| - name: Generate Screenshot Summary | ||||||||
| run: | | ||||||||
| bundle exec fastlane create_screenshot_summary | ||||||||
| aws s3 cp fastlane/screenshots/screenshots.html s3://$S3_BUCKET/$GITHUB_RUN_ID/screenshots/screenshots.html | ||||||||
|
|
||||||||
| - name: Upload Screenshot Summary | ||||||||
| uses: actions/upload-artifact@v4 | ||||||||
| with: | ||||||||
| name: screenshot-summary | ||||||||
| path: fastlane/screenshots/screenshots.html | ||||||||
|
|
||||||||
| - name: Archive Raw Screenshots | ||||||||
| uses: actions/upload-artifact@v4 | ||||||||
| with: | ||||||||
| name: raw-screenshots | ||||||||
| path: fastlane/screenshots | ||||||||
|
|
||||||||
| - name: Install Promo Screenshot Fonts | ||||||||
| - name: Setup Git LFS and Verify Fonts | ||||||||
| run: | | ||||||||
| aws s3 cp s3://$S3_BUCKET/fonts.zip fonts.zip | ||||||||
| unzip fonts.zip | ||||||||
|
|
||||||||
| mkdir -p ~/Library/Fonts | ||||||||
| cp -v fonts/*.otf ~/Library/Fonts | ||||||||
| ls ~/Library/Fonts | ||||||||
|
|
||||||||
| mkdir -p /Library/Fonts | ||||||||
| cp -v fonts/*.otf /Library/Fonts | ||||||||
| ls /Library/Fonts | ||||||||
|
|
||||||||
| # Reset the font server in order to use these fonts | ||||||||
| atsutil databases -removeUser | ||||||||
| atsutil server -shutdown | ||||||||
| atsutil server -ping | ||||||||
| # Install Git LFS if not available | ||||||||
| if ! command -v git-lfs &> /dev/null; then | ||||||||
| echo "Installing Git LFS..." | ||||||||
| brew install git-lfs | ||||||||
| fi | ||||||||
| git lfs install && git lfs fetch && git lfs pull | ||||||||
| # Verify Proxima Nova is available (should be in macOS 15) | ||||||||
| if system_profiler SPFontsDataType | grep -i "proxima" > /dev/null 2>&1; then | ||||||||
| echo "✅ Proxima Nova font found - ready for promo screenshots" | ||||||||
| else | ||||||||
| echo "⚠️ Proxima Nova font not found - promo screenshots may not render correctly" | ||||||||
| echo "Available fonts with 'nova' in name:" | ||||||||
| system_profiler SPFontsDataType | grep -i "nova" | head -5 || echo "No fonts with 'nova' found" | ||||||||
| fi | ||||||||
|
|
||||||||
| - name: Generate Promo Screenshots | ||||||||
| run: | | ||||||||
| git lfs install && git lfs fetch && git lfs pull | ||||||||
| bundle exec fastlane create_promo_screenshots force:true | ||||||||
|
|
||||||||
| - name: Archive Promo Screenshots | ||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not part of this PR, but an improvement idea:
we should be able to remove the
Install Screenshot Gemsstep and use this env var at the job level instead (which will make theruby/setup-ruby@v1step to already use thescreenshotsgroup without a separate step).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 6f118d2, I hope this is what you meant. I triggered the screenshots generation workflow to verify that it works.