From 3f74b10cf3e956cc0ddc7a3580bdad84aa84e82c Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 1 Apr 2022 20:11:14 -0700 Subject: [PATCH 01/11] Workflow cleanup/sync --- .../{backport-pull-request.yml => backport.yml} | 2 +- .github/workflows/prepare-patch-release.yml | 2 +- .github/workflows/prepare-release-branch.yml | 7 +++---- .github/workflows/release.yml | 11 ++++++----- RELEASING.md | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) rename .github/workflows/{backport-pull-request.yml => backport.yml} (97%) diff --git a/.github/workflows/backport-pull-request.yml b/.github/workflows/backport.yml similarity index 97% rename from .github/workflows/backport-pull-request.yml rename to .github/workflows/backport.yml index 9712c28684c8..94b295b28681 100644 --- a/.github/workflows/backport-pull-request.yml +++ b/.github/workflows/backport.yml @@ -15,7 +15,7 @@ jobs: # history is needed in order to do cherry-pick fetch-depth: 0 - - name: Set up git name + - name: Set git user run: | git config user.name opentelemetry-java-bot git config user.email 97938252+opentelemetry-java-bot@users.noreply.github.com diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index 47381d10afb0..e3f11edd64c0 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -36,7 +36,7 @@ jobs: run: | sed -Ei "s,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$PRIOR_VERSION/,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$VERSION/," README.md - - name: Set up git name + - name: Set git user run: | git config user.name opentelemetry-java-bot git config user.email 97938252+opentelemetry-java-bot@users.noreply.github.com diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index db62dcd34a85..dd817672d6c5 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -21,8 +21,7 @@ jobs: env: RELEASE_BRANCH_NAME: ${{ steps.set-release-branch-name.outputs.release-branch-name }} run: | - git checkout -b $RELEASE_BRANCH_NAME - git push origin $RELEASE_BRANCH_NAME + git push origin HEAD:$RELEASE_BRANCH_NAME create-pull-request-against-release-branch: needs: prepare-release-branch @@ -42,7 +41,7 @@ jobs: new_version=$(grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts | head -1) sed -Ei "s,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$new_version/," README.md - - name: Set up git name + - name: Set git user run: | git config user.name opentelemetry-java-bot git config user.email 97938252+opentelemetry-java-bot@users.noreply.github.com @@ -81,7 +80,7 @@ jobs: next_version="$major.$((minor + 1)).0" .github/scripts/update-versions.sh "$version-SNAPSHOT" "$version-alpha-SNAPSHOT" "$next_version-SNAPSHOT" "$next_version-alpha-SNAPSHOT" - - name: Set up git name + - name: Set git user run: | git config user.name opentelemetry-java-bot git config user.email 97938252+opentelemetry-java-bot@users.noreply.github.com diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d00b6490928..2284e664973f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -170,7 +170,7 @@ jobs: run: | echo $VERSION > autoinstrumentation/java/version.txt - - name: Set up git name + - name: Set git user run: | git config user.name opentelemetry-java-bot git config user.email 97938252+opentelemetry-java-bot@users.noreply.github.com @@ -200,12 +200,13 @@ jobs: # history is needed in order to run git format-patch below fetch-depth: 0 - - name: Set up git name + - name: Set git user run: | git config user.name opentelemetry-java-bot git config user.email 97938252+opentelemetry-java-bot@users.noreply.github.com - # this step should be last since it will fail if conflicting change log updates on main + # this step should be last since it will fail if there have been conflicting + # change log updates introduced on the main branch - name: Create pull request to merge any change log updates to main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -215,9 +216,9 @@ jobs: git apply patch msg="Merge change log updates from $GITHUB_REF_NAME to main" git commit -a -m "$msg" - git push origin HEAD:opentelemetry-java-bot/merge-change-log-updates + git push origin HEAD:merge-change-log-updates-to-main gh pr create --title "$msg" \ --body "$msg" \ - --head opentelemetry-java-bot/merge-change-log-updates \ + --head merge-change-log-updates-to-main \ --base main fi diff --git a/RELEASING.md b/RELEASING.md index a1a1f59134eb..539ba2e4a7c4 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -25,7 +25,7 @@ All patch releases should include only bug-fixes, and must avoid adding/modifyin In general, patch releases are only made for regressions, memory leaks and deadlocks. * Backport pull request(s) to the release branch - * Run the [Backport pull request workflow](.github/workflows/backport-pull-request.yml). + * Run the [Backport workflow](.github/workflows/backport.yml). * Press the "Run workflow" button, then select the release branch from the dropdown list, e.g. `v1.9.x`, then enter the pull request number that you want to backport, then click the "Run workflow" button below that. From 6108b4f351b3d065982c05f1c0636a5fb51ff888 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 1 Apr 2022 20:13:21 -0700 Subject: [PATCH 02/11] more --- .github/workflows/backport.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 94b295b28681..8efe7254bbeb 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,4 +1,4 @@ -name: Backport a pull request +name: Backport on: workflow_dispatch: inputs: From 19b636c37885bbde185022c614895ecf596ef0ca Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 1 Apr 2022 20:28:05 -0700 Subject: [PATCH 03/11] more --- .github/workflows/release.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2284e664973f..1f75e19f29f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -108,12 +108,12 @@ jobs: This release targets the OpenTelemetry SDK $VERSION. Note that all artifacts other than \`io.opentelemetry.javaagent:opentelemetry-javaagent\` have the \`-alpha\` suffix attached to their version number, reflecting that they are still alpha quality and will continue to have breaking changes. Please see the [VERSIONING.md](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/VERSIONING.md#opentelemetry-java-instrumentation-versioning) for more details. - + EOF else cat > release-notes.txt << EOF This is a patch release on the previous $PRIOR_VERSION release, fixing the issue(s) below. - + EOF fi @@ -128,12 +128,12 @@ jobs: if [[ $version == *.0 ]]; then cat >> release-notes.txt << EOF - + ### 🙇 Thank you This release was possible thanks to the following contributors who shared their brilliant ideas and awesome pull requests: - + EOF - + .github/scripts/generate-release-contributors.sh v$PRIOR_VERSION v$VERSION >> release-notes.txt fi From 3e0c109b3d32425d919d196636ba5424202b8a13 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 1 Apr 2022 20:31:32 -0700 Subject: [PATCH 04/11] more --- .github/scripts/generate-release-contributors.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/generate-release-contributors.sh b/.github/scripts/generate-release-contributors.sh index 9e2094bf9c49..58cdf2f3396a 100755 --- a/.github/scripts/generate-release-contributors.sh +++ b/.github/scripts/generate-release-contributors.sh @@ -12,7 +12,7 @@ from=$(git log --reverse --pretty=format:"%cI" $from_version..HEAD | head -1) # get the last commit on main that was in the to_version to=$(git merge-base HEAD $to_version | xargs git log -1 --pretty=format:"%cI") -contributors1=$(gh api graphql --paginate -F q="repo:open-telemetry/opentelemetry-java-instrumentation is:pr base:main is:merged merged:$from..$to" -f query=' +contributors1=$(gh api graphql --paginate -F q="repo:$GITHUB_REPOSITORY is:pr base:main is:merged merged:$from..$to" -f query=' query($q: String!, $endCursor: String) { search(query: $q, type: ISSUE, first: 100, after: $endCursor) { edges { @@ -49,7 +49,7 @@ query($q: String!, $endCursor: String) { # this query captures authors of issues which have had PRs in the current range reference the issue # but not necessarily through closingIssuesReferences (e.g. addressing just a part of an issue) -contributors2=$(gh api graphql --paginate -F q="repo:open-telemetry/opentelemetry-java-instrumentation is:pr base:main is:merged merged:$from..$to" -f query=' +contributors2=$(gh api graphql --paginate -F q="repo:$GITHUB_REPOSITORY is:pr base:main is:merged merged:$from..$to" -f query=' query($q: String!, $endCursor: String) { search(query: $q, type: ISSUE, first: 100, after: $endCursor) { edges { From 238205a3960d93d0fb589941f9d8bf7860c90870 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Fri, 1 Apr 2022 20:38:07 -0700 Subject: [PATCH 05/11] fix --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1f75e19f29f3..332cc9579719 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -117,12 +117,12 @@ jobs: EOF fi - sed -n '/^## Version $VERSION/,/^## Version /p' CHANGELOG.md \ + sed -n "/^## Version $VERSION/,/^## Version /p" CHANGELOG.md \ | tail -n +2 \ | head -n -1 \ | perl -0pe 's/^\n+//g' \ | perl -0pe 's/\n+$/\n/g' \ - | sed -r 's,\[#([0-9]+)]\(https://github.com/$GITHUB_REPOSITORY/(pull|issues)/[0-9]+\),#\1,' \ + | sed -r "s,\[#([0-9]+)]\(https://github.com/$GITHUB_REPOSITORY/(pull|issues)/[0-9]+\),#\1," \ | perl -0pe 's/\n +/ /g' \ >> release-notes.txt From d027e7b7eb377dbc9b72d6aec1cfda6609591984 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sat, 2 Apr 2022 19:33:47 -0700 Subject: [PATCH 06/11] consistency --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 332cc9579719..cd92c63d63b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -193,6 +193,7 @@ jobs: gh pr create --title "$msg" \ --body "$msg" \ --repo open-telemetry/opentelemetry-operator + --base main - uses: actions/checkout@v3 with: From 4cbccd26c7340cca22985329d3288c9657acc22f Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sun, 3 Apr 2022 20:20:25 -0700 Subject: [PATCH 07/11] Use simpler sharing of env vars across steps --- .github/workflows/prepare-patch-release.yml | 14 +++----------- .github/workflows/prepare-release-branch.yml | 15 ++++++--------- .github/workflows/release.yml | 15 +++------------ 3 files changed, 12 insertions(+), 32 deletions(-) diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index e3f11edd64c0..f51b8afe906f 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -8,8 +8,7 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set versions - id: set-versions + - name: Set environment variables run: | prior_version=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts | head -1) if [[ $prior_version =~ ([0-9]+.[0-9]+).([0-9]+) ]]; then @@ -19,20 +18,14 @@ jobs: echo "unexpected version: $prior_version" exit 1 fi - echo "::set-output name=release-version::$major_minor.$((patch + 1))" - echo "::set-output name=prior-release-version::$prior_version" + echo "VERSION=$major_minor.$((patch + 1))" >> $GITHUB_ENV + echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV - name: Bump version - env: - VERSION: ${{ steps.set-versions.outputs.release-version }} - PRIOR_VERSION: ${{ steps.set-versions.outputs.prior-release-version }} run: | .github/scripts/update-versions.sh "$PRIOR_VERSION" "$PRIOR_VERSION-alpha" "$VERSION" "$VERSION-alpha" - name: Bump download link version - env: - VERSION: ${{ steps.set-versions.outputs.release-version }} - PRIOR_VERSION: ${{ steps.set-versions.outputs.prior-release-version }} run: | sed -Ei "s,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$PRIOR_VERSION/,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$VERSION/," README.md @@ -43,7 +36,6 @@ jobs: - name: Create pull request env: - VERSION: ${{ steps.set-versions.outputs.release-version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | msg="Prepare patch release $VERSION" diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index dd817672d6c5..9d8b3e96ba8d 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -6,22 +6,19 @@ jobs: prepare-release-branch: runs-on: ubuntu-latest outputs: - release-branch-name: ${{ steps.set-release-branch-name.outputs.release-branch-name }} + release-branch-name: ${{ steps.create-release-branch.outputs.release-branch-name }} steps: - uses: actions/checkout@v3 - - name: Set release branch name - id: set-release-branch-name + - name: Create release branch + id: create-release-branch run: | version=$(grep -Eo "[0-9.]+-SNAPSHOT" version.gradle.kts) release_branch_name=$(echo $version | sed -E 's/([0-9]+)\.([0-9]+)\.0/v\1.\2.x/') - echo "::set-output name=release-branch-name::$release_branch_name" - - name: Create release branch - env: - RELEASE_BRANCH_NAME: ${{ steps.set-release-branch-name.outputs.release-branch-name }} - run: | - git push origin HEAD:$RELEASE_BRANCH_NAME + git push origin HEAD:$release_branch_name + + echo "::set-output name=release-branch-name::$release_branch_name" create-pull-request-against-release-branch: needs: prepare-release-branch diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd92c63d63b3..efacd6d33814 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,8 +71,7 @@ jobs: arguments: build publishPlugins publishPluginMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository build-root-directory: gradle-plugins - - name: Set versions - id: set-versions + - name: Set environment variables run: | version=$(grep -Eo "[0-9]+.[0-9]+.[0-9]+" version.gradle.kts | head -1) if [[ $version =~ ([0-9]+).([0-9]+).([0-9]+) ]]; then @@ -94,13 +93,11 @@ jobs: else prior_version="$major.$minor.$((patch - 1))" fi - echo "::set-output name=release-version::$version" - echo "::set-output name=prior-release-version::$prior_version" + echo "VERSION=$version" >> $GITHUB_ENV + echo "PRIOR_VERSION=$prior_version" >> $GITHUB_ENV - name: Generate release notes env: - VERSION: ${{ steps.set-versions.outputs.release-version }} - PRIOR_VERSION: ${{ steps.set-versions.outputs.prior-release-version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [[ $version == *.0 ]]; then @@ -139,7 +136,6 @@ jobs: - name: Create GitHub release env: - VERSION: ${{ steps.set-versions.outputs.release-version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cp javaagent/build/libs/opentelemetry-javaagent-$VERSION.jar opentelemetry-javaagent.jar @@ -157,16 +153,12 @@ jobs: token: ${{ secrets.OPENTELEMETRY_JAVA_BOT_TOKEN }} - name: Initialize pull request branch - env: - VERSION: ${{ steps.set-versions.outputs.release-version }} 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: Bump version - env: - VERSION: ${{ steps.set-versions.outputs.release-version }} run: | echo $VERSION > autoinstrumentation/java/version.txt @@ -177,7 +169,6 @@ jobs: - name: Create pull request against opentelemetry-operator env: - VERSION: ${{ steps.set-versions.outputs.release-version }} # this is the PAT used for "gh pr create" below GITHUB_TOKEN: ${{ secrets.OPENTELEMETRY_JAVA_BOT_TOKEN }} run: | From eabee99815a5506004205140951a01a167700f01 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sun, 3 Apr 2022 20:44:56 -0700 Subject: [PATCH 08/11] Simplify, merge related jobs --- .github/workflows/prepare-release-branch.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index 9d8b3e96ba8d..ccd36afd00ef 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -3,10 +3,8 @@ on: workflow_dispatch: jobs: - prepare-release-branch: + create-pull-request-against-release-branch: runs-on: ubuntu-latest - outputs: - release-branch-name: ${{ steps.create-release-branch.outputs.release-branch-name }} steps: - uses: actions/checkout@v3 @@ -20,15 +18,11 @@ jobs: echo "::set-output name=release-branch-name::$release_branch_name" - create-pull-request-against-release-branch: - needs: prepare-release-branch - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 with: - ref: ${{ needs.prepare-release-branch.outputs.release-branch-name }} + ref: ${{ steps.create-release-branch.outputs.release-branch-name }} - - name: Bump version on release branch + - name: Bump version run: | version=$(grep -Eo "[0-9]+.[0-9]+.0-SNAPSHOT" version.gradle.kts | sed 's/-SNAPSHOT//') .github/scripts/update-versions.sh "$version-SNAPSHOT" "$version-alpha-SNAPSHOT" "$version" "$version-alpha" @@ -45,7 +39,7 @@ jobs: - name: Create pull request against release branch env: - RELEASE_BRANCH_NAME: ${{ needs.prepare-release-branch.outputs.release-branch-name }} + RELEASE_BRANCH_NAME: ${{ steps.create-release-branch.outputs.release-branch-name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | msg="Prepare release branch $RELEASE_BRANCH_NAME" @@ -57,9 +51,6 @@ jobs: --base $RELEASE_BRANCH_NAME create-pull-request-against-main: - needs: - - prepare-release-branch - - create-pull-request-against-release-branch runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 21b9c3400b79662d450decd73e90fb79656623cc Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sun, 3 Apr 2022 20:49:18 -0700 Subject: [PATCH 09/11] Simplify --- .github/workflows/prepare-release-branch.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index ccd36afd00ef..306bcd43b804 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -16,11 +16,7 @@ jobs: git push origin HEAD:$release_branch_name - echo "::set-output name=release-branch-name::$release_branch_name" - - - uses: actions/checkout@v3 - with: - ref: ${{ steps.create-release-branch.outputs.release-branch-name }} + echo "RELEASE_BRANCH_NAME=$release_branch_name" >> $GITHUB_ENV - name: Bump version run: | @@ -39,7 +35,6 @@ jobs: - name: Create pull request against release branch env: - RELEASE_BRANCH_NAME: ${{ steps.create-release-branch.outputs.release-branch-name }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | msg="Prepare release branch $RELEASE_BRANCH_NAME" From e387969d60db4a22062efb01ecd8254d96fc052a Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sun, 3 Apr 2022 21:05:13 -0700 Subject: [PATCH 10/11] More improvements --- .github/workflows/prepare-patch-release.yml | 8 ++++---- .github/workflows/prepare-release-branch.yml | 17 ++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/prepare-patch-release.yml b/.github/workflows/prepare-patch-release.yml index f51b8afe906f..974163868909 100644 --- a/.github/workflows/prepare-patch-release.yml +++ b/.github/workflows/prepare-patch-release.yml @@ -38,10 +38,10 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - msg="Prepare patch release $VERSION" + msg="Prepare release $VERSION" git commit -a -m "$msg" - git push origin HEAD:prepare-patch-release-$VERSION - gh pr create --title "$msg" \ + git push origin HEAD:prepare-release-$VERSION + gh pr create --title "[$GITHUB_REF_NAME] $msg" \ --body "$msg" \ - --head prepare-patch-release-$VERSION \ + --head prepare-release-$VERSION \ --base $GITHUB_REF_NAME diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index 306bcd43b804..edb9f512bc9a 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -11,22 +11,21 @@ jobs: - name: Create release branch id: create-release-branch run: | - version=$(grep -Eo "[0-9.]+-SNAPSHOT" version.gradle.kts) + version=$(grep -Eo "[0-9]+.[0-9]+.0-SNAPSHOT" version.gradle.kts | sed 's/-SNAPSHOT//') release_branch_name=$(echo $version | sed -E 's/([0-9]+)\.([0-9]+)\.0/v\1.\2.x/') git push origin HEAD:$release_branch_name + echo "VERSION=$version" >> $GITHUB_ENV echo "RELEASE_BRANCH_NAME=$release_branch_name" >> $GITHUB_ENV - name: Bump version run: | - version=$(grep -Eo "[0-9]+.[0-9]+.0-SNAPSHOT" version.gradle.kts | sed 's/-SNAPSHOT//') - .github/scripts/update-versions.sh "$version-SNAPSHOT" "$version-alpha-SNAPSHOT" "$version" "$version-alpha" + .github/scripts/update-versions.sh "$VERSION-SNAPSHOT" "$VERSION-alpha-SNAPSHOT" "$VERSION" "$VERSION-alpha" - name: Bump download link version run: | - new_version=$(grep -Eo "[0-9]+.[0-9]+.0" version.gradle.kts | head -1) - sed -Ei "s,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$new_version/," README.md + sed -Ei "s,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/latest/download/,https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$VERSION/," README.md - name: Set git user run: | @@ -37,12 +36,12 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - msg="Prepare release branch $RELEASE_BRANCH_NAME" + msg="Prepare release $VERSION" git commit -a -m "$msg" - git push origin HEAD:prepare-release-branch-$RELEASE_BRANCH_NAME - gh pr create --title "$msg" \ + git push origin HEAD:prepare-release-$VERSION + gh pr create --title "[$RELEASE_BRANCH_NAME] $msg" \ --body "$msg" \ - --head prepare-release-branch-$RELEASE_BRANCH_NAME \ + --head prepare-release-$VERSION \ --base $RELEASE_BRANCH_NAME create-pull-request-against-main: From 50af0c8b9797280f22736ce79d14fcf310f787e1 Mon Sep 17 00:00:00 2001 From: Trask Stalnaker Date: Sun, 3 Apr 2022 21:22:47 -0700 Subject: [PATCH 11/11] Use release/* release branch naming --- .github/workflows/build.yml | 2 +- .github/workflows/prepare-release-branch.yml | 2 +- RELEASING.md | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e7ec66f3f5c..6a50c5130f87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - v[0-9]+.[0-9]+.x + - release/* workflow_dispatch: jobs: diff --git a/.github/workflows/prepare-release-branch.yml b/.github/workflows/prepare-release-branch.yml index edb9f512bc9a..dcb2311e9d12 100644 --- a/.github/workflows/prepare-release-branch.yml +++ b/.github/workflows/prepare-release-branch.yml @@ -12,7 +12,7 @@ jobs: id: create-release-branch run: | version=$(grep -Eo "[0-9]+.[0-9]+.0-SNAPSHOT" version.gradle.kts | sed 's/-SNAPSHOT//') - release_branch_name=$(echo $version | sed -E 's/([0-9]+)\.([0-9]+)\.0/v\1.\2.x/') + release_branch_name=$(echo $version | sed -E 's,([0-9]+)\.([0-9]+)\.0,release/v\1.\2.x,') git push origin HEAD:$release_branch_name diff --git a/RELEASING.md b/RELEASING.md index 539ba2e4a7c4..6bbb8cd3433a 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -27,13 +27,13 @@ In general, patch releases are only made for regressions, memory leaks and deadl * Backport pull request(s) to the release branch * Run the [Backport workflow](.github/workflows/backport.yml). * Press the "Run workflow" button, then select the release branch from the dropdown list, - e.g. `v1.9.x`, then enter the pull request number that you want to backport, + e.g. `release/v1.9.x`, then enter the pull request number that you want to backport, then click the "Run workflow" button below that. * Review and merge the backport pull request that it generates * Merge a pull request to the release branch updating the `CHANGELOG.md` * Run the [Prepare patch release workflow](.github/workflows/prepare-patch-release.yml). * Press the "Run workflow" button, then select the release branch from the dropdown list, - e.g. `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 ## Making the release @@ -41,7 +41,7 @@ In general, patch releases are only made for regressions, memory leaks and deadl Run the [Release workflow](.github/workflows/release.yml). * Press the "Run workflow" button, then select the release branch from the dropdown list, - e.g. `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 with release notes based on the change log and with the javaagent jar attached. * Lastly, if there were any change log updates in the release branch that need to be merged back to