Chore: Update Prepare release action (#43397)

* Update bump-version.yml

* Chore: test

* tst

* use right branc

* use right test

* chore: test

* Chore: test

* Chore: test

* Chore:test

* WIP: test

* WIP: test

* WIP: test

* WIP: test

* Chore: revert workflows

* WIP: test

* Update prepare-release.yml

* WIP: test

* Chore: test

* WIP: test

* Update prepare-release.yml

* Update bump-version.yml

* Update prepare-release.yml

* Update bump-version.yml

* Update prepare-release.yml

* Update prepare-release.yml

* Chore: update close-milestone

* Update close-milestone.yml

* Chore: update remove-milestone

* Update prepare-release.yml

* Chore: updates update-changelog

* Update prepare-release.yml

* Update prepare-release.yml

* Chore: forgot the version_call param

* Update prepare-release.yml

* Update bump-version.yml

* Update close-milestone.yml

* Update remove-milestone.yml

* Update update-changelog.yml

* Chore: removes empty spaces

* Update prepare-release.yml

* Start Test: change ref to test github action bump version

* test: use the right branch reference

* Update bump-version.yml

* ref right branches

Co-authored-by: Maria Alexandra <239999+axelavargas@users.noreply.github.com>
pull/43423/head
Hugo Häggmark 4 years ago committed by GitHub
parent b3d5a607d4
commit b41c3124bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 38
      .github/workflows/bump-version.yml
  2. 12
      .github/workflows/close-milestone.yml
  3. 13
      .github/workflows/prepare-release.yml
  4. 10
      .github/workflows/remove-milestone.yml
  5. 22
      .github/workflows/update-changelog.yml

@ -11,24 +11,43 @@ on:
description: Needs to match, exactly, the name of a version description: Needs to match, exactly, the name of a version
required: true required: true
type: string type: string
secrets:
token:
required: true
metricsWriteAPIKey:
required: true
jobs: jobs:
main: main:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# This is a basic workflow to help you get started with Actions # This is a basic workflow to help you get started with Actions
- uses: actions-ecosystem/action-regex-match@v2.0.2 - uses: actions-ecosystem/action-regex-match@v2.0.2
if: ${{ github.event.inputs.version != '' }}
id: regex-match id: regex-match
with: with:
text: ${{ github.event.inputs.version }} text: ${{ github.event.inputs.version }}
regex: '^(\d+.\d+).\d+(?:-beta.\d+)?$' regex: '^(\d+.\d+).\d+(?:-beta.\d+)?$'
- uses: actions-ecosystem/action-regex-match@v2.0.2
if: ${{ inputs.version_call != '' }}
id: regex-match-version-call
with:
text: ${{ inputs.version_call }}
regex: '^(\d+.\d+).\d+(?:-beta\d+)?$'
- name: Validate input version - name: Validate input version
if: ${{ steps.regex-match.outputs.match == '' }} if: ${{ steps.regex-match.outputs.match == '' && github.event.inputs.version != '' }}
run: | run: |
echo "The input version format is not correct, please respect:\ echo "The input version format is not correct, please respect:\
major.minor.patch or major.minor.patch-beta.number format. \ major.minor.patch or major.minor.patch-beta.number format. \
example: 7.4.3 or 7.4.3-beta.1" example: 7.4.3 or 7.4.3-beta.1"
exit 1 exit 1
- name: Validate input version call
if: ${{ inputs.version_call != '' && steps.regex-match-version-call.outputs.match == '' }}
run: |
echo "The input version format is not correct, please respect:\
major.minor.patch or major.minor.patch-beta<number> format. \
example: 7.4.3 or 7.4.3-beta1"
exit 1
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set intermedia variables - name: Set intermedia variables
@ -40,13 +59,13 @@ jobs:
echo "::set-output name=branch_exist::$(git ls-remote --heads https://github.com/grafana/grafana.git v${{ steps.regex-match.outputs.group1 }}.x | wc -l)" echo "::set-output name=branch_exist::$(git ls-remote --heads https://github.com/grafana/grafana.git v${{ steps.regex-match.outputs.group1 }}.x | wc -l)"
- name: Check input version is aligned with branch(not main) - name: Check input version is aligned with branch(not main)
if: ${{ github.event.inputs.version != '' }} && steps.intermedia.outputs.branch_exist != '0' && !contains(steps.intermedia.outputs.short_ref, steps.intermedia.outputs.branch_name) if: ${{ github.event.inputs.version != '' && steps.intermedia.outputs.branch_exist != '0' && !contains(steps.intermedia.outputs.short_ref, steps.intermedia.outputs.branch_name) }}
run: | run: |
echo " You need to run the workflow on branch v${{steps.regex-match.outputs.group1}}.x echo " You need to run the workflow on branch v${{steps.regex-match.outputs.group1}}.x
exit 1 exit 1
- name: Check input version is aligned with branch(main) - name: Check input version is aligned with branch(main)
if: ${{ github.event.inputs.version != '' }} && steps.intermedia.outputs.branch_exist == '0' && !contains(steps.intermedia.outputs.short_ref, 'main') if: ${{ github.event.inputs.version != '' && steps.intermedia.outputs.branch_exist == '0' && !contains(steps.intermedia.outputs.short_ref, 'main') }}
run: | run: |
echo "When you want to deliver a new new minor version, you might want to create a new branch first \ echo "When you want to deliver a new new minor version, you might want to create a new branch first \
with naming convention v[major].[minor].x, and just run the workflow on that branch. \ with naming convention v[major].[minor].x, and just run the workflow on that branch. \
@ -68,13 +87,12 @@ jobs:
if: ${{ github.event.inputs.version != '' }} if: ${{ github.event.inputs.version != '' }}
uses: ./actions/bump-version uses: ./actions/bump-version
with: with:
version: ${{ github.event.inputs.version }} token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
token: ${{secrets.GH_BOT_ACCESS_TOKEN}} metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
- name: Run bump version (workflow invoked) - name: Run bump version (workflow invoked)
if: ${{ inputs.version_call != '' }} if: ${{ inputs.version_call != '' }}
uses: ./actions/bump-version uses: ./actions/bump-version
with: with:
version: ${{ inputs.version_call }} version_call: ${{ inputs.version_call }}
token: ${{secrets.GH_BOT_ACCESS_TOKEN}} token: ${{ secrets.token }}
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}} metricsWriteAPIKey: ${{ secrets.metricsWriteAPIKey }}

@ -10,7 +10,10 @@ on:
version_call: version_call:
description: Needs to match, exactly, the name of a milestone description: Needs to match, exactly, the name of a milestone
required: true required: true
type: string type: string
secrets:
token:
required: true
jobs: jobs:
main: main:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -27,11 +30,10 @@ jobs:
if: ${{ github.event.inputs.version != '' }} if: ${{ github.event.inputs.version != '' }}
uses: ./actions/close-milestone uses: ./actions/close-milestone
with: with:
version: ${{ github.event.inputs.version }} token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
token: ${{secrets.GH_BOT_ACCESS_TOKEN}}
- name: Close milestone (workflow invoked) - name: Close milestone (workflow invoked)
if: ${{ inputs.version_call != '' }} if: ${{ inputs.version_call != '' }}
uses: ./actions/close-milestone uses: ./actions/close-milestone
with: with:
version: ${{ inputs.version_call }} version_call: ${{ inputs.version_call }}
token: ${{secrets.GH_BOT_ACCESS_TOKEN}} token: ${{ secrets.token }}

@ -3,26 +3,35 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version_input: version_input:
description: 'The version to be released please respect: major.minor.patch or major.minor.patch-beta.number format. example: 7.4.3 or 7.4.3-beta.1' description: 'The version to be released please respect: major.minor.patch or major.minor.patch-beta<number> format. example: 7.4.3 or 7.4.3-beta1'
required: true required: true
jobs: jobs:
call-remove-milestone: call-remove-milestone:
uses: grafana/grafana/.github/workflows/remove-milestone.yml@main uses: grafana/grafana/.github/workflows/remove-milestone.yml@main
with: with:
version_call: ${{ github.event.inputs.version_input }} version_call: ${{ github.event.inputs.version_input }}
secrets:
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
call-close-milestone: call-close-milestone:
uses: grafana/grafana/.github/workflows/close-milestone.yml@main uses: grafana/grafana/.github/workflows/close-milestone.yml@main
with: with:
version_call: ${{ github.event.inputs.version_input }} version_call: ${{ github.event.inputs.version_input }}
secrets:
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
needs: call-remove-milestone needs: call-remove-milestone
call-bump-version: call-bump-version:
uses: grafana/grafana/.github/workflows/bump-version.yml@main uses: grafana/grafana/.github/workflows/bump-version.yml@main
with: with:
version_call: ${{ github.event.inputs.version_input }} version_call: ${{ github.event.inputs.version_input }}
secrets:
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
needs: call-close-milestone needs: call-close-milestone
call-update-changelog: call-update-changelog:
uses: grafana/grafana/.github/workflows/update-changelog.yml@main uses: grafana/grafana/.github/workflows/update-changelog.yml@main
with: with:
version_call: ${{ github.event.inputs.version_input }} version_call: ${{ github.event.inputs.version_input }}
secrets:
token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
needs: call-bump-version needs: call-bump-version

@ -11,6 +11,9 @@ on:
description: Needs to match, exactly, the name of a milestone description: Needs to match, exactly, the name of a milestone
required: true required: true
type: string type: string
secrets:
token:
required: true
jobs: jobs:
main: main:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -27,11 +30,10 @@ jobs:
if: ${{ github.event.inputs.version != '' }} if: ${{ github.event.inputs.version != '' }}
uses: ./actions/remove-milestone uses: ./actions/remove-milestone
with: with:
version: ${{ github.event.inputs.version }} token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
token: ${{secrets.GH_BOT_ACCESS_TOKEN}}
- name: Remove milestone from open issues (workflow invoked) - name: Remove milestone from open issues (workflow invoked)
if: ${{ inputs.version_call != '' }} if: ${{ inputs.version_call != '' }}
uses: ./actions/remove-milestone uses: ./actions/remove-milestone
with: with:
version: ${{ inputs.version_call }} version_call: ${{ inputs.version_call }}
token: ${{secrets.GH_BOT_ACCESS_TOKEN}} token: ${{ secrets.token }}

@ -3,14 +3,19 @@ on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version: version:
required: true required: true
description: Needs to match, exactly, the name of a milestone description: Needs to match, exactly, the name of a milestone
workflow_call: workflow_call:
inputs: inputs:
version_call: version_call:
description: Needs to match, exactly, the name of a milestone description: Needs to match, exactly, the name of a milestone
required: true required: true
type: string type: string
secrets:
token:
required: true
metricsWriteAPIKey:
required: true
jobs: jobs:
main: main:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -20,20 +25,19 @@ jobs:
with: with:
repository: "grafana/grafana-github-actions" repository: "grafana/grafana-github-actions"
path: ./actions path: ./actions
ref: main ref: main
- name: Install Actions - name: Install Actions
run: npm install --production --prefix ./actions run: npm install --production --prefix ./actions
- name: Run update changelog (manually invoked) - name: Run update changelog (manually invoked)
if: ${{ github.event.inputs.version != '' }} if: ${{ github.event.inputs.version != '' }}
uses: ./actions/update-changelog uses: ./actions/update-changelog
with: with:
version: ${{ github.event.inputs.version }} token: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
token: ${{secrets.GH_BOT_ACCESS_TOKEN}} metricsWriteAPIKey: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}}
- name: Run update changelog (workflow invoked) - name: Run update changelog (workflow invoked)
if: ${{ inputs.version_call != '' }} if: ${{ inputs.version_call != '' }}
uses: ./actions/update-changelog uses: ./actions/update-changelog
with: with:
version: ${{ inputs.version_call }} version_call: ${{ inputs.version_call }}
token: ${{secrets.GH_BOT_ACCESS_TOKEN}} token: ${{ secrets.token }}
metricsWriteAPIKey: ${{secrets.GRAFANA_MISC_STATS_API_KEY}} metricsWriteAPIKey: ${{ secrets.metricsWriteAPIKey }}

Loading…
Cancel
Save