Add Claude Code GitHub Workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow runs whenever the release PR is merged. It includes post-release communication processes like | |
| # posting to slack, the website, community forums, etc. | |
| # Only things that happen after a release is completed and all of the necessary code changes (like the changelog) are made. | |
| name: Post-release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| required: false | |
| default: true | |
| type: boolean | |
| version: | |
| required: true | |
| latest: | |
| type: boolean | |
| default: false | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - 'main' | |
| - 'release-*.*.*' | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| setup: | |
| if: ${{ github.event_name == 'workflow_dispatch' || (github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')) }} | |
| name: Setup and establish latest | |
| outputs: | |
| version: ${{ steps.output.outputs.version }} | |
| release_branch: ${{ steps.output.outputs.release_branch }} | |
| dry_run: ${{ steps.output.outputs.dry_run }} | |
| latest: ${{ steps.output.outputs.latest }} | |
| private_key: ${{ steps.output.outputs.delivery_bot_pem }} | |
| app_id: ${{ vars.DELIVERY_BOT_APP_ID }} | |
| env: | |
| HEAD_REF: ${{ github.head_ref }} | |
| DRY_RUN: ${{ inputs.dry_run }} | |
| LATEST: ${{ inputs.latest && '1' || '0' }} | |
| VERSION: ${{ inputs.version }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') }} | |
| run: | | |
| { | |
| echo "VERSION=$(echo "${HEAD_REF}" | sed -e 's/release\/.*\//v/g')" | |
| echo "DRY_RUN=${{ contains(github.event.pull_request.labels.*.name, 'release/dry-run') }}" | |
| echo "LATEST=${{ contains(github.event.pull_request.labels.*.name, 'release/latest') && '1' || '0' }}" | |
| } >> "$GITHUB_ENV" | |
| - id: output | |
| run: | | |
| echo "dry_run: $DRY_RUN" | |
| echo "latest: $LATEST" | |
| echo "version: $VERSION" | |
| { | |
| echo "release_branch=$(echo "$VERSION" | sed -s 's/^v/release-/g')" | |
| echo "dry_run=$DRY_RUN" | |
| echo "latest=$LATEST" | |
| echo "version=$VERSION" | |
| } >> "$GITHUB_OUTPUT" | |
| create_next_release_branch_grafana: | |
| name: Create next release branch (Grafana) | |
| needs: setup | |
| uses: grafana/grafana/.github/workflows/create-next-release-branch.yml@main | |
| with: | |
| ownerRepo: 'grafana/grafana' | |
| source: ${{ needs.setup.outputs.release_branch }} | |
| create_next_release_branch_enterprise: | |
| name: Create next release branch (Grafana Enterprise) | |
| needs: setup | |
| uses: grafana/grafana/.github/workflows/create-next-release-branch.yml@main | |
| with: | |
| ownerRepo: 'grafana/grafana-enterprise' | |
| source: ${{ needs.setup.outputs.release_branch }} | |
| create_security_branch_grafana: | |
| name: Create security branch (Grafana Security Mirror) | |
| needs: setup | |
| uses: ./.github/workflows/create-security-branch.yml | |
| with: | |
| release_branch: ${{ needs.setup.outputs.release_branch }} | |
| security_branch_number: "01" | |
| repository: grafana/grafana-security-mirror | |
| create_security_branch_enterprise: | |
| name: Create security branch (Enterprise) | |
| needs: setup | |
| uses: ./.github/workflows/create-security-branch.yml | |
| with: | |
| release_branch: ${{ needs.setup.outputs.release_branch }} | |
| security_branch_number: "01" | |
| repository: grafana/grafana-enterprise | |
| migrate_prs_grafana: | |
| needs: | |
| - setup | |
| - create_next_release_branch_grafana | |
| uses: grafana/grafana/.github/workflows/migrate-prs.yml@main | |
| with: | |
| ownerRepo: 'grafana/grafana' | |
| from: ${{ needs.setup.outputs.release_branch }} | |
| to: ${{ needs.create_next_release_branch_grafana.outputs.branch }} | |
| migrate_prs_enterprise: | |
| needs: | |
| - setup | |
| - create_next_release_branch_enterprise | |
| uses: grafana/grafana/.github/workflows/migrate-prs.yml@main | |
| with: | |
| ownerRepo: 'grafana/grafana-enterprise' | |
| from: ${{ needs.setup.outputs.release_branch }} | |
| to: ${{ needs.create_next_release_branch_enterprise.outputs.branch }} | |
| post_changelog_on_forum: | |
| needs: setup | |
| uses: grafana/grafana/.github/workflows/community-release.yml@main | |
| 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 | |
| # endpoint. | |
| needs: setup | |
| uses: grafana/grafana/.github/workflows/github-release.yml@main | |
| with: | |
| version: ${{ needs.setup.outputs.version }} | |
| dry_run: ${{ needs.setup.outputs.dry_run == 'true' }} | |
| latest: ${{ needs.setup.outputs.latest }} | |
| post_on_slack: | |
| needs: setup | |
| runs-on: ubuntu-latest | |
| env: | |
| DRY_RUN: ${{ needs.setup.outputs.dry_run }} | |
| VERSION: ${{ needs.setup.outputs.version }} | |
| steps: | |
| - run: | | |
| echo announce on slack that "$VERSION" has been released | |
| echo dry run: "$DRY_RUN" |