diff --git a/.github/workflows/community-release.yml b/.github/workflows/community-release.yml new file mode 100644 index 00000000000..86e7703e5c4 --- /dev/null +++ b/.github/workflows/community-release.yml @@ -0,0 +1,46 @@ +name: Create community release post +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 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: + 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 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: + main: + runs-on: ubuntu-latest + steps: + - name: Run community-release (manually invoked) + uses: grafana/grafana-github-actions-go/community-release@main + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ inputs.version }} + metrics_api_key: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }} + community_api_key: ${{ secrets.GRAFANABOT_FORUM_KEY }} + community_api_username: grafanabot + dry_run: ${{ inputs.dry_run }} diff --git a/.github/workflows/release-comms.yml b/.github/workflows/release-comms.yml index b9fdf59bded..6b39664dad0 100644 --- a/.github/workflows/release-comms.yml +++ b/.github/workflows/release-comms.yml @@ -19,6 +19,7 @@ on: branches: - 'main' - 'v*.*.*' + jobs: setup: name: Setup and establish latest @@ -50,11 +51,13 @@ jobs: echo "version=$VERSION" >> "$GITHUB_OUTPUT" post_changelog_on_forum: needs: setup - runs-on: ubuntu-latest - steps: - - run: | - echo post changelog to forums for ${{ needs.setup.outputs.version }} - echo dry run: ${{ needs.setup.outputs.dry_run }} + uses: ./.github/workflows/community-release.yml + secrets: + GRAFANA_MISC_STATS_API_KEY: ${{ secrets.GRAFANA_MISC_STATS_API_KEY }} + GRAFANABOT_FORUM_KEY: ${{ secrets.GRAFANABOT_FORUM_KEY }} + with: + version: ${{ needs.setup.outputs.version }} + dry_run: ${{ needs.setup.outputs.dry_run == 'true' }} create_github_release: # a github release requires a git tag # The github-release action retrieves the changelog using the /repos/grafana/grafana/contents/CHANGELOG.md API