Skip to content

Commit

Permalink
Automate generation of release PRs (#2736)
Browse files Browse the repository at this point in the history
* Add file_release_pr.sh and update README

* fixup

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
  • Loading branch information
chloeandmargaret and alamb committed Oct 3, 2022
1 parent 76da624 commit 35c313b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 4 deletions.
19 changes: 15 additions & 4 deletions dev/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ For `object_store` the same process is done in the `object_store` directory. Exa
```bash
git checkout master
git pull
git checkout -b make-release
git checkout -b <RELEASE_BRANCH>

# Update versions. Make sure to run it before the next step since we do not want CHANGELOG-old.md affected.
sed -i '' -e 's/14.0.0/24.0.0/g' `find . -name 'Cargo.toml' -or -name '*.md' | grep -v CHANGELOG.md`
git commit -a -m 'Update version'

# Copy the content of CHANGELOG.md to the beginning of CHANGELOG-old.md

Expand All @@ -87,9 +91,16 @@ python dev/release/label_issues.py
git commit -a -m 'Create changelog'


# update versions
sed -i '' -e 's/14.0.0/24.0.0/g' `find . -name 'Cargo.toml' -or -name '*.md' | grep -v CHANGELOG.md`
git commit -a -m 'Update version'
# Manully edit ./dev/release/update_change_log.sh to reflect the release version
# Create the changelog
CHANGELOG_GITHUB_TOKEN=<TOKEN> ./dev/release/update_change_log.sh
# Review change log / edit issues and labels if needed, rerun
git commit -a -m 'Create changelog'

git push

# File the release PR
export BRANCH=<RELEASE_BRANCH> && export GITHUB_USERNAME=<USERNAME> && export GITHUB_TOKEN=<TOKEN> && ./file_release_pr.sh
```

Note that when reviewing the change log, rather than editing the
Expand Down
40 changes: 40 additions & 0 deletions dev/release/file_release_pr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# generates a standard release PR like this:
# https://github.com/apache/arrow-rs/pull/2734
#
# Usage:
# export BRANCH=<RELEASE_BRANCH> && export GITHUB_USERNAME=<USERNAME> && export GITHUB_TOKEN=<TOKEN> && ./file_release_pr.sh

set -e

FUTURE_RELEASE="23.0.0"
ISSUE_NUMBER=2665

TITLE="Update version to \`$FUTURE_RELEASE\` and update \`CHANGELOG\`"
BODY="# Which issue does this PR close?\n\nCloses #$ISSUE_NUMBER.\n\n# Rationale for this change\nPrepare for biweekly release\n\n# What changes are included in this PR?\n\n# Are there any user-facing changes?\nYes"
DATA="{\"title\":\"$TITLE\", \"body\":\"$BODY\", \"head\":\"$GITHUB_USERNAME:$BRANCH\",\"base\":\"master\"}"

# Create the pull request
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/apache/arrow-rs/pulls \
-d "$DATA"

0 comments on commit 35c313b

Please sign in to comment.