CI: Add bump-version action to the release PR workflow (#89491)
This commit is contained in:
@@ -22,6 +22,7 @@ on:
|
||||
description: Branch to backport these changes to
|
||||
dry_run:
|
||||
required: false
|
||||
default: false
|
||||
type: bool
|
||||
|
||||
jobs:
|
||||
@@ -42,21 +43,31 @@ jobs:
|
||||
run: |
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local --add --bool push.autoSetupRemote true
|
||||
- name: Create branch
|
||||
run: git checkout -b "release/${{ github.run_id }}/${{ inputs.version }}"
|
||||
- name: Generate changelog
|
||||
run: git commit --allow-empty -m "Update changelog placeholder"
|
||||
- name: Update package.json
|
||||
run: git commit --allow-empty -m "Update version in package.json(s) (and yarn install) placeholder"
|
||||
- name: Update package.json versions
|
||||
uses: ./pkg/build/actions/bump-version
|
||||
with:
|
||||
version: ${{ inputs.version }}
|
||||
- name: add package.json changes
|
||||
run: |
|
||||
git add .
|
||||
git commit -m "Update version to ${{ inputs.version }}"
|
||||
- name: git push
|
||||
if: ${{ inputs.dry_run }} != true
|
||||
run: git push
|
||||
- name: Create PR without backports
|
||||
if: "${{ github.event.inputs.backport == '' }}"
|
||||
if: "${{ inputs.backport == '' }}"
|
||||
run: >
|
||||
gh pr create --dry-run=${{ inputs.dry_run }} -H "release/${{ inputs.version }}" -B "${{ inputs.target }}" --title "Release: ${{ inputs.version }}" --body "These code changes must be merged after a release is complete"
|
||||
gh pr create --dry-run=${{ inputs.dry_run }} -B "${{ inputs.target }}" --title "Release: ${{ inputs.version }}" --body "These code changes must be merged after a release is complete"
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||
- name: Create PR with backports
|
||||
if: "${{ github.event.inputs.backport != '' }}"
|
||||
if: "${{ inputs.backport != '' }}"
|
||||
run: >
|
||||
gh pr create -l "backport ${{ inputs.backport }}" --dry-run=${{ inputs.dry_run }} -H "release/${{ inputs.version }}" -B "${{ inputs.target }}" --title "Release: ${{ inputs.version }}" --body "These code changes must be merged after a release is complete"
|
||||
gh pr create -l "backport ${{ inputs.backport }}" -l "product-approved" --dry-run=${{ inputs.dry_run }} -B "${{ inputs.target }}" --title "Release: ${{ inputs.version }}" --body "These code changes must be merged after a release is complete"
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
|
||||
|
||||
Reference in New Issue
Block a user