ibzib commented on a change in pull request #11918: URL: https://github.com/apache/beam/pull/11918#discussion_r435356754
########## File path: website/www/site/content/en/contribute/release-guide.md ########## @@ -1134,12 +1134,29 @@ Create and push a new signed tag for the released version by copying the tag for git tag -s "$VERSION_TAG" "$RC_TAG" git push upstream "$VERSION_TAG" -After the tag is uploaded, publish the release in the Github UI. -1. Navigate to `https://github.com/apache/beam/releases/tag/$VERSION_TAG`. -1. Click the "Edit tag" button. -1. Give the release a title, such as `Beam 2.21.0`. -1. For the release description, copy the current version's changes from `CHANGES.md`. (You may want to touch up the formatting a bit.) -1. Click the "Publish release" button. +After the tag is uploaded, publish the release by calling the Github API (Make sure that the `GITHUB_TOKEN` variable is set): + + json_escape () { + printf '%s' "$1" | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))' + } + + RELEASE_NOTES=$(sed -n '/^We are happy/,$p' website/www/site/content/en/blog/beam-${RELEASE}.md) + ESCAPED_NOTES=$(json_escape ${RELEASE_NOTES}) + + RELEASE_JSON="$(cat <<-EOF + { + "tag_name": "${VERSION_TAG}", + "name": "Beam ${RELEASE} release", + "body": ${ESCAPED_NOTES} + } + EOF + )" + + curl https://api.github.com/repos/jphalip/beam/releases \ Review comment: ```suggestion curl https://api.github.com/repos/apache/beam/releases \ ``` ########## File path: website/www/site/content/en/contribute/release-guide.md ########## @@ -1134,12 +1134,29 @@ Create and push a new signed tag for the released version by copying the tag for git tag -s "$VERSION_TAG" "$RC_TAG" git push upstream "$VERSION_TAG" -After the tag is uploaded, publish the release in the Github UI. -1. Navigate to `https://github.com/apache/beam/releases/tag/$VERSION_TAG`. -1. Click the "Edit tag" button. -1. Give the release a title, such as `Beam 2.21.0`. -1. For the release description, copy the current version's changes from `CHANGES.md`. (You may want to touch up the formatting a bit.) -1. Click the "Publish release" button. +After the tag is uploaded, publish the release by calling the Github API (Make sure that the `GITHUB_TOKEN` variable is set): + + json_escape () { + printf '%s' "$1" | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))' + } + + RELEASE_NOTES=$(sed -n '/^We are happy/,$p' website/www/site/content/en/blog/beam-${RELEASE}.md) Review comment: Maybe instead we could just remove the webpage header. (We could probably keep the license, since it's in a comment.) ########## File path: website/www/site/content/en/contribute/release-guide.md ########## @@ -1134,12 +1134,29 @@ Create and push a new signed tag for the released version by copying the tag for git tag -s "$VERSION_TAG" "$RC_TAG" git push upstream "$VERSION_TAG" -After the tag is uploaded, publish the release in the Github UI. -1. Navigate to `https://github.com/apache/beam/releases/tag/$VERSION_TAG`. -1. Click the "Edit tag" button. -1. Give the release a title, such as `Beam 2.21.0`. -1. For the release description, copy the current version's changes from `CHANGES.md`. (You may want to touch up the formatting a bit.) -1. Click the "Publish release" button. +After the tag is uploaded, publish the release by calling the Github API (Make sure that the `GITHUB_TOKEN` variable is set): + + json_escape () { + printf '%s' "$1" | python -c 'import json,sys; print(json.dumps(sys.stdin.read()))' + } + + RELEASE_NOTES=$(sed -n '/^We are happy/,$p' website/www/site/content/en/blog/beam-${RELEASE}.md) + ESCAPED_NOTES=$(json_escape ${RELEASE_NOTES}) + + RELEASE_JSON="$(cat <<-EOF + { + "tag_name": "${VERSION_TAG}", + "name": "Beam ${RELEASE} release", + "body": ${ESCAPED_NOTES} + } + EOF + )" + + curl https://api.github.com/repos/jphalip/beam/releases \ Review comment: Perhaps we should print the body and ask for user confirmation before uploading. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org