-
Notifications
You must be signed in to change notification settings - Fork 773
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[repo] Release automation improvements (#5657)
- Loading branch information
1 parent
b9d56aa
commit 3ffa916
Showing
7 changed files
with
296 additions
and
169 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Resolve automation settings | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
enabled: | ||
value: ${{ jobs.resolve-automation.outputs.enabled == 'true' }} | ||
token-secret-name: | ||
value: ${{ jobs.resolve-automation.outputs.token-secret-name }} | ||
username: | ||
value: ${{ vars.AUTOMATION_USERNAME }} | ||
email: | ||
value: ${{ vars.AUTOMATION_EMAIL }} | ||
secrets: | ||
OPENTELEMETRYBOT_GITHUB_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
resolve-automation: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
enabled: ${{ steps.evaluate.outputs.enabled }} | ||
token-secret-name: ${{ steps.evaluate.outputs.token-secret-name }} | ||
|
||
env: | ||
OPENTELEMETRYBOT_GITHUB_TOKEN_EXISTS: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN != '' }} | ||
|
||
steps: | ||
- id: evaluate | ||
run: | | ||
echo "enabled=${{ env.OPENTELEMETRYBOT_GITHUB_TOKEN_EXISTS == 'true' }}" >> "$GITHUB_OUTPUT" | ||
echo "token-secret-name=OPENTELEMETRYBOT_GITHUB_TOKEN" >> "$GITHUB_OUTPUT" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Complete release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
required: true | ||
description: 'Release tag' | ||
type: string | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
automation: | ||
uses: ./.github/workflows/automation.yml | ||
secrets: inherit | ||
|
||
post-release: | ||
runs-on: ubuntu-latest | ||
|
||
needs: | ||
- automation | ||
|
||
if: | | ||
needs.automation.outputs.enabled | ||
&& | ||
( | ||
(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')) | ||
) | ||
env: | ||
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.repository.default_branch }} | ||
token: ${{ secrets[needs.automation.outputs.token-secret-name] }} | ||
|
||
- name: Create GitHub Pull Request to update stable build version in props | ||
shell: pwsh | ||
run: | | ||
Import-Module .\build\scripts\post-release.psm1 | ||
CreateStableVersionUpdatePullRequest ` | ||
-gitRepository '${{ github.repository }}' ` | ||
-tag '${{ inputs.tag || github.ref_name }}' ` | ||
-targetBranch '${{ github.event.repository.default_branch }}' ` | ||
-gitUserName '${{ needs.automation.outputs.username }}' ` | ||
-gitUserEmail '${{ needs.automation.outputs.email }}' |
This file contains 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 file contains 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 file contains 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
Oops, something went wrong.