File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Capture iOS Screenshots
2+
3+ on :
4+ push :
5+ branches :
6+ - main # Change this if your default branch is different
7+
8+ jobs :
9+ screenshot :
10+ runs-on : macos-latest
11+ steps :
12+ - name : Checkout Repository
13+ uses : actions/checkout@v4
14+
15+ - name : Set Up Xcode
16+ run : sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
17+
18+ - name : Build & Run UI Tests
19+ run : |
20+ xcodebuild test \
21+ -workspace iblot.xcworkspace \
22+ -scheme iblot \
23+ -destination 'platform=iOS Simulator,name=iPhone 14,OS=latest' \
24+ -only-testing iblotUITests/testExample
25+
26+ - name : Find Screenshots
27+ run : |
28+ mkdir -p Screenshots
29+ find ~/Library/Developer/Xcode/DerivedData -name "*.png" -exec cp {} Screenshots/ \;
30+
31+ - name : Commit and Push Screenshots
32+ run : |
33+ git config --global user.name "github-actions[bot]"
34+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
35+ git add Screenshots/*
36+ git commit -m "Update screenshots" || echo "No changes to commit"
37+ git push
38+
39+ - name : Update README with latest screenshot
40+ run : |
41+ LATEST_IMAGE=$(ls -t Screenshots | head -1)
42+ echo "" > README.md
43+ git add README.md
44+ git commit -m "Update README with latest screenshot" || echo "No changes to commit"
45+ git push
You can’t perform that action at this time.
0 commit comments