Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ version: 2
updates:
- package-ecosystem: pip
directory: /
target-branch: develop
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
target-branch: develop
schedule:
interval: weekly
29 changes: 25 additions & 4 deletions .github/workflows/update-submodules.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
name: Update submodules

# Moves each submodule to the tip of the branch set in .gitmodules and commits
# the new pointers to develop.
# Moves each submodule to the tip of the branch set in .gitmodules and opens a
# pull request against develop. The pull request build checks that the new source
# still builds and that the documented examples still hold; nothing is pushed to
# develop or main.
# A push or a pull request made with the workflow token does not start the
# pull request workflows. workflow_dispatch is the documented exception, so the
# checks are started on the branch by hand below; their results show on the
# pull request.

on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch: {}

permissions:
actions: write
contents: write
pull-requests: write

concurrency:
group: update-submodules
Expand Down Expand Up @@ -38,14 +46,27 @@ jobs:
git checkout -B "$branch" FETCH_HEAD
'

- name: Commit to develop
- name: Open or update the pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
if git diff --quiet; then
echo "No submodule updates."
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git switch -C chore/update-submodules
git add -A
git commit -m "chore: update submodules to latest tracked branches"
git push origin HEAD:develop
git push --force-with-lease origin chore/update-submodules
if [ -z "$(gh pr list --head chore/update-submodules --state open --json number --jq '.[].number')" ]; then
gh pr create --base develop --head chore/update-submodules \
--title "chore: update submodules to latest tracked branches" \
--body "Moves each submodule to the tip of the branch set in .gitmodules."
fi
for workflow in docs-build.yml examples.yml; do
if [ -f ".github/workflows/$workflow" ]; then
gh workflow run "$workflow" --ref chore/update-submodules
fi
done
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The standard for this site is the `docs-site` plugin of [CompMetEng/skills](http

## Branches

`develop` is the default branch. It documents the `develop` branches of RAVEN and raven-toolbox, which the submodules track, and a daily workflow moves the submodule pointers to their tips. Pull requests target `develop`. `main` documents the released versions: a release of RAVEN and raven-toolbox is followed by a pull request from `develop` to `main` that is merged with a merge commit and pins the submodules to the released commits.
`develop` is the integration branch. It documents the `develop` branches of RAVEN and raven-toolbox, which the submodules track, and a daily workflow opens a pull request against `develop` that moves the submodule pointers to their tips. Pull requests target `develop`. `main` documents the released versions: a release of RAVEN and raven-toolbox is followed by a pull request from `develop` to `main` that is merged with a merge commit and pins the submodules to the released commits.

## Building and checking

Expand Down
Loading