Update README.md #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Capture iOS Screenshots | |
| on: | |
| push: | |
| branches: | |
| - main # Change this if your default branch is different | |
| jobs: | |
| screenshot: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set Up Xcode | |
| run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer | |
| - name: Build & Run UI Tests | |
| run: | | |
| xcodebuild test \ | |
| -workspace iblot.xcworkspace \ | |
| -scheme iblot \ | |
| -destination 'platform=iOS Simulator,name=iPhone 14,OS=latest' \ | |
| -only-testing iblotUITests/testExample | |
| - name: Find Screenshots | |
| run: | | |
| mkdir -p Screenshots | |
| find ~/Library/Developer/Xcode/DerivedData -name "*.png" -exec cp {} Screenshots/ \; | |
| - name: Commit and Push Screenshots | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add Screenshots/* | |
| git commit -m "Update screenshots" || echo "No changes to commit" | |
| git push | |
| - name: Update README with latest screenshot | |
| run: | | |
| LATEST_IMAGE=$(ls -t Screenshots | head -1) | |
| echo "" > README.md | |
| git add README.md | |
| git commit -m "Update README with latest screenshot" || echo "No changes to commit" | |
| git push |