2020-11-15 04:50:43 -06:00
name : Bump version
on :
workflow_dispatch :
inputs :
version :
2023-05-30 10:10:09 -05:00
description: 'Needs to match, exactly, the name of a milestone. The version to be released please respect: major.minor.patch, major.minor.patch-preview or major.minor.patch-preview<number> format. example : 7.4 .3 , 7.4 .3 -preview or 7.4.3-preview1'
2020-11-15 04:50:43 -06:00
required : true
2024-06-20 13:15:09 -05:00
push :
default : true
required : false
dry_run :
default : false
required : false
2020-11-15 04:50:43 -06:00
jobs :
main :
runs-on : ubuntu-latest
steps :
2024-06-20 13:15:09 -05:00
- name : Checkout Grafana
2023-09-05 03:10:10 -05:00
uses : actions/checkout@v4
2024-06-20 13:15:09 -05:00
- name : Update package.json versions
uses : ./pkg/build/actions/bump-version
2020-11-15 04:50:43 -06:00
with :
2024-06-20 13:15:09 -05:00
version : ${{ inputs.version }}
- if : ${{ inputs.push }}
name : Generate token
2023-06-21 04:06:56 -05:00
id : generate_token
uses : tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with :
app_id : ${{ secrets.GRAFANA_DELIVERY_BOT_APP_ID }}
private_key : ${{ secrets.GRAFANA_DELIVERY_BOT_APP_PEM }}
2024-06-20 13:15:09 -05:00
- if : ${{ inputs.push }}
name : Push & Create PR
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
git checkout -b "bump-version/${{ github.run_id }}/${{ inputs.version }}"
git add .
git commit -m "bump version ${{ inputs.version }}"
git push
gh pr create --dry-run=${{ inputs.dry_run }} -l "type/ci" -l "no-changelog" -B "${{ github.ref_name }}" --title "Release: Bump version to ${{ inputs.version }}" --body "Updated version to ${{ inputs.version }}"
env :
GH_TOKEN : ${{ steps.generate_token.outputs.token }}