Less release steps (#1793)

Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
This commit is contained in:
Trask Stalnaker 2025-01-24 00:40:11 -08:00 committed by GitHub
parent 62d5a7cd37
commit 867ed9c88f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 87 additions and 19 deletions

View File

@ -2,13 +2,13 @@
# Example usage:
#
# ./internal/tools/update_specification_version.sh
# ./internal/tools/update-spec-repo-links.sh v1.41.0
# this version should be kept up-to-date with the spec version that links use
PREVIOUS_SPECIFICATION_VERSION=v1.40.0
# Set this to the version number you want to CHANGE in URLs in the repository.
PREVIOUS_SPECIFICATION_VERSION="v1.39.0"
# Set this to the version number you want to KEEP in URLs in the repository.
LATEST_SPECIFICATION_VERSION="v1.40.0"
LATEST_SPECIFICATION_VERSION=$1
# The specific pattern we look for when replacing URLs
SPECIFICATION_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/tree/"
SPECIFICATION_BLOB_URL_PREFIX="https://github.com/open-telemetry/opentelemetry-specification/blob/"

View File

@ -0,0 +1,80 @@
name: Auto-update spec repo links
on:
schedule:
# hourly at minute 46
- cron: "46 * * * *"
workflow_dispatch:
jobs:
check-versions:
runs-on: ubuntu-latest
outputs:
current-version: ${{ steps.check-versions.outputs.current-version }}
latest-version: ${{ steps.check-versions.outputs.latest-version }}
already-opened: ${{ steps.check-versions.outputs.already-opened }}
steps:
- uses: actions/checkout@v4
- id: check-versions
name: Check versions
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
current_version=$(grep "PREVIOUS_SPECIFICATION_VERSION=v.*" \
internal/tools/update_specification_version.sh \
| sed "s/PREVIOUS_SPECIFICATION_VERSION=//")
latest_version=$(gh release view \
--repo open-telemetry/opentelemetry-specification \
--json tagName \
--jq .tagName)
matches=$(gh pr list \
--author opentelemetrybot \
--state open \
--search "in:title \"Update spec repo links to $latest_version\"")
if [ ! -z "$matches" ]
then
already_opened=true
fi
echo "current-version=$current_version" >> $GITHUB_OUTPUT
echo "latest-version=$latest_version" >> $GITHUB_OUTPUT
echo "already-opened=$already_opened" >> $GITHUB_OUTPUT
update-spec-repo-links:
runs-on: ubuntu-latest
if: |
needs.check-versions.outputs.current-version != needs.check-versions.outputs.latest-version &&
needs.check-versions.outputs.already-opened != 'true'
needs:
- check-versions
steps:
- uses: actions/checkout@v4
- name: Use CLA approved github bot
run: .github/scripts/use-cla-approved-github-bot.sh
- name: Update version
env:
VERSION: ${{ needs.check-versions.outputs.latest-version }}
run: |
.github/scripts/update-spec-repo-links.sh $VERSION
sed -i "s/^PREVIOUS_SPECIFICATION_VERSION=.*/PREVIOUS_SPECIFICATION_VERSION=$VERSION/" .github/scripts/update-spec-repo-links.sh
- name: Create pull request
env:
VERSION: ${{ needs.check-versions.outputs.latest-version }}
# not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GH_TOKEN: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }}
run: |
message="Update spec repo links to $VERSION"
body="Update spec repo links to \`$VERSION\`."
branch="opentelemetrybot/update-spec-repo-links-to-$VERSION"
git checkout -b $branch
git commit -a -m "$message"
git push --set-upstream origin $branch
gh pr create --title "$message" \
--body "$body" \
--label "Skip Changelog" \
--base main

View File

@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- name: Run prepare-new-issue.sh
run: ./.github/workflows/scripts/prepare-new-issue.sh
run: ./.github/scripts/prepare-new-issue.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE: ${{ github.event.issue.number }}

View File

@ -26,7 +26,7 @@ jobs:
# we're going to run prepare-new-pr script from the main branch
# to parse changelog record from the PR branch.
- name: Run prepare-new-pr.sh
run: ./.github/workflows/scripts/prepare-new-pr.sh
run: ./.github/scripts/prepare-new-pr.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}

View File

@ -21,7 +21,7 @@ jobs:
fi
- name: Use CLA approved github bot
run: .github/workflows/scripts/use-cla-approved-github-bot.sh
run: .github/scripts/use-cla-approved-github-bot.sh
- name: Update schema files
run: |

View File

@ -34,7 +34,6 @@ requirements and recommendations.
- [Misspell check](#misspell-check)
- [Update the tables of content](#update-the-tables-of-content)
- [Markdown link check](#markdown-link-check)
- [Updating the referenced specification version](#updating-the-referenced-specification-version)
- [Merging existing ECS conventions](#merging-existing-ecs-conventions)
<!-- tocstop -->
@ -406,14 +405,6 @@ To check the validity of links in all markdown files, run the following command:
make markdown-link-check
```
## Updating the referenced specification version
1. Open the `./internal/tools/update_specification_version.sh` script.
2. Modify the `PREVIOUS_SPECIFICATION_VERSION` to be the same value as `LATEST_SPECIFICATION_VERSION`
3. Modify `LATEST_SPECIFICATION_VERSION` to the latest specification tag, e.g. `1.21`
4. Run the script from the root directory, e.g. `semantic-conventions$ ./internal/tools/update_specification_version.sh`.
5. Add all modified files to the change submit and submit a PR.
## Merging existing ECS conventions
The Elastic Common Schema (ECS) is being merged into OpenTelemetry Semantic

View File

@ -4,9 +4,6 @@
- Close the [release milestone](https://github.com/open-telemetry/semantic-conventions/milestones)
if there is one.
- Ensure the referenced specification version is up to date. Use
[tooling to update the spec](./CONTRIBUTING.md#updating-the-referenced-specification-version)
if needed.
- Run [opentelemetry.io workflow](https://github.com/open-telemetry/opentelemetry.io/actions/workflows/build-dev.yml)
against `semantic-conventions` submodule as a smoke-test for docs. Fix broken links, if any.
- Run the [prepare release workflow](https://github.com/open-telemetry/semantic-conventions/actions/workflows/prepare-release.yml).