Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

76 lines
3.1 KiB
YAML

name: Synchronize Subtrees
on:
workflow_dispatch:
schedule:
- cron: '0 * * * *'
env:
SUPER_REPO_URL: github.com/ROCm/rocm-systems.git
SUPER_REPO_BRANCH: develop
concurrency:
group: pr-update-subtrees-develop
cancel-in-progress: false
jobs:
synchronize-subtrees:
if: github.repository == 'ROCm/rocm-systems'
runs-on: ubuntu-24.04
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Checkout the Super-repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # needed for git subtree pull/push
token: ${{ steps.generate-token.outputs.token }}
- name: Set up Git user
run: |
git config user.name "systems-assistant[bot]"
git config user.email "systems-assistant[bot]@users.noreply.github.com"
- name: Switch to the Super-repo branch
run: |
git checkout -B "${{ env.SUPER_REPO_BRANCH }}" "origin/${{ env.SUPER_REPO_BRANCH }}"
- name: Update Repositories in the Super-repo
run: |
has_errors=false
for repo in $(cat .github/repos-config.json | jq -r '.repositories[].name'); do
url=$(cat .github/repos-config.json | jq -r ".repositories[] | select(.name == \"$repo\") | .url")
branch=$(cat .github/repos-config.json | jq -r ".repositories[] | select(.name == \"$repo\") | .branch")
category=$(cat .github/repos-config.json | jq -r ".repositories[] | select(.name == \"$repo\") | .category")
enable_pull=$(cat .github/repos-config.json | jq -r ".repositories[] | select(.name == \"$repo\") | .auto_subtree_pull")
enable_push=$(cat .github/repos-config.json | jq -r ".repositories[] | select(.name == \"$repo\") | .auto_subtree_push")
if [ "$enable_pull" = true ]; then
git subtree pull --prefix "${category}/${repo}" https://github.com/${url}.git $branch || {
has_errors=true
}
fi
# if [ "$enable_push" = true ]; then
# git fetch origin subtrees/${repo}/${branch}
# git branch -f subtrees/${repo}/${branch} origin/subtrees/${repo}/${branch}
# git subtree split --prefix="${category}/${repo}" -b subtrees/${repo}/${branch} --quiet --rejoin || {
# has_errors=true
# }
# git push origin subtrees/${repo}/${branch}
# git push https://github.com/${url}.git subtrees/${repo}/${branch}:${branch}
# fi
done
if [ "$has_errors" = true ]; then
echo "One or more errors occurred during the repository update."
exit 1
else
git push https://${{ env.SUPER_REPO_URL }} ${{ env.SUPER_REPO_BRANCH }}
echo "All repositories updated successfully!"
fi