[Exporter.Prometheus] Fix spec compliance #4230
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
| name: Complete release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| required: true | |
| description: 'Release tag' | |
| type: string | |
| release: | |
| types: | |
| - published | |
| issue_comment: | |
| types: | |
| - created | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.issue.number || github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| automation: | |
| uses: ./.github/workflows/automation.yml | |
| secrets: | |
| OTELBOT_DOTNET_PRIVATE_KEY: ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }} | |
| push-packages-and-publish-release: | |
| name: Push packages and publish release | |
| runs-on: ubuntu-24.04 | |
| needs: automation | |
| permissions: | |
| id-token: write # Publish NuGet packages with trusted GitHub OIDC | |
| 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, '/PushPackages') && | |
| 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_APP_ID }} | |
| private-key: ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }} | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits | |
| token: ${{ steps.otelbot-token.outputs.token }} | |
| ref: ${{ github.event.repository.default_branch }} | |
| show-progress: false | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 | |
| - name: NuGet log in | |
| uses: NuGet/login@8d196754b4036150537f80ac539e15c2f1028841 # v1.2.0 | |
| id: nuget-login | |
| with: | |
| user: ${{ secrets.NUGET_USER }} | |
| - name: Push packages and publish release | |
| shell: pwsh | |
| env: | |
| GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} | |
| EXPECTED_PR_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-name }} | |
| EXPECTED_COMMENT_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-login }} | |
| COMMENT_USER_NAME: ${{ github.event.comment.user.login }} | |
| ISSUE_NUMBER: ${{ github.event.issue.number }} | |
| NUGET_API_KEY: ${{ steps.nuget-login.outputs.NUGET_API_KEY }} | |
| run: | | |
| Import-Module .\build\scripts\post-release.psm1 | |
| $HasToken = -Not [string]::IsNullOrEmpty($env:NUGET_API_KEY) | |
| PushPackagesPublishReleaseUnlockAndPostNoticeOnPrepareReleasePullRequest ` | |
| -gitRepository ${env:GITHUB_REPOSITORY} ` | |
| -pullRequestNumber ${env:ISSUE_NUMBER} ` | |
| -expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME} ` | |
| -expectedCommentAuthorUserName ${env:EXPECTED_COMMENT_AUTHOR_USER_NAME} ` | |
| -commentUserName ${env:COMMENT_USER_NAME} ` | |
| -artifactDownloadPath "${env:GITHUB_WORKSPACE}/artifacts" ` | |
| -pushToNuget $HasToken | |
| post-release-published: | |
| name: Post release published notice | |
| runs-on: ubuntu-24.04 | |
| needs: | |
| - automation | |
| if: | | |
| needs.automation.outputs.enabled && | |
| (github.event_name == 'release' || github.event_name == 'workflow_dispatch') | |
| 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_APP_ID }} | |
| private-key: ${{ secrets.OTELBOT_DOTNET_PRIVATE_KEY }} | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Checkout code | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| # Note: By default GitHub only fetches 1 commit. MinVer needs to find | |
| # the version tag which is typically NOT on the first commit so we | |
| # retrieve them all. | |
| fetch-depth: 0 | |
| persist-credentials: true # zizmor: ignore[artipacked] Needed to push commits | |
| ref: ${{ github.event.repository.default_branch }} | |
| show-progress: false | |
| token: ${{ steps.otelbot-token.outputs.token }} | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0 | |
| - name: Create GitHub Pull Request to update stable build version in props | |
| if: | | |
| (github.ref_type == 'tag' && startsWith(github.ref_name, 'core-') && !contains(github.ref_name, '-alpha') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-rc')) | |
| || (inputs.tag && startsWith(inputs.tag, 'core-') && !contains(inputs.tag, '-alpha') && !contains(inputs.tag, '-beta') && !contains(inputs.tag, '-rc')) | |
| shell: pwsh | |
| env: | |
| GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} | |
| BOT_USER_EMAIL: ${{ needs.automation.outputs.email }} | |
| BOT_USER_NAME: ${{ needs.automation.outputs.username }} | |
| TAG: ${{ inputs.tag || github.ref_name }} | |
| TARGET_BRANCH: ${{ github.event.repository.default_branch }} | |
| run: | | |
| Import-Module .\build\scripts\post-release.psm1 | |
| CreateStableVersionUpdatePullRequest ` | |
| -gitRepository ${env:GITHUB_REPOSITORY} ` | |
| -tag ${env:TAG} ` | |
| -targetBranch ${env:TARGET_BRANCH} ` | |
| -gitUserName ${env:BOT_USER_NAME} ` | |
| -gitUserEmail ${env:BOT_USER_EMAIL} | |
| - name: Post notice when release is published | |
| shell: pwsh | |
| env: | |
| GH_TOKEN: ${{ steps.otelbot-token.outputs.token }} | |
| EXPECTED_PR_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-name }} | |
| EXPECTED_COMMENT_AUTHOR_USER_NAME: ${{ needs.automation.outputs.application-login }} | |
| TAG: ${{ inputs.tag || github.ref_name }} | |
| run: | | |
| Import-Module .\build\scripts\post-release.psm1 | |
| TryPostReleasePublishedNoticeOnPrepareReleasePullRequest ` | |
| -gitRepository ${env:GITHUB_REPOSITORY} ` | |
| -expectedPrAuthorUserName ${env:EXPECTED_PR_AUTHOR_USER_NAME} ` | |
| -expectedCommentAuthorUserName ${env:EXPECTED_COMMENT_AUTHOR_USER_NAME} ` | |
| -tag ${env:TAG} |