decord/.github/workflows/update.yml

81 lines
No EOL
2.6 KiB
YAML

name: update (hourly)
permissions:
contents: write
on:
workflow_dispatch:
inputs:
force:
description: Force update regardless of whether versions changed
default: false
required: false
type: boolean
quiet:
description: Disable sending any messages
default: false
required: false
type: boolean
schedule:
- cron: "30 * * * *"
jobs:
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: Update
env:
code_webhook: ${{ secrets.CODE_WEBHOOK }}
color_webhook: ${{ secrets.COLOR_WEBHOOK }}
icons_webhook: ${{ secrets.ICONS_WEBHOOK }}
bot_token: ${{ secrets.BOT_TOKEN }}
channel_id: "1532999192601952266"
role_id: "1481923706396872775"
working-directory: main
run: |
bun run src/update/index.ts ${{ (inputs.force || github.event.inputs.force == 'true') && '--force' || '' }} ${{ (inputs.quiet || github.event.inputs.quiet == 'true') && '--quiet' || '' }}
- name: Publish changes
working-directory: data
run: git push
- name: Publish canvas
working-directory: data
run: git -C ../canvas push
- name: Tag changes
working-directory: data
run: |
for ch in alpha beta stable; do
v=$(cat ".update-ok-$ch" 2>/dev/null) || continue
git tag -f "$ch-$v"
git push origin -f "$ch-$v"
done