From ec8a53747a5febbebfc50b7340d10b68ae226e76 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 12:53:59 +0000 Subject: [PATCH] Bump D-Modem to 3f7d6b2 (USRobotics x2 server); bump it automatically external/d-modem-re: a3aaade -> 3f7d6b2, D-Modem's main (33 commits, the x2 server from D-Modem#104 among them). The native engine builds and its tests pass on it (native-test, 14/14). A D-Modem bump workflow keeps it there: daily, by hand or on a repository_dispatch from D-Modem it opens a pull request moving the submodule to D-Modem's main, set to merge once the checks pass. It needs a DMODEM_BUMP_TOKEN secret. Signed-off-by: Claude Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01B82eRRgas5TD8Qpbs8x2NK --- .github/workflows/d-modem-bump.yml | 115 +++++++++++++++++++++++++++++ docs/building.md | 5 ++ external/d-modem-re | 2 +- 3 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/d-modem-bump.yml diff --git a/.github/workflows/d-modem-bump.yml b/.github/workflows/d-modem-bump.yml new file mode 100644 index 0000000..401a813 --- /dev/null +++ b/.github/workflows/d-modem-bump.yml @@ -0,0 +1,115 @@ +# D-Modem bump: moves the external/d-modem-re submodule to D-Modem's +# latest main and opens (or updates) a pull request for it, set to merge +# by itself once its checks pass. Daily, by hand (Actions > D-Modem bump > +# Run workflow), or from D-Modem (a repository_dispatch of type +# "d-modem-main", for when its main changes). +# +# It needs the DMODEM_BUMP_TOKEN secret: a fine-grained personal access +# token with Contents: read on D-Modem/D-Modem (the private submodule) +# and Contents: read and write and Pull requests: read and write on +# D-Modem/app. Not the workflow's own GITHUB_TOKEN: a pull request that +# token opens starts no other workflow, so Android's checks would never +# run on it. Without the secret the run says so and stops. +# +# Merging by itself takes the repository's "Allow auto-merge" setting and +# a rule on main that requires the Android checks; without those the pull +# request stays open for a person to merge. +name: D-Modem bump + +on: + schedule: + - cron: "17 6 * * *" + repository_dispatch: + types: [d-modem-main] + workflow_dispatch: + +# (one bump at a time: a second waits for the first) +concurrency: + group: d-modem-bump + cancel-in-progress: false + +permissions: + contents: read + +env: + BRANCH: bot/d-modem-bump + +jobs: + bump: + runs-on: ubuntu-24.04 + # (a hung step ends here, not at GitHub's 6 hours) + timeout-minutes: 10 + steps: + - name: Token present + env: + TOKEN: ${{ secrets.DMODEM_BUMP_TOKEN }} + run: | + if [ -z "$TOKEN" ]; then + echo "::error::No DMODEM_BUMP_TOKEN secret (see this workflow's header)" + exit 1 + fi + + - uses: actions/checkout@v6 + with: + token: ${{ secrets.DMODEM_BUMP_TOKEN }} + fetch-depth: 0 + + # only the D-Modem submodule (proot stays where it is) + - name: D-Modem's latest main + id: bump + run: | + git submodule update --init external/d-modem-re + old=$(git -C external/d-modem-re rev-parse HEAD) + git -C external/d-modem-re fetch --quiet origin main + new=$(git -C external/d-modem-re rev-parse FETCH_HEAD) + echo "old=$old" >> "$GITHUB_OUTPUT" + echo "new=$new" >> "$GITHUB_OUTPUT" + if [ "$old" = "$new" ]; then + echo "Already at D-Modem main ${new:0:7}" + echo "changed=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + git -C external/d-modem-re checkout --quiet "$new" + echo "changed=true" >> "$GITHUB_OUTPUT" + { + echo 'log<> "$GITHUB_OUTPUT" + + - name: Commit and push + if: steps.bump.outputs.changed == 'true' + env: + OLD: ${{ steps.bump.outputs.old }} + NEW: ${{ steps.bump.outputs.new }} + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git checkout -B "$BRANCH" + git add external/d-modem-re + git commit -m "Bump D-Modem to ${NEW:0:7}" \ + -m "external/d-modem-re: ${OLD:0:7} -> ${NEW:0:7} (D-Modem's main)." \ + -m "Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + git push --force origin "$BRANCH" + + - name: Pull request, merging by itself + if: steps.bump.outputs.changed == 'true' + env: + GH_TOKEN: ${{ secrets.DMODEM_BUMP_TOKEN }} + OLD: ${{ steps.bump.outputs.old }} + NEW: ${{ steps.bump.outputs.new }} + LOG: ${{ steps.bump.outputs.log }} + run: | + body=$(printf 'Moves `external/d-modem-re` to D-Modem main: [`%s..%s`](https://github.com/D-Modem/D-Modem/compare/%s...%s)\n\n```\n%s\n```\n\nOpened by the D-Modem bump workflow (`.github/workflows/d-modem-bump.yml`); it merges once the checks pass.\n' \ + "${OLD:0:7}" "${NEW:0:7}" "$OLD" "$NEW" "$LOG") + title="Bump D-Modem to ${NEW:0:7}" + pr=$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number') + if [ -n "$pr" ]; then + gh pr edit "$pr" --title "$title" --body "$body" + else + gh pr create --base main --head "$BRANCH" --title "$title" --body "$body" + pr=$(gh pr list --head "$BRANCH" --state open --json number --jq '.[0].number') + fi + if ! gh pr merge "$pr" --auto --merge; then + echo "::warning::Couldn't set pull request #$pr to merge by itself (Allow auto-merge off, or no required checks on main): it waits for a person" + fi diff --git a/docs/building.md b/docs/building.md index 7f72419..7f17615 100644 --- a/docs/building.md +++ b/docs/building.md @@ -60,6 +60,11 @@ D-Modem's own rule has it. `tools/doc_check.py` lists any that don't CI (`.github/workflows/android.yml`) runs all three, and that check; it needs a `DMODEM_TOKEN` secret that can read the private D-Modem submodule. +`.github/workflows/d-modem-bump.yml` keeps the submodule on D-Modem's +main: daily (or by hand) it opens a pull request that moves it, set to +merge once CI passes. It needs a `DMODEM_BUMP_TOKEN` secret (its header +says which permissions). + Signing comes from the environment: `ANDROID_KEYSTORE_FILE` (a PKCS12 keystore), `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS` and `ANDROID_KEY_PASSWORD` (the store's password if unset). Without them a diff --git a/external/d-modem-re b/external/d-modem-re index a3aaade..3f7d6b2 160000 --- a/external/d-modem-re +++ b/external/d-modem-re @@ -1 +1 @@ -Subproject commit a3aaade75a6ebb0093012b0a5e9ed02b9b89927c +Subproject commit 3f7d6b264f30ffed70847914aa69196768849304