Skip to content

Pull Request Dashboard #10386

Pull Request Dashboard

Pull Request Dashboard #10386

name: Prepare for a release
on:
workflow_dispatch:
inputs:
component:
type: choice
options:
- OpenTelemetry.Exporter.Geneva
- OpenTelemetry.Exporter.InfluxDB
- OpenTelemetry.Exporter.OneCollector
- OpenTelemetry.Extensions
- OpenTelemetry.Extensions.AWS
- OpenTelemetry.Extensions.Enrichment
- OpenTelemetry.Extensions.Enrichment.AspNetCore
- OpenTelemetry.Extensions.Enrichment.Http
- OpenTelemetry.Instrumentation.AspNet
- OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule
- OpenTelemetry.Instrumentation.AspNetCore
- OpenTelemetry.Instrumentation.AWS
- OpenTelemetry.Instrumentation.AWSLambda
- OpenTelemetry.Instrumentation.Cassandra
- OpenTelemetry.Instrumentation.ConfluentKafka
- OpenTelemetry.Instrumentation.ElasticsearchClient
- OpenTelemetry.Instrumentation.EntityFrameworkCore
- OpenTelemetry.Instrumentation.EventCounters
- OpenTelemetry.Instrumentation.GrpcCore
- OpenTelemetry.Instrumentation.GrpcNetClient
- OpenTelemetry.Instrumentation.Hangfire
- OpenTelemetry.Instrumentation.Http
- OpenTelemetry.Instrumentation.Kusto
- OpenTelemetry.Instrumentation.Owin
- OpenTelemetry.Instrumentation.Process
- OpenTelemetry.Instrumentation.Quartz
- OpenTelemetry.Instrumentation.Remoting
- OpenTelemetry.Instrumentation.Runtime
- OpenTelemetry.Instrumentation.ServiceFabricRemoting
- OpenTelemetry.Instrumentation.SqlClient
- OpenTelemetry.Instrumentation.StackExchangeRedis
- OpenTelemetry.Instrumentation.Wcf
- OpenTelemetry.OpAmp.Client
- OpenTelemetry.PersistentStorage.Abstractions
- OpenTelemetry.PersistentStorage.FileSystem
- OpenTelemetry.Resources.AWS
- OpenTelemetry.Resources.Azure
- OpenTelemetry.Resources.Container
- OpenTelemetry.Resources.Gcp
- OpenTelemetry.Resources.Host
- OpenTelemetry.Resources.OperatingSystem
- OpenTelemetry.Resources.Process
- OpenTelemetry.Resources.ProcessRuntime
- OpenTelemetry.Sampler.AWS
- OpenTelemetry.SemanticConventions
description: 'Release component'
required: true
version:
type: string
description: 'Release version'
required: true
releaseIssue:
type: string
description: 'Release request issue'
required: false
pull_request:
types:
- closed
issues:
types:
- opened
- edited
issue_comment:
types:
- created
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.ref }}
cancel-in-progress: false
jobs:
automation:
uses: ./.github/workflows/automation.yml
# Partial combination of simplified child jobs condition to avoid running jobs at all
if: |
github.event_name == 'workflow_dispatch'
||
(
github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.title, '[release] Prepare release ')
)
||
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
startsWith(github.event.issue.title, '[release] Prepare release ')
)
||
(
startsWith(github.event.issue.title, '[release request] ') &&
github.event.issue.pull_request == null
)
secrets:
OTELBOT_DOTNET_CONTRIB_PRIVATE_KEY: ${{ secrets.OTELBOT_DOTNET_CONTRIB_PRIVATE_KEY }}
prepare-release-pr:
name: Prepare release pull request
runs-on: ubuntu-24.04
needs: automation
if: github.event_name == 'workflow_dispatch' && needs.automation.outputs.enabled
steps:
- name: Generate GitHub App token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: otelbot-token
with:
client-id: ${{ vars.OTELBOT_DOTNET_CONTRIB_CLIENT_ID }}
private-key: ${{ secrets.OTELBOT_DOTNET_CONTRIB_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits
show-progress: false
token: ${{ steps.otelbot-token.outputs.token }}
- name: Create GitHub Pull Request to prepare release
shell: pwsh
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
BOT_USER_EMAIL: ${{ needs.automation.outputs.email }}
BOT_USER_NAME: ${{ needs.automation.outputs.username }}
COMMENT_USER_NAME: ${{ github.event.sender.login }}
COMPONENT: ${{ inputs.component }}
RELEASE_ISSUE: ${{ inputs.releaseIssue }}
VERSION: ${{ inputs.version }}
run: |
Import-Module .\build\scripts\prepare-release.psm1
CreatePullRequestToUpdateChangelogsAndPublicApis `
-gitRepository ${env:GITHUB_REPOSITORY} `
-component ${env:COMPONENT} `
-version ${env:VERSION} `
-requestedByUserName ${env:COMMENT_USER_NAME} `
-releaseIssue ${env:RELEASE_ISSUE} `
-targetBranch ${env:GITHUB_REF_NAME} `
-gitUserName ${env:BOT_USER_NAME} `
-gitUserEmail ${env:BOT_USER_EMAIL}
lock-pr-and-post-notice-to-create-release-tag:
name: Lock pull request and post release tag notice
runs-on: ubuntu-24.04
needs: automation
if: |
github.event_name == 'pull_request' &&
github.event.action == 'closed' &&
github.event.pull_request.user.login == needs.automation.outputs.application-username &&
github.event.pull_request.merged == true &&
startsWith(github.event.pull_request.title, '[release] Prepare release ') &&
needs.automation.outputs.enabled
steps:
- name: Generate GitHub App token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: otelbot-token
with:
client-id: ${{ vars.OTELBOT_DOTNET_CONTRIB_CLIENT_ID }}
private-key: ${{ secrets.OTELBOT_DOTNET_CONTRIB_PRIVATE_KEY }}
permission-contents: read
permission-pull-requests: write
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits
show-progress: false
token: ${{ steps.otelbot-token.outputs.token }}
- name: Lock GitHub Pull Request to prepare release
shell: pwsh
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
EXPECTED_PR_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-name }}
ISSUE_NUMBER: ${{ github.event.pull_request.number }}
run: |
Import-Module .\build\scripts\prepare-release.psm1
LockPullRequestAndPostNoticeToCreateReleaseTag `
-gitRepository ${env:GITHUB_REPOSITORY} `
-pullRequestNumber ${env:ISSUE_NUMBER} `
-expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME}
create-release-tag-unlock-pr-post-notice:
name: Create release tag and post notice
runs-on: ubuntu-24.04
needs: automation
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.issue.locked == true &&
github.event.comment.user.login != needs.automation.outputs.application-username &&
contains(github.event.comment.body, '/CreateReleaseTag') &&
startsWith(github.event.issue.title, '[release] Prepare release ') &&
github.event.issue.pull_request.merged_at &&
needs.automation.outputs.enabled
steps:
- name: Generate GitHub App token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: otelbot-token
with:
client-id: ${{ vars.OTELBOT_DOTNET_CONTRIB_CLIENT_ID }}
private-key: ${{ secrets.OTELBOT_DOTNET_CONTRIB_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below
fetch-depth: 0
persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits
show-progress: false
token: ${{ steps.otelbot-token.outputs.token }}
- name: Create release tag
id: create-tag
shell: pwsh
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
BOT_USER_EMAIL: ${{ needs.automation.outputs.email }}
BOT_USER_NAME: ${{ needs.automation.outputs.username }}
EXPECTED_PR_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-name }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
Import-Module .\build\scripts\prepare-release.psm1
CreateReleaseTagAndPostNoticeOnPullRequest `
-gitRepository ${env:GITHUB_REPOSITORY} `
-pullRequestNumber ${env:ISSUE_NUMBER} `
-expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME} `
-gitUserName ${env:BOT_USER_NAME} `
-gitUserEmail ${env:BOT_USER_EMAIL}
update-changelog-release-dates-on-prepare-pr-post-notice:
name: Update changelog release dates and post notice
runs-on: ubuntu-24.04
needs: automation
if: |
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.issue.state == 'open' &&
github.event.comment.user.login != needs.automation.outputs.application-username &&
contains(github.event.comment.body, '/UpdateReleaseDates') &&
startsWith(github.event.issue.title, '[release] Prepare release ') &&
github.event.issue.pull_request.merged_at == null &&
needs.automation.outputs.enabled
steps:
- name: Generate GitHub App token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: otelbot-token
with:
client-id: ${{ vars.OTELBOT_DOTNET_CONTRIB_CLIENT_ID }}
private-key: ${{ secrets.OTELBOT_DOTNET_CONTRIB_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below
fetch-depth: 0
persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits
show-progress: false
token: ${{ steps.otelbot-token.outputs.token }}
- name: Update release date
id: create-tag
shell: pwsh
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
BOT_USER_EMAIL: ${{ needs.automation.outputs.email }}
BOT_USER_NAME: ${{ needs.automation.outputs.username }}
EXPECTED_PR_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-name }}
COMMENT_USER_NAME: ${{ github.event.comment.user.login }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
run: |
Import-Module .\build\scripts\prepare-release.psm1
UpdateChangelogReleaseDatesAndPostNoticeOnPullRequest `
-gitRepository ${env:GITHUB_REPOSITORY} `
-pullRequestNumber ${env:ISSUE_NUMBER} `
-expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME} `
-commentUserName ${env:COMMENT_USER_NAME} `
-gitUserName ${env:BOT_USER_NAME} `
-gitUserEmail ${env:BOT_USER_EMAIL}
process-release-request-issue:
name: Process release request issue
runs-on: ubuntu-24.04
needs: automation
if: |
startsWith(github.event.issue.title, '[release request] ') &&
github.event.issue.pull_request == null &&
needs.automation.outputs.enabled &&
(
(github.event_name == 'issues')
||
(github.event_name == 'issue_comment' &&
github.event.issue.state == 'open' &&
contains(github.event.comment.body, '/PrepareRelease') &&
github.event.comment.user.login != needs.automation.outputs.application-username)
)
steps:
- name: Generate GitHub App token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
id: otelbot-token
with:
client-id: ${{ vars.OTELBOT_DOTNET_CONTRIB_CLIENT_ID }}
private-key: ${{ secrets.OTELBOT_DOTNET_CONTRIB_PRIVATE_KEY }}
permission-contents: write
permission-issues: write
permission-pull-requests: write
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits
show-progress: false
token: ${{ steps.otelbot-token.outputs.token }}
- name: Process release request issue being opened or commented
shell: pwsh
env:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
BOT_USER_EMAIL: ${{ needs.automation.outputs.email }}
BOT_USER_NAME: ${{ needs.automation.outputs.username }}
ISSUE_BODY: ${{ github.event.issue.body }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
ISSUE_TITLE: ${{ github.event.issue.title }}
REQUESTOR_USER_NAME: ${{ github.event.comment.user.login || github.event.sender.login }}
TARGET_BRANCH: ${{ github.event.repository.default_branch }}
run: |
Import-Module .\build\scripts\prepare-release.psm1
TagCodeOwnersOnOrRunWorkflowForRequestReleaseIssue `
-gitRepository ${env:GITHUB_REPOSITORY} `
-targetBranch ${env:TARGET_BRANCH} `
-triggeringEventName ${env:GITHUB_EVENT_NAME} `
-approvingGroups "@${env:GITHUB_REPOSITORY_OWNER}/dotnet-approvers @${env:GITHUB_REPOSITORY_OWNER}/dotnet-maintainers" `
-requestedByUserName ${env:REQUESTOR_USER_NAME} `
-issueNumber ${env:ISSUE_NUMBER} `
-issueBody ${env:ISSUE_BODY} `
-issueTitle ${env:ISSUE_TITLE} `
-gitUserName ${env:BOT_USER_NAME} `
-gitUserEmail ${env:BOT_USER_EMAIL}