[v10.4.x] CI: post changelog to forum in release-comms (#90752)
CI: post changelog to forum in release-comms (#90742)
* post changelog to forum in post-release workflow
(cherry picked from commit 9a3672c2bb)
Co-authored-by: Kevin Minehart <5140827+kminehart@users.noreply.github.com>
This commit is contained in:
co-authored by
Kevin Minehart
parent
882042cdff
commit
2c780cef83
@@ -1,25 +1,46 @@
|
|||||||
name: Create community release post
|
name: Create community release post
|
||||||
on:
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
type: string
|
||||||
|
required: true
|
||||||
|
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'
|
||||||
|
dry_run:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: When enabled, this workflow will print a preview instead of creating an actual post.
|
||||||
|
secrets:
|
||||||
|
GRAFANA_MISC_STATS_API_KEY:
|
||||||
|
required: true
|
||||||
|
GRAFANABOT_FORUM_KEY:
|
||||||
|
required: true
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
|
type: string
|
||||||
required: true
|
required: true
|
||||||
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'
|
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'
|
||||||
|
dry_run:
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
description: When enabled, this workflow will print a preview instead of creating an actual post.
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
main:
|
main:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- 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 }}
|
|
||||||
- name: Run community-release (manually invoked)
|
- name: Run community-release (manually invoked)
|
||||||
uses: grafana/grafana-github-actions-go/community-release@main
|
uses: grafana/grafana-github-actions-go/community-release@main
|
||||||
with:
|
with:
|
||||||
token: ${{ steps.generate_token.outputs.token }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
version: ${{ inputs.version }}
|
version: ${{ inputs.version }}
|
||||||
metrics_api_key: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
|
metrics_api_key: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
|
||||||
community_api_key: ${{ secrets.GRAFANABOT_FORUM_KEY }}
|
community_api_key: ${{ secrets.GRAFANABOT_FORUM_KEY }}
|
||||||
community_api_username: grafanabot
|
community_api_username: grafanabot
|
||||||
|
dry_run: ${{ inputs.dry_run }}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- 'main'
|
- 'main'
|
||||||
- 'v*.*.*'
|
- 'v*.*.*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')) }}
|
if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')) }}
|
||||||
@@ -51,11 +52,13 @@ jobs:
|
|||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
post_changelog_on_forum:
|
post_changelog_on_forum:
|
||||||
needs: setup
|
needs: setup
|
||||||
runs-on: ubuntu-latest
|
uses: ./.github/workflows/community-release.yml
|
||||||
steps:
|
secrets:
|
||||||
- run: |
|
GRAFANA_MISC_STATS_API_KEY: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }}
|
||||||
echo post changelog to forums for ${{ needs.setup.outputs.version }}
|
GRAFANABOT_FORUM_KEY: ${{ secrets.GRAFANABOT_FORUM_KEY }}
|
||||||
echo dry run: ${{ needs.setup.outputs.dry_run }}
|
with:
|
||||||
|
version: ${{ needs.setup.outputs.version }}
|
||||||
|
dry_run: ${{ needs.setup.outputs.dry_run == 'true' }}
|
||||||
create_github_release:
|
create_github_release:
|
||||||
# a github release requires a git tag
|
# a github release requires a git tag
|
||||||
# The github-release action retrieves the changelog using the /repos/grafana/grafana/contents/CHANGELOG.md API
|
# The github-release action retrieves the changelog using the /repos/grafana/grafana/contents/CHANGELOG.md API
|
||||||
|
|||||||
Reference in New Issue
Block a user