Release automation (#1765)

Co-authored-by: Liudmila Molkova <limolkova@microsoft.com>
This commit is contained in:
Trask Stalnaker 2025-01-20 10:20:16 -08:00 committed by GitHub
parent b810141201
commit 77f0b70d36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 63 additions and 0 deletions

59
.github/workflows/prepare-release.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: Prepare release
on:
workflow_dispatch:
inputs:
version:
description: 'The version to release, e.g. 1.30.0'
required: true
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate version
run: |
version=${{ inputs.version }}
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "unexpected version: $version"
exit 1
fi
- name: Use CLA approved github bot
run: .github/workflows/scripts/use-cla-approved-github-bot.sh
- name: Update schema files
run: |
if ! grep -q "^ next:$" schema-next.yaml; then
echo "String 'next:' not found in the file"
exit 1
fi
version=${{ inputs.version }}
sed -i "0,/^ next:$/s// $version:/" schema-next.yaml
cp schema-next.yaml "schemas/$version"
git add "schemas/$version"
sed -i "0,/^ $version:$/s// next:\n $version:/" schema-next.yaml
- name: Update change log
run: |
make chlog-update VERSION=v${{ inputs.version }}
- name: Create pull request
env:
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
run: |
version=${{ inputs.version }}
message="Prepare release v${version}"
body="Prepare release \`v${version}\`."
branch="opentelemetrybot/prepare-release-v${version}"
git checkout -b $branch
git commit -a -m "$message"
git push --set-upstream origin $branch
gh pr create --title "$message" \
--body "$body" \
--base main

View File

@ -0,0 +1,4 @@
#!/bin/bash -e
git config user.name opentelemetrybot
git config user.email 107717825+opentelemetrybot@users.noreply.github.com