Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release automation #1765

Merged
merged 4 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
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

Check failure on line 60 in .github/workflows/prepare-release.yml

View workflow job for this annotation

GitHub Actions / yamllint

[empty-lines] too many blank lines (1 > 0)
4 changes: 4 additions & 0 deletions .github/workflows/scripts/use-cla-approved-github-bot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash -e

git config user.name opentelemetrybot
git config user.email [email protected]
Loading