diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index f379be4ff7f..d4e9a6fe160 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -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,21 @@ 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/ + retention-days: 1 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: [ar-SA, de-DE, en-US, es-ES, fr-FR, he, id, it, ja, ko, nl-NL, pt-BR, ru, sv, tr, zh-Hans, zh-Hant] mode: [dark, light] steps: - uses: actions/checkout@v4 @@ -61,17 +53,11 @@ jobs: - name: Install Fastlane Dependencies run: bundle exec fastlane run configure_apply - - name: Download Screenshot App - uses: actions/download-artifact@v4 - with: - name: screenshot-app - path: fastlane/DerivedData/Build/Products/Debug-iphonesimulator/WooCommerce.app - - - name: Download Screenshot Runner + - name: Download Build Products 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/ - name: Generate Screenshots run: | @@ -85,14 +71,18 @@ 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 + + env: + BUNDLE_WITH: screenshots steps: - uses: actions/checkout@v4 @@ -101,27 +91,32 @@ 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 with: bundler-cache: true - - name: Install Screenshot Gems - run: bundle install --with screenshots - - name: Install Fastlane Dependencies 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 @@ -129,27 +124,17 @@ jobs: name: raw-screenshots path: fastlane/screenshots - - name: Install Promo Screenshot Fonts + - name: Setup Git LFS 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 - 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 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 2e690270f71..1570010acb7 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -960,6 +960,8 @@ platform :ios do desc 'Create Screenshot Summary' lane :create_screenshot_summary do + # Ensure we're using the right version of Xcode, defined in `.xcode-version` file + xcversion fastlane_require 'snapshot' # Provide enough information to bootstrap the configuration and generate the HTML report diff --git a/fastlane/appstoreres/assets/styles/style.css b/fastlane/appstoreres/assets/styles/style.css index 11dfbdf8bad..aa775f8cb22 100644 --- a/fastlane/appstoreres/assets/styles/style.css +++ b/fastlane/appstoreres/assets/styles/style.css @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e735d19705e55ffb60e6e763ac8a5d1af3de4ac92f882a518c11e8f9427f4e6c -size 117 +oid sha256:cd963a43692886a4edc57064be504e75526b1b9aa95581442c95d4ca39ced154 +size 121