mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 00:47:38 -06:00
44 lines
1.8 KiB
YAML
44 lines
1.8 KiB
YAML
name: Bump version
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
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'
|
|
required: true
|
|
push:
|
|
default: true
|
|
required: false
|
|
dry_run:
|
|
default: false
|
|
required: false
|
|
jobs:
|
|
main:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Grafana
|
|
uses: actions/checkout@v4
|
|
- name: Update package.json versions
|
|
uses: ./pkg/build/actions/bump-version
|
|
with:
|
|
version: ${{ inputs.version }}
|
|
- if: ${{ inputs.push }}
|
|
name: Generate token
|
|
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 }}
|
|
- 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 }}
|