|
| 1 | +name: Shield Release Branch Updater |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + kind: |
| 7 | + description: 'Shield component' |
| 8 | + required: true |
| 9 | + default: "cluster" |
| 10 | + type: choice |
| 11 | + options: |
| 12 | + - "cluster" |
| 13 | + - "host-windows" |
| 14 | + - "host-linux" |
| 15 | + latest_release_version: |
| 16 | + description: 'Latest release version' |
| 17 | + required: true |
| 18 | + next_release_version: |
| 19 | + description: 'Next release version' |
| 20 | + required: true |
| 21 | + |
| 22 | +permissions: |
| 23 | + contents: write |
| 24 | + |
| 25 | +env: |
| 26 | + CURRENT_RELEASE_BRANCH: ${{ inputs.kind }}-shield-release-${{ inputs.latest_release_version}} |
| 27 | + NEXT_RELEASE_BRANCH: ${{ inputs.kind }}-shield-release-${{ inputs.next_release_version}} |
| 28 | + |
| 29 | +jobs: |
| 30 | + update-current-release-branch: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + steps: |
| 33 | + - name: Checkout current release branch |
| 34 | + id: checkout |
| 35 | + uses: actions/checkout@v5 |
| 36 | + continue-on-error: true |
| 37 | + with: |
| 38 | + ref: ${{ env.CURRENT_RELEASE_BRANCH }} |
| 39 | + fetch-depth: 0 |
| 40 | + |
| 41 | + - name: Checkout main branch |
| 42 | + if: steps.checkout.outcome == 'failure' |
| 43 | + uses: actions/checkout@v5 |
| 44 | + |
| 45 | + - name: Create current release branch |
| 46 | + if: steps.checkout.outcome == 'failure' |
| 47 | + run: | |
| 48 | + git checkout -b ${{ env.CURRENT_RELEASE_BRANCH }} |
| 49 | + git push -u origin ${{ env.CURRENT_RELEASE_BRANCH }} |
| 50 | +
|
| 51 | + - name: Update current release branch |
| 52 | + if: steps.checkout.outcome == 'success' |
| 53 | + run: | |
| 54 | + git config user.name "$GITHUB_ACTOR" |
| 55 | + git config user.email "[email protected]" |
| 56 | + ./scripts/shield/rebase.sh |
| 57 | + git push --force-with-lease |
| 58 | +
|
| 59 | + update-next-release-branch: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - name: Checkout next release branch |
| 63 | + id: checkout |
| 64 | + uses: actions/checkout@v5 |
| 65 | + continue-on-error: true |
| 66 | + with: |
| 67 | + ref: ${{ env.NEXT_RELEASE_BRANCH }} |
| 68 | + fetch-depth: 0 |
| 69 | + |
| 70 | + - name: Checkout main branch |
| 71 | + if: steps.checkout.outcome == 'failure' |
| 72 | + uses: actions/checkout@v5 |
| 73 | + |
| 74 | + - name: Create next release branch |
| 75 | + if: steps.checkout.outcome == 'failure' |
| 76 | + run: | |
| 77 | + git checkout -b ${{ env.NEXT_RELEASE_BRANCH }} |
| 78 | + git push -u origin ${{ env.NEXT_RELEASE_BRANCH }} |
| 79 | +
|
| 80 | + - name: Update next release branch |
| 81 | + if: steps.checkout.outcome == 'success' |
| 82 | + run: | |
| 83 | + git config user.name "$GITHUB_ACTOR" |
| 84 | + git config user.email "[email protected]" |
| 85 | + ./scripts/shield/rebase.sh |
| 86 | + git push --force-with-lease |
0 commit comments