engine-updated #56
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: bump-engine | |
| # Auto-bumps the TechEngine submodule pointer to its latest main commit. | |
| # Fired by TechEngine via repository_dispatch (event type: engine-updated) on | |
| # every push to TechEngine's main; also runnable manually. The submodule gitlink | |
| # lives in THIS repo, so the bump commit must be made here — TechEngine only | |
| # sends the signal (see .claude/techengine_submodule_sync_spec.md for the | |
| # TechEngine-side contract). | |
| on: | |
| repository_dispatch: | |
| types: [engine-updated] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: bump-engine | |
| cancel-in-progress: true | |
| jobs: | |
| bump: | |
| runs-on: ubuntu-latest | |
| env: | |
| ENGINE_TOKEN: ${{ secrets.ENGINE_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Update TechEngine submodule to latest main | |
| id: bump | |
| run: | | |
| # git-flow: the bump is integration work, so it lands on develop. | |
| # main only moves through a release PR. Switch branch BEFORE touching | |
| # the submodule so the change is staged on the branch it will be | |
| # committed to. | |
| git fetch origin develop | |
| git checkout -B develop origin/develop | |
| git submodule update --init --recursive TechEngine | |
| git submodule update --remote --recursive TechEngine | |
| if git diff --quiet -- TechEngine; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| echo "Submodule already up to date — nothing to do." | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Commit & push bump | |
| id: commit | |
| if: steps.bump.outputs.changed == 'true' | |
| run: | | |
| NEW_SHA=$(git -C TechEngine rev-parse --short HEAD) | |
| # Attribute to the TechEngineBot account (id 289859915) so bumps show | |
| # its avatar and count toward its contributions — not github-actions[bot]. | |
| git config user.name "TechEngineBot" | |
| git config user.email "289859915+TechEngineBot@users.noreply.github.com" | |
| git add TechEngine | |
| git commit -m "chore: bump TechEngine submodule to ${NEW_SHA}" | |
| git pull --rebase origin develop | |
| git push origin HEAD:develop | |
| echo "techapi_sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" | |
| - name: Dispatch reciprocal TechAPI bump to TechEngine | |
| if: steps.bump.outputs.changed == 'true' && env.ENGINE_TOKEN != '' | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.ENGINE_TOKEN }} | |
| repository: GetTechAPI/TechEngine | |
| event-type: techapi-updated | |
| client-payload: | | |
| {"sha": "${{ steps.commit.outputs.techapi_sha }}", "ref": "refs/heads/main"} |