|
| 1 | +name: Update Protos and Create PR |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + release_version: |
| 7 | + description: 'Cloud API release version to update to (e.g., v1.2.3).' |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + sdk_version: |
| 11 | + description: 'SDK version to set (e.g., 0.7.0). Use the version that is intended for the next release.' |
| 12 | + required: true |
| 13 | + type: string |
| 14 | + branch_name: |
| 15 | + description: 'Branch name for the PR (default: auto-generated)' |
| 16 | + required: false |
| 17 | + default: '' |
| 18 | + type: string |
| 19 | + pr_title: |
| 20 | + description: 'PR title (default: auto-generated)' |
| 21 | + required: false |
| 22 | + default: '' |
| 23 | + type: string |
| 24 | + |
| 25 | +jobs: |
| 26 | + update-protos: |
| 27 | + name: Update Protos and Create PR |
| 28 | + runs-on: ubuntu-latest |
| 29 | + permissions: |
| 30 | + contents: write |
| 31 | + pull-requests: write |
| 32 | + steps: |
| 33 | + - name: Checkout repository |
| 34 | + uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + submodules: 'true' |
| 38 | + fetch-depth: 0 |
| 39 | + |
| 40 | + - name: Setup Go |
| 41 | + uses: actions/setup-go@v5 |
| 42 | + with: |
| 43 | + go-version: 'stable' |
| 44 | + |
| 45 | + - name: Install GitHub CLI |
| 46 | + run: | |
| 47 | + curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg |
| 48 | + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null |
| 49 | + sudo apt update |
| 50 | + sudo apt install gh -y |
| 51 | +
|
| 52 | + - name: Update protos using script |
| 53 | + run: | |
| 54 | + # Set environment variables for the script |
| 55 | + export GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" |
| 56 | + export GITHUB_REPOSITORY="${{ github.repository }}" |
| 57 | + export GITHUB_ACTIONS="true" |
| 58 | + |
| 59 | + # Run the update script |
| 60 | + ./scripts/update-protos.sh \ |
| 61 | + --release-version "${{ github.event.inputs.release_version }}" \ |
| 62 | + --sdk-version "${{ github.event.inputs.sdk_version }}" \ |
| 63 | + --branch-name "${{ github.event.inputs.branch_name }}" \ |
| 64 | + --pr-title "${{ github.event.inputs.pr_title }}" \ |
| 65 | + --verbose |
0 commit comments