Release workflow simplifications (#356)

* Release workflow simplifications

* doc

* Sync

* Remove prerelease support

* More

* Sync

* Fix
This commit is contained in:
Trask Stalnaker 2022-06-17 15:14:36 -07:00 committed by GitHub
parent e999efdf18
commit d5650937ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 269 additions and 172 deletions

View File

@ -23,6 +23,9 @@ else
range="v$major.$((minor - 1)).0..HEAD" range="v$major.$((minor - 1)).0..HEAD"
fi fi
echo "## Unreleased"
echo
declare -A component_names=() declare -A component_names=()
component_names["aws-xray/"]="AWS X-Ray" component_names["aws-xray/"]="AWS X-Ray"
component_names["consistent-sampling/"]="Consistent sampling" component_names["consistent-sampling/"]="Consistent sampling"

View File

@ -5,6 +5,11 @@
# this should be run on the release branch # this should be run on the release branch
# NOTE if you need to run this script locally, you will need to first:
# git fetch upstream main
# git push origin upstream/main:main
# export GITHUB_REPOSITORY=open-telemetry/opentelemetry-java-contrib
from_version=$1 from_version=$1
# get the date of the first commit that was not in the from_version # get the date of the first commit that was not in the from_version
@ -80,4 +85,5 @@ echo $contributors1 $contributors2 \
| grep -v linux-foundation-easycla \ | grep -v linux-foundation-easycla \
| grep -v github-actions \ | grep -v github-actions \
| grep -v dependabot \ | grep -v dependabot \
| grep -v opentelemetry-java-bot \
| sed 's/^/@/' | sed 's/^/@/'

View File

@ -10,6 +10,12 @@ jobs:
backport: backport:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- run: |
if [[ ! $GITHUB_REF_NAME =~ ^release/v[0-9]+\.[0-9]+\.x$ ]]; then
echo this workflow should only be run against release branches
exit 1
fi
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
# history is needed to run git cherry-pick below # history is needed to run git cherry-pick below
@ -21,12 +27,11 @@ jobs:
- name: Create pull request - name: Create pull request
env: env:
NUMBER: ${{ github.event.inputs.number }} NUMBER: ${{ github.event.inputs.number }}
# not using the default GITHUB_TOKEN because pull requests generated by it do not run any workflows # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: | run: |
commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid) commit=$(gh pr view $NUMBER --json mergeCommit --jq .mergeCommit.oid)
title=$(gh pr view $NUMBER --json title --jq .title) title=$(gh pr view $NUMBER --json title --jq .title)
url=$(gh pr view $NUMBER --json url --jq .url)
branch="backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}" branch="backport-${NUMBER}-to-${GITHUB_REF_NAME//\//-}"

View File

@ -1,38 +0,0 @@
name: Merge change log to main
on:
workflow_dispatch:
jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# this workflow is run against the release branch (see usage of GITHUB_REF_NAME below)
# but it is creating a pull request against main
ref: main
# history is needed to run format-patch below
fetch-depth: 0
- name: Set git user
run: .github/scripts/set-git-user.sh
# this will fail if there have been conflicting change log updates introduced in main
- name: Create pull request against main
env:
# not using the default GITHUB_TOKEN because pull requests generated by it do not run any workflows
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
message="Merge change log updates from $GITHUB_REF_NAME"
body="Merge change log updates from \`$GITHUB_REF_NAME\`."
branch="merge-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
# perform a 3-way merge of a single file
git format-patch --stdout HEAD..origin/$GITHUB_REF_NAME CHANGELOG.md | git apply --3way
git commit -a -m "$message"
git push origin HEAD:$branch
gh pr create --title "$message" \
--body "$body" \
--head $branch \
--base main

View File

@ -8,10 +8,21 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: |
if [[ ! $GITHUB_REF_NAME =~ ^release/v[0-9]+\.[0-9]+\.x$ ]]; then
echo this workflow should only be run against release branches
exit 1
fi
if ! grep --quiet "^## Unreleased$" CHANGELOG.md; then
echo the change log is missing an \"Unreleased\" section
exit 1
fi
- name: Set environment variables - name: Set environment variables
run: | run: |
version=$(.github/scripts/get-version.sh) version=$(.github/scripts/get-version.sh)
if [[ $version =~ ([0-9]+\.[0-9]+)\.([0-9]+) ]]; then if [[ $version =~ ^([0-9]+\.[0-9]+)\.([0-9]+)$ ]]; then
major_minor="${BASH_REMATCH[1]}" major_minor="${BASH_REMATCH[1]}"
patch="${BASH_REMATCH[2]}" patch="${BASH_REMATCH[2]}"
else else
@ -20,22 +31,20 @@ jobs:
fi fi
echo "VERSION=$major_minor.$((patch + 1))" >> $GITHUB_ENV echo "VERSION=$major_minor.$((patch + 1))" >> $GITHUB_ENV
- name: Check change log has been updated
run: |
if ! grep --quiet "^## Version $VERSION" CHANGELOG.md; then
echo the change log needs to be updated
exit 1
fi
- name: Update version - name: Update version
run: .github/scripts/update-version.sh $VERSION run: .github/scripts/update-version.sh $VERSION
- name: Update the change log with the approximate release date
run: |
date=$(date "+%Y-%m-%d")
sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md
- name: Set git user - name: Set git user
run: .github/scripts/set-git-user.sh run: .github/scripts/set-git-user.sh
- name: Create pull request - name: Create pull request
env: env:
# not using the default GITHUB_TOKEN because pull requests generated by it do not run any workflows # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: | run: |
message="Prepare release $VERSION" message="Prepare release $VERSION"

View File

@ -9,10 +9,13 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- run: | - run: |
version=$(.github/scripts/get-version.sh) if [[ $GITHUB_REF_NAME != main ]]; then
version=${version//-SNAPSHOT/} echo this workflow should only be run against main
if ! grep --quiet "^## Version $version" CHANGELOG.md; then exit 1
echo the change log needs to be updated fi
if ! grep --quiet "^## Unreleased$" CHANGELOG.md; then
echo the change log is missing an \"Unreleased\" section
exit 1 exit 1
fi fi
@ -23,11 +26,15 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Create release branch - name: Create release branch
id: create-release-branch
run: | run: |
version=$(.github/scripts/get-version.sh) version=$(.github/scripts/get-version.sh)
version=${version//-SNAPSHOT/} version=${version//-SNAPSHOT/}
release_branch_name=$(echo $version | sed -E 's/([0-9]+)\.([0-9]+)\.0/release\/v\1.\2.x/') if [[ $version =~ ^([0-9]+)\.([0-9]+)\.0$ ]]; then
release_branch_name=$(echo $version | sed -E 's/([0-9]+)\.([0-9]+)\.0/release\/v\1.\2.x/')
else
echo "unexpected version: $version"
exit 1
fi
git push origin HEAD:$release_branch_name git push origin HEAD:$release_branch_name
@ -37,12 +44,17 @@ jobs:
- name: Update version - name: Update version
run: .github/scripts/update-version.sh $VERSION run: .github/scripts/update-version.sh $VERSION
- name: Update the change log with the approximate release date
run: |
date=$(date "+%Y-%m-%d")
sed -Ei "s/^## Unreleased$/## Version $VERSION ($date)/" CHANGELOG.md
- name: Set git user - name: Set git user
run: .github/scripts/set-git-user.sh run: .github/scripts/set-git-user.sh
- name: Create pull request against the release branch - name: Create pull request against the release branch
env: env:
# not using the default GITHUB_TOKEN because pull requests generated by it do not run any workflows # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: | run: |
message="Prepare release $VERSION" message="Prepare release $VERSION"
@ -64,26 +76,33 @@ jobs:
- name: Set environment variables - name: Set environment variables
run: | run: |
version=$(.github/scripts/get-version.sh) version=$(.github/scripts/get-version.sh)
if [[ $version =~ ([0-9]+)\.([0-9]+)\.0 ]]; then version=${version//-SNAPSHOT/}
if [[ $version =~ ^([0-9]+)\.([0-9]+)\.0$ ]]; then
major="${BASH_REMATCH[1]}" major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}" minor="${BASH_REMATCH[2]}"
next_version="$major.$((minor + 1)).0"
else else
echo "unexpected version: $version" echo "unexpected version: $version"
exit 1 exit 1
fi fi
next_version="$major.$((minor + 1)).0" echo "NEXT_VERSION=${next_version}-SNAPSHOT" >> $GITHUB_ENV
next_version="${next_version}-SNAPSHOT" echo "VERSION=$version" >> $GITHUB_ENV
echo "NEXT_VERSION=$next_version" >> $GITHUB_ENV
- name: Update version - name: Update version
run: .github/scripts/update-version.sh $NEXT_VERSION run: .github/scripts/update-version.sh $NEXT_VERSION
- name: Update the change log on main
run: |
# the actual release date on main will be updated at the end of the release workflow
date=$(date "+%Y-%m-%d")
sed -Ei "s/^## Unreleased$/## Unreleased\n\n## Version $VERSION ($date)/" CHANGELOG.md
- name: Set git user - name: Set git user
run: .github/scripts/set-git-user.sh run: .github/scripts/set-git-user.sh
- name: Create pull request against main - name: Create pull request against main
env: env:
# not using the default GITHUB_TOKEN because pull requests generated by it do not run any workflows # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: | run: |
message="Update version to $NEXT_VERSION" message="Update version to $NEXT_VERSION"

View File

@ -3,64 +3,88 @@ on:
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: assemble:
runs-on: ubuntu-latest uses: ./.github/workflows/reusable-assemble.yml
steps:
- uses: actions/checkout@v3
- name: Set up JDK for running Gradle test:
uses: actions/setup-java@v3 uses: ./.github/workflows/reusable-test.yml
with:
distribution: temurin
java-version: 17
- uses: gradle/gradle-build-action@v2 # test-latest-deps is intentionally not included in the release workflows
name: Build # because any time a new library version is released to maven central
with: # it can fail due to test code incompatibility with the new library version,
arguments: build # or due to slight changes in emitted telemetry
- uses: actions/upload-artifact@v3 smoke-test:
name: Save unit test results uses: ./.github/workflows/reusable-smoke-test.yml
if: always()
with:
name: test-results
path: jmx-metrics/build/reports/tests/test
integration-test: # muzzle is intentionally not included in the release workflows
runs-on: ubuntu-latest # because any time a new library version is released to maven central it can fail,
steps: # and this is not a reason to hold up the release
- uses: actions/checkout@v3
- name: Set up JDK for running Gradle gradle-plugins:
uses: actions/setup-java@v3 uses: ./.github/workflows/reusable-gradle-plugins.yml
with:
distribution: temurin
java-version: 17
- uses: gradle/gradle-build-action@v2 examples:
name: Integration test uses: ./.github/workflows/reusable-examples.yml
with:
arguments: integrationTest
- uses: actions/upload-artifact@v3
name: Save integration test results
if: always()
with:
name: integration-test-results
path: jmx-metrics/build/reports/tests/integrationTest
release: release:
runs-on: ubuntu-latest
needs: needs:
- build - assemble
- integration-test - test
- smoke-test
- gradle-plugins
- examples
runs-on: ubuntu-latest
steps: steps:
- run: | - run: |
if [[ $GITHUB_REF_NAME != release/* ]]; then if [[ $GITHUB_REF_NAME != release/* ]]; then
echo the release workflow should only be run against release branches echo this workflow should only be run against release branches
exit 1 exit 1
fi fi
- uses: actions/checkout@v3
- name: Set environment variables
run: |
version=$(.github/scripts/get-version.sh)
if [[ $version =~ ^([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then
major="${BASH_REMATCH[1]}"
minor="${BASH_REMATCH[2]}"
patch="${BASH_REMATCH[3]}"
else
echo "unexpected version: $version"
exit 1
fi
if [[ $patch == 0 ]]; then
if [[ $minor == 0 ]]; then
prior_major=$((major - 1))
prior_minor=$(grep -Po "^## Version $prior_major.\K[0-9]+" CHANGELOG.md | head -1)
prior_version="$prior_major.$prior_minor"
else
prior_version="$major.$((minor - 1)).0"
fi
else
prior_version="$major.$minor.$((patch - 1))"
fi
echo "VERSION=$version" >> $GITHUB_ENV
echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV
# check out main branch to verify there won't be problems with merging the change log
# at the end of this workflow
- uses: actions/checkout@v3
with:
ref: main
- run: |
if [[ $VERSION == *.0 ]]; then
# not making a patch release
if ! grep --quiet "^## Version $VERSION " CHANGELOG.md; then
echo the pull request generated by prepare-release-branch.yml needs to be merged first
exit 1
fi
fi
# back to the release branch
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
# tags are needed for the generate-release-contributors.sh script # tags are needed for the generate-release-contributors.sh script
@ -82,30 +106,19 @@ jobs:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
- name: Set environment variables - name: Build and publish gradle plugins
run: | uses: gradle/gradle-build-action@v2
version=$(.github/scripts/get-version.sh) env:
if [[ $version =~ ([0-9]+)\.([0-9]+)\.([0-9]+) ]]; then SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
major="${BASH_REMATCH[1]}" SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
minor="${BASH_REMATCH[2]}" GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
patch="${BASH_REMATCH[3]}" GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
else GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
echo "unexpected version: $version" GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
exit 1 with:
fi # Don't use publishToSonatype since we don't want to publish the marker artifact
if [[ $patch == 0 ]]; then arguments: build publishPlugins publishPluginMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
if [[ $minor == 0 ]]; then build-root-directory: gradle-plugins
prior_major=$((major - 1))
prior_minor=$(grep -Po "^## Version $prior_major.\K([0-9]+)" CHANGELOG.md | head -1)
prior_version="$prior_major.$prior_minor"
else
prior_version="$major.$((minor - 1)).0"
fi
else
prior_version="$major.$minor.$((patch - 1))"
fi
echo "VERSION=$version" >> $GITHUB_ENV
echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV
- name: Generate release notes - name: Generate release notes
env: env:
@ -124,17 +137,21 @@ jobs:
EOF EOF
fi fi
# CHANGELOG_SECTION.md is also used at the end of the release workflow
# for copying the change log updates to main
sed -n "0,/^## Version $VERSION /d;/^## Version /q;p" CHANGELOG.md \
> /tmp/CHANGELOG_SECTION.md
# the complex perl regex is needed because markdown docs render newlines as soft wraps # the complex perl regex is needed because markdown docs render newlines as soft wraps
# while release notes render them as line breaks # while release notes render them as line breaks
sed -n "0,/^## Version $VERSION/d;/^## Version /q;p" CHANGELOG.md \ perl -0pe 's/(?<!\n)\n *(?!\n)(?![-*] )(?![1-9]+\. )/ /g' /tmp/CHANGELOG_SECTION.md \
| perl -0pe 's/(?<!\n)\n *(?!\n)(?![-*] )(?![1-9]+\. )/ /g' \
>> /tmp/release-notes.txt >> /tmp/release-notes.txt
# conditional block not indented because of the heredoc # conditional block not indented because of the heredoc
if [[ $VERSION == *.0 ]]; then if [[ $VERSION == *.0 ]]; then
cat >> /tmp/release-notes.txt << EOF cat >> /tmp/release-notes.txt << EOF
### 🙇 Thank you ### 🙇 Thank you
This release was possible thanks to the following contributors who shared their brilliant ideas and awesome pull requests: This release was possible thanks to the following contributors who shared their brilliant ideas and awesome pull requests:
EOF EOF
@ -154,27 +171,117 @@ jobs:
v$VERSION \ v$VERSION \
opentelemetry-jmx-metrics.jar opentelemetry-jmx-metrics.jar
- name: Update the change log with the release date - uses: actions/checkout@v3
with:
# the step below is creating a pull request against main
ref: main
- name: Copy change log updates to main
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//') if [[ $VERSION == *.0 ]]; then
sed -Ei "s/## Version $VERSION .*/## Version $VERSION ($date)/" CHANGELOG.md # this was not a patch release, so the version exists already in the CHANGELOG.md
# update the release date
date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
sed -Ei "s/## Version $VERSION .*/## Version $VERSION ($date)/" CHANGELOG.md
# the entries are copied over from the release branch to support workflows
# where change log entries may be updated after preparing the release branch
# copy the portion above the release, up to and including the heading
sed -n "0,/^## Version $VERSION ($date)/p" CHANGELOG.md > /tmp/CHANGELOG.md
# copy the release notes
cat /tmp/CHANGELOG_SECTION.md >> /tmp/CHANGELOG.md
# copy the portion below the release
sed -n "0,/^## Version $VERSION /d;0,/^## Version /{/^## Version/!d};p" CHANGELOG.md \
>> /tmp/CHANGELOG.md
# update the real CHANGELOG.md
cp /tmp/CHANGELOG.md CHANGELOG.md
else
# this was a patch release, so the version does not exist already in the CHANGELOG.md
# copy the portion above the top-most release, not including the heading
sed -n "0,/^## Version /{ /^## Version /!p }" CHANGELOG.md > /tmp/CHANGELOG.md
# add the heading
date=$(gh release view v$VERSION --json publishedAt --jq .publishedAt | sed 's/T.*//')
echo "## Version $VERSION ($date)" >> /tmp/CHANGELOG.md
# copy the release notes
cat /tmp/CHANGELOG_SECTION.md >> /tmp/CHANGELOG.md
# copy the portion starting from the top-most release
sed -n "/^## Version /,\$p" CHANGELOG.md >> /tmp/CHANGELOG.md
# update the real CHANGELOG.md
cp /tmp/CHANGELOG.md CHANGELOG.md
fi
- name: Set git user - name: Set git user
run: .github/scripts/set-git-user.sh run: .github/scripts/set-git-user.sh
- name: Create pull request against the release branch - name: Create pull request against main
env: env:
# not using the default GITHUB_TOKEN because pull requests generated by it do not run any workflows # not using secrets.GITHUB_TOKEN since pull requests from that token do not run workflows
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: | run: |
message="Add the release date for $VERSION to the change log" message="Copy change log updates from $GITHUB_REF_NAME"
branch="add-release-date-for-${VERSION}" body="Copy log updates from \`$GITHUB_REF_NAME\`."
branch="copy-change-log-updates-from-${GITHUB_REF_NAME//\//-}"
if [[ $VERSION == *.0 ]]; then
if git diff --quiet; then
echo there are no updates needed to the change log on main, not creating pull request
exit 0 # success
fi
fi
git commit -a -m "$message" git commit -a -m "$message"
git push origin HEAD:$branch git push origin HEAD:$branch
gh pr create --title "[$GITHUB_REF_NAME] $message" \ gh pr create --title "$message" \
--body "$message." \ --body "$body" \
--head $branch \ --head $branch \
--base $GITHUB_REF_NAME --base main
- uses: actions/checkout@v3
with:
repository: opentelemetry-java-bot/opentelemetry-operator
# this is the personal access token used for "git push" below
token: ${{ secrets.BOT_TOKEN }}
- name: Initialize pull request branch
run: |
git remote add upstream https://github.com/open-telemetry/opentelemetry-operator.git
git fetch upstream
git checkout -b update-opentelemetry-javaagent-to-${VERSION} upstream/main
- name: Update version
run: |
echo $VERSION > autoinstrumentation/java/version.txt
- name: Set git user
run: .github/scripts/set-git-user.sh
- name: Create pull request against opentelemetry-operator
env:
# this is the personal access token used for "gh pr create" below
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
run: |
message="Update the javaagent version to $VERSION"
body="Update the javaagent version to \`$VERSION\`."
# gh pr create doesn't have a way to explicitly specify different head and base
# repositories currently, but it will implicitly pick up the head from a different
# repository if you set up a tracking branch
git commit -a -m "$message"
git push --set-upstream origin update-opentelemetry-javaagent-to-${VERSION}
gh pr create --title "$message" \
--body "$body" \
--repo open-telemetry/opentelemetry-operator \
--base main

View File

@ -14,19 +14,19 @@ as the last step, which publishes a snapshot build to
* Close the release milestone if there is one. * Close the release milestone if there is one.
* Merge a pull request to `main` updating the `CHANGELOG.md`. * Merge a pull request to `main` updating the `CHANGELOG.md`.
* The heading for the release should include the release version but not the release date, e.g. * The heading for the unreleased entries should be `## Unreleased`.
`## Version 1.9.0 (unreleased)`. * Use `.github/scripts/draft-change-log-entries.sh` as a starting point for writing the change log.
* Use `.github/scripts/draft-change-log-entries.sh` as a starting point for writing the change
log.
* Run the [Prepare release branch workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/prepare-release-branch.yml). * Run the [Prepare release branch workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/prepare-release-branch.yml).
* Review and merge the two pull requests that it creates * Press the "Run workflow" button, and leave the default branch `main` selected.
(one is targeted to the release branch and one is targeted to the `main` branch). * Review and merge the two pull requests that it creates
(one is targeted to the release branch and one is targeted to `main`).
## Preparing a new patch release ## Preparing a new patch release
All patch releases should include only bug-fixes, and must avoid adding/modifying the public APIs. All patch releases should include only bug-fixes, and must avoid adding/modifying the public APIs.
In general, patch releases are only made for regressions, memory leaks and deadlocks. In general, patch releases are only made for regressions, security vulnerabilities, memory leaks
and deadlocks.
* Backport pull request(s) to the release branch. * Backport pull request(s) to the release branch.
* Run the [Backport workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/backport.yml). * Run the [Backport workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/backport.yml).
@ -35,33 +35,19 @@ In general, patch releases are only made for regressions, memory leaks and deadl
then click the "Run workflow" button below that. then click the "Run workflow" button below that.
* Review and merge the backport pull request that it generates. * Review and merge the backport pull request that it generates.
* Merge a pull request to the release branch updating the `CHANGELOG.md`. * Merge a pull request to the release branch updating the `CHANGELOG.md`.
* The heading for the release should include the release version but not the release date, e.g. * The heading for the unreleased entries should be `## Unreleased`.
`## Version 1.9.1 (unreleased)`.
* Run the [Prepare patch release workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/prepare-patch-release.yml). * Run the [Prepare patch release workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/prepare-patch-release.yml).
* Press the "Run workflow" button, then select the release branch from the dropdown list, * Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g. `release/v1.9.x`, and click the "Run workflow" button below that. e.g. `release/v1.9.x`, and click the "Run workflow" button below that.
* Review and merge the pull request that it creates. * Review and merge the pull request that it creates for updating the version.
## Making the release ## Making the release
Run the [Release workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/release.yml). * Run the [Release workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/release.yml).
* Press the "Run workflow" button, then select the release branch from the dropdown list,
* Press the "Run workflow" button, then select the release branch from the dropdown list, e.g. `release/v1.9.x`, and click the "Run workflow" button below that.
e.g. `release/v1.9.x`, and click the "Run workflow" button below that. * This workflow will publish the artifacts to maven central and will publish a GitHub release
* This workflow will publish the artifacts to maven central and will publish a GitHub release with release notes based on the change log and with the jmx metrics jar attached.
with release notes based on the change log and with the jmx metrics jar attached. * Review and merge the pull request that it creates for updating the change log in main
* Review and merge the pull request that the release workflow creates against the release branch (note that if this is not a patch release then the change log on main may already be up-to-date,
which adds the release date to the change log. in which case no pull request will be created).
## After the release
Run the [Merge change log to main workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/merge-change-log-to-main.yml).
* Press the "Run workflow" button, then select the release branch from the dropdown list,
e.g. `release/v1.9.x`, and click the "Run workflow" button below that.
* This will create a pull request that merges the change log updates from the release branch
back to main.
* Review and merge the pull request that it creates.
* This workflow will fail if there have been conflicting change log updates introduced in main,
in which case you will need to merge the change log updates manually and send your own pull
request against main.