Trask Stalnaker 2 yıl önce
ebeveyn
işleme
d949a82d06

+ 6 - 5
.github/scripts/generate-release-contributors.sh

@@ -3,14 +3,15 @@
 # shellcheck disable=SC2016
 # shellcheck disable=SC2086
 
+# this should be run on the release branch
+
 from_version=$1
-to_version=$2
 
-# get the date of the first commit on main that wasn't in the from_version
+# get the date of the first commit that was not in the from_version
 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")
+# get the last commit on main that was included in the release
+to=$(git merge-base origin/main HEAD | xargs git log -1 --pretty=format:"%cI")
 
 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) {
@@ -66,7 +67,7 @@ query($q: String!, $endCursor: String) {
   }
 }
 ' --jq '.data.search.edges.[].node.body' \
-  | grep -oE "#[0-9]{4,}|issues/[0-9]{4,}" \
+  | grep -oE "#[0-9]{4,}|$GITHUB_REPOSITORY/issues/[0-9]{4,}" \
   | grep -oE "[0-9]{4,}" \
   | xargs -I{} gh issue view {} --json 'author,url' --jq '[.author.login,.url]' \
   | grep -v '/pull/' \

+ 3 - 3
.github/workflows/prepare-release-branch.yml

@@ -81,9 +81,9 @@ jobs:
         env:
           GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
         run: |
-          message="Update version to $NEXT_VERSION"
-          body="Update version to \`$NEXT_VERSION\`."
-          branch=update-version-to-$NEXT_VERSION
+          message="Update version to $NEXT_VERSION-SNAPSHOT"
+          body="Update version to \`$NEXT_VERSION-SNAPSHOT\`."
+          branch=update-version-to-$NEXT_VERSION-snapshot
 
           git commit -a -m "$message"
           git push origin HEAD:$branch

+ 4 - 2
.github/workflows/release.yml

@@ -115,13 +115,15 @@ jobs:
           EOF
           fi
 
+          # the last complex regex is needed because markdown docs render newlines as soft wraps
+          # while release notes render them as line breaks
           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," \
-            | perl -0pe 's/\n +/ /g' \
+            | perl -0pe 's/(?<!\n)\n *(?!\n)(?![-*] )(?![1-9]+\. )/ /g' \
             >> release-notes.txt
 
           # conditional block not indented because of the heredoc
@@ -133,7 +135,7 @@ jobs:
 
           EOF
 
-          .github/scripts/generate-release-contributors.sh v$PRIOR_VERSION $GITHUB_REF_NAME >> release-notes.txt
+          .github/scripts/generate-release-contributors.sh v$PRIOR_VERSION >> release-notes.txt
           fi
 
       - name: Create GitHub release

+ 1 - 1
RELEASING.md

@@ -37,7 +37,7 @@ and deadlocks.
   * Review and merge the backport pull request that it generates.
 * 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.
-    `## Version 1.9.0 (unreleased)`.
+    `## Version 1.9.1 (unreleased)`.
 * Run the [Prepare patch release workflow](https://github.com/open-telemetry/opentelemetry-java-instrumentation/actions/workflows/prepare-patch-release.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.