Skip to content

Commit

Permalink
feat: process screenshot with ImageMagic
Browse files Browse the repository at this point in the history
  • Loading branch information
chuhlomin committed Aug 16, 2023
1 parent 0745d67 commit 84ddd08
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,25 @@ jobs:
height: 768
deviceScaleFactor: 2

- name: Setup Image Magic
uses: mfinelli/setup-imagemagick@v2

- name: Round corners and shadow
run: |
width=$(identify -format "%w" "$1")
height=$(identify -format "%h" "$1")
convert \
screenshot.png \
\( -size ${width}x${height} xc:black -fill white \
-draw "roundRectangle 0,0,${width},${height},20,20" \) \
-alpha Off -compose CopyOpacity -composite \
screenshot.png.temp
convert \
screenshot.png.temp \
\( +clone -background black -shadow 25x80+0+16 \) \
-background none \
-reverse -layers merge screenshot.png
- name: Upload screenshot
uses: actions/upload-artifact@v3
if: github.event_name == 'pull_request'
Expand Down

0 comments on commit 84ddd08

Please sign in to comment.