Chores #347
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Chores | |
| on: | |
| schedule: | |
| - cron: "0 3 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| update-deps: | |
| if: github.repository == 'decompme/decomp.me' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.14" | |
| - name: Install uv | |
| run: pip install uv==0.9.11 | |
| - name: Update m2c & asm-differ | |
| run: cd backend && uv lock --upgrade-package m2c --upgrade-package asm-differ | |
| - name: Generate PR summary | |
| id: pr-summary | |
| run: | | |
| set -euo pipefail | |
| bumped_packages="" | |
| { | |
| echo "This automated chore updates backend decompiler/diff tooling." | |
| echo | |
| echo "Updated packages:" | |
| for package in asm-differ m2c; do | |
| case "$package" in | |
| asm-differ) repo="https://github.com/simonlindholm/asm-differ" ;; | |
| m2c) repo="https://github.com/matt-kempster/m2c" ;; | |
| esac | |
| before="$(git show HEAD:backend/uv.lock | sed -n "/name = \"$package\"/,/^\[\[package\]\]/s/.*#\([0-9a-f]\{40\}\)\".*/\1/p")" | |
| after="$(sed -n "/name = \"$package\"/,/^\[\[package\]\]/s/.*#\([0-9a-f]\{40\}\)\".*/\1/p" backend/uv.lock)" | |
| if [[ "$before" == "$after" ]]; then | |
| echo "- ${package}: unchanged at [${after:0:7}](${repo}/commit/${after})" | |
| else | |
| echo "- ${package}: [${before:0:7} -> ${after:0:7}](${repo}/compare/${before}...${after})" | |
| bumped_packages="${bumped_packages:+$bumped_packages / }$package" | |
| fi | |
| done | |
| echo | |
| echo "Generated by [create-pull-request](https://github.com/peter-evans/create-pull-request)." | |
| } > "${RUNNER_TEMP}/pr-body.md" | |
| title_packages="${bumped_packages:-m2c / asm-differ}" | |
| { | |
| echo "body<<PR_BODY" | |
| cat "${RUNNER_TEMP}/pr-body.md" | |
| echo "PR_BODY" | |
| echo "title-packages=${title_packages}" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Check for changes | |
| run: | | |
| if git diff --quiet HEAD; then | |
| echo "No changes to commit." | |
| exit 0 | |
| fi | |
| - name: Commit changes | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| commit-message: "馃 (chore): bump ${{ steps.pr-summary.outputs.title-packages }} to latest" | |
| title: "馃 (chore): bump ${{ steps.pr-summary.outputs.title-packages }} to latest" | |
| body: ${{ steps.pr-summary.outputs.body }} | |
| branch: "update-m2c-asm-differ" | |
| delete-branch: true | |
| committer: "GitHub Actions <actions@github.com>" | |
| author: "GitHub Actions <actions@github.com>" |