decord/.github/workflows/update.yml
lvwmwm 14c5a5d005 fix(update): watchdog decompile and skip release on failure
- hermes-decomp killed by SIGTERM (exit 143) on pathological 380MB module this release
- replace Bun shell (no .timeout/.kill support) with Bun.spawn watchdog; kills decompile/extract after 20min
- on decompile failure, restore version.txt, mark run skipped (.update-skipped), exit cleanly so hourly run retries
- gate Publish/Tag/canvas steps on skip marker so a skipped release isn't pushed or tagged
2026-09-04 14:33:27 -03:00

99 lines
3.4 KiB
YAML

name: update (hourly)
permissions:
contents: write
on:
workflow_dispatch:
inputs:
force:
description: Force update regardless of "bun run check"
default: false
required: false
type: boolean
quiet:
description: Disable sending any messages
default: false
required: false
type: boolean
schedule:
- cron: "30 * * * *"
jobs:
check-update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
path: main
- uses: actions/checkout@v4
with:
ref: data
path: data
- uses: actions/checkout@v4
with:
ref: canvas
path: canvas
- uses: dtolnay/rust-toolchain@stable
- uses: oven-sh/setup-bun@v2
- working-directory: main
run: bun install
- name: Setup Git
working-directory: data
run: |
git config user.name github-actions
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git -C ../canvas config user.name github-actions
git -C ../canvas config user.email 41898282+github-actions[bot]@users.noreply.github.com
- name: Check for version
id: check
working-directory: main
run: |
version=$(bun run check ${{ github.event.inputs.force == 'true' && '--force' || '' }})
echo "[DEBUG]: Check result: $version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Update
if: ${{ steps.check.outputs.version != 'false' }}
env:
code_webhook: ${{ secrets.CODE_WEBHOOK }}
bot_token: ${{ secrets.BOT_TOKEN }}
working-directory: main
run: bun run update:prod ${{ github.event.inputs.quiet == 'true' && '--quiet' || '' }}
- name: Publish changes
if: ${{ steps.check.outputs.version != 'false' }}
working-directory: data
run: |
if [ -f .update-skipped ]; then
echo "Update skipped (decompile failed); not publishing."
exit 0
fi
git push
- name: Publish canvas
if: ${{ steps.check.outputs.version != 'false' }}
working-directory: data
run: |
if [ -f .update-skipped ]; then
echo "Update skipped (decompile failed); not publishing canvas."
exit 0
fi
git -C ../canvas push
- name: Tag changes
if: ${{ steps.check.outputs.version != 'false' }}
working-directory: data
run: |
if [ -f .update-skipped ]; then
echo "Update skipped (decompile failed); not tagging."
exit 0
fi
git tag -f ${{ steps.check.outputs.version }}
git push origin -f ${{ steps.check.outputs.version }}