# Copyright Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT name: Bump Submodule automation on: workflow_dispatch: inputs: submodule: description: 'Submodule to bump (default: all)' required: false default: 'all' type: choice options: - all - rocm-systems - rocm-libraries - rocgdb schedule: - cron: "0 */12 * * *" # Runs every 12 hrs at 12AM and 12PM push: branches: - main paths: - rocm-systems - rocm-libraries - debug-tools/rocgdb/source permissions: contents: read jobs: bump-submodules: runs-on: ubuntu-24.04 steps: - name: Checkout ROCm/TheRock uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: fetch-depth: 0 - name: Setup Python uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: python-version: '3.11' - name: Generate GitHub App token rocm-systems uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 id: systems-token with: app-id: ${{ secrets.ROCM_SYSTEMS_APP_ID }} private-key: ${{ secrets.ROCM_SYSTEMS_APP_PRIVATE_KEY }} owner: "ROCm" # We will reuse the rocm-systems token for rocgdb for now. repositories: "rocm-systems,rocgdb,TheRock" - name: Generate GitHub App token rocm-libraries uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 id: librarian-token with: app-id: ${{ secrets.ROCM_LIBRARIES_APP_ID }} private-key: ${{ secrets.ROCM_LIBRARIES_APP_PRIVATE_KEY }} owner: "ROCm" repositories: "rocm-libraries,TheRock" - name: Install prerequisites run: | pip install requests - name: Run scheduled bump automation if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' run: | python3 build_tools/github_actions/bump_automation.py \ --event_type "schedule" \ --submodule "${{ github.event.inputs.submodule || 'all' }}" \ --systems_token "${{ steps.systems-token.outputs.token }}" \ --libraries_token "${{ steps.librarian-token.outputs.token }}" \ --rocgdb_token "${{ steps.systems-token.outputs.token }}" - name: Run push automation if: github.event_name == 'push' run: | python3 build_tools/github_actions/bump_automation.py \ --event_type "push" \ --before "${{ github.event.before }}" \ --after "${{ github.sha }}" \ --systems_token "${{ steps.systems-token.outputs.token }}" \ --libraries_token "${{ steps.librarian-token.outputs.token }}" \ --rocgdb_token "${{ steps.systems-token.outputs.token }}"