Skip to content

Commit

Permalink
Merge pull request #29 from WhenGryphonsFly/workflow
Browse files Browse the repository at this point in the history
Create OK workflow
  • Loading branch information
WhenGryphonsFly authored Aug 22, 2023
2 parents 9beea44 + b5b5748 commit 9142981
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/calcrom/webhook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash -ex

build_name=$1
map_file=$build_name.map
if [ ! -f $map_file ]; then
echo "$map_file does not exist!"
exit 1
fi

output=$(perl $(dirname "$0")/calcrom.pl $build_name.map | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g')
curl -d "{\"username\": \"$CALCROM_DISCORD_WEBHOOK_USERNAME\", \"avatar_url\": \"$CALCROM_DISCORD_WEBHOOK_AVATAR_URL\", \"content\":\"\`\`\`\\n$build_name progress:\\n$output\\n\`\`\`\"}" -H "Content-Type: application/json" -X POST "$CALCROM_DISCORD_WEBHOOK_URL"
10 changes: 9 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ jobs:
xdelta3 -d -s zero.gba baserom.xdelta baserom.gba
- name: Build pokepinball
run: make -j$(nproc)
run: make -j$(nproc)\

- name: Webhook
if: ${{ github.event_name == 'push' && github.repository_owner == 'pret' }}
env:
CALCROM_DISCORD_WEBHOOK_USERNAME: OK
CALCROM_DISCORD_WEBHOOK_AVATAR_URL: https://i.imgur.com/38BQHdd.png
CALCROM_DISCORD_WEBHOOK_URL: ${{ secrets.CALCROM_DISCORD_WEBHOOK_URL }}
run: sh .github/calcrom/webhook.sh pokepinballrs

0 comments on commit 9142981

Please sign in to comment.