Skip to content

Commit

Permalink
dsa
Browse files Browse the repository at this point in the history
  • Loading branch information
macabeus committed Mar 12, 2022
1 parent 613e1d4 commit 396b27f
Show file tree
Hide file tree
Showing 4 changed files with 354 additions and 3,879 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/map-diff.yml
Expand Up @@ -28,8 +28,14 @@ jobs:
git fetch --depth=1 origin ${{ github.event.pull_request.base.sha }}
MAP_PATHS=$(git diff --name-status HEAD ${{ github.event.pull_request.base.sha }} | grep ".map$" | perl -pe 's/\w\s+//')
MAP_PATHS=$(git diff --name-only HEAD ${{ github.event.pull_request.base.sha }} | grep ".map$")
flat_map_paths=${MAP_PATHS[@]}
echo "----------"
echo "$MAP_PATHS"
echo "$flat_map_paths"
echo "----------"
echo "::set-output name=MAP_PATHS::$flat_map_paths"
for map_path in $MAP_PATHS
Expand All @@ -55,6 +61,16 @@ jobs:
done
echo "::set-output name=DIFF_IMAGES::$diff_images"
- name: Compress images
run: |
cd ./utils/wesnoth-map-diff
sudo apt-get install -y pngquant
for diff_image in ${{ steps.map-diff.outputs.DIFF_IMAGES }}
do
pngquant "$diff_image" -o "$diff_image" --force
done
- name: Write body comment
id: body-comment
run: |
Expand All @@ -65,7 +81,7 @@ jobs:
for diff_image in ${{ steps.map-diff.outputs.DIFF_IMAGES }}
do
image_link=$(curl -X POST "https://api.imgur.com/3/upload" \
-F "image=@\"$diff_image\"")
-F "image=@\"$diff_image\"" | jq ".data.link" -r)
body="$body![]($image_link)<br/>"
done
Expand Down

0 comments on commit 396b27f

Please sign in to comment.