committed by
GitHub
orang tua
58d2a016ce
melakukan
c53d4f2592
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"repositories": [
|
||||
{
|
||||
"name": "aqlprofile",
|
||||
"url": "ROCm/aqlprofile",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": false,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rdc",
|
||||
"url": "ROCm/rdc",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": true,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocm-core",
|
||||
"url": "ROCm/rocm-core",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": true,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocminfo",
|
||||
"url": "ROCm/rocminfo",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": true,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocm-smi-lib",
|
||||
"url": "ROCm/rocm_smi_lib",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": true,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocprofiler",
|
||||
"url": "ROCm/rocprofiler",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": false,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocprofiler-compute",
|
||||
"url": "ROCm/rocprofiler-compute",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": false,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocprofiler-register",
|
||||
"url": "ROCm/rocprofiler-register",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": false,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocprofiler-sdk",
|
||||
"url": "ROCm/rocprofiler-sdk",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": false,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocprofiler-systems",
|
||||
"url": "ROCm/rocprofiler-systems",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": false,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "rocr-runtime",
|
||||
"url": "ROCm/ROCR-Runtime",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": true,
|
||||
"auto_subtree_push": false
|
||||
},
|
||||
{
|
||||
"name": "roctracer",
|
||||
"url": "ROCm/roctracer",
|
||||
"branch": "release/rocm-rel-7.0",
|
||||
"category": "projects",
|
||||
"auto_subtree_pull": false,
|
||||
"auto_subtree_push": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
name: Synchronize Subtrees
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '15 * * * *'
|
||||
|
||||
env:
|
||||
SUPER_REPO_URL: github.com/ROCm/rocm-systems.git
|
||||
SUPER_REPO_BRANCH: release/rocm-rel-7.0
|
||||
|
||||
concurrency:
|
||||
group: pr-update-subtrees-release
|
||||
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 }}
|
||||
ref: ${{ env.SUPER_REPO_BRANCH }}
|
||||
|
||||
- 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-release.json | jq -r '.repositories[].name'); do
|
||||
url=$(cat .github/repos-config-release.json | jq -r ".repositories[] | select(.name == \"$repo\") | .url")
|
||||
branch=$(cat .github/repos-config-release.json | jq -r ".repositories[] | select(.name == \"$repo\") | .branch")
|
||||
category=$(cat .github/repos-config-release.json | jq -r ".repositories[] | select(.name == \"$repo\") | .category")
|
||||
enable_pull=$(cat .github/repos-config-release.json | jq -r ".repositories[] | select(.name == \"$repo\") | .auto_subtree_pull")
|
||||
enable_push=$(cat .github/repos-config-release.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
|
||||
Reference in New Issue
Block a user