Fix xMAP in CI build, filter out runs if only changing Markdown docs

This commit is contained in:
Rachel 2024-11-08 13:50:07 -08:00
parent d8e9bab13a
commit 0b31ed7134
2 changed files with 32 additions and 26 deletions

View File

@ -9,6 +9,7 @@ fi
url="$1"
build_name="platinum.us"
build_dir="$2"
output=$(${GITHUB_WORKSPACE}/.github/calcrom/calcrom.py /var/tmp/pokeplatinum | 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\":\"\`\`\`$build_name progress:\\n$output\`\`\`\"}" -H "Content-Type: application/json" -X POST $url
output=$("${GITHUB_WORKSPACE}"/.github/calcrom/calcrom.py "$build_dir" | 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\":\"\`\`\`$build_name progress:\\n$output\`\`\`\"}" -H "Content-Type: application/json" -X POST "$url"

View File

@ -3,7 +3,11 @@ name: build
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
env:
LM_LICENSE_FILE: "${{ github.workspace }}/tools/cw/license.dat"
@ -14,8 +18,9 @@ env:
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- name: Install Software
run: |
@ -41,9 +46,31 @@ jobs:
env:
arm9name: ${{ vars.BUILD }}
run: |
.github/calcrom/webhook.sh "$CALCROM_WEBHOOK_URL"
.github/calcrom/webhook.sh "$CALCROM_WEBHOOK_URL" "$BUILD"
continue-on-error: true
- name: Checkout xMAP
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
with:
path: 'xmap'
ref: 'xmap'
- name: Move xMAP
if: ${{ github.event_name == 'push' }}
run: |
mkdir -p xmap
cp "$BUILD"/*.xMAP xmap/platinumus.xMAP
echo "XMAP_COMMIT_MSG=$( git log --format=%s ${GITHUB_SHA} )" >> $GITHUB_ENV
- name: Update xMAP
if: ${{ github.event_name == 'push' }}
uses: EndBug/add-and-commit@v9
with:
cwd: "./xmap"
add: "*.xMAP"
message: ${{ env.XMAP_COMMIT_MSG }}
- name: Post error archive
if: failure()
continue-on-error: true
@ -56,25 +83,3 @@ jobs:
name: pokeplatinum-failure-${{ github.run_id }}
path: failure.tar.gz
retention-days: 1
- name: Checkout xMAP
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
with:
path: 'xmap'
ref: 'xmap'
- name: Move xMAP
if: ${{ github.event_name == 'push' }}
run: |
mkdir -p xmap
cp "$BUILD/*.xMAP" xmap/platinumus.xMAP
echo "XMAP_COMMIT_MSG=$( git log --format=%s ${GITHUB_SHA} )" >> $GITHUB_ENV
- name: Update xMAP
if: ${{ github.event_name == 'push' }}
uses: EndBug/add-and-commit@v9
with:
cwd: "./xmap"
add: "*.xMAP"
message: ${{ env.XMAP_COMMIT_MSG }}