-
Notifications
You must be signed in to change notification settings - Fork 82
fix(release): fix svn add command and add script to generate release notes #249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1deb098
fix(release): fix svn add command
zeroshade 3419d0a
fix(release): add script to generate arrow-site release notes
zeroshade 742d0cc
run shfmt
zeroshade a8fdd84
Update dev/release/post-website.sh
zeroshade 15bdcc4
Update dev/release/post-website.sh
zeroshade 613548b
Update dev/release/post-website.sh
zeroshade 919928e
Update dev/release/post-website.sh
zeroshade e7d16ff
Update dev/release/post-website.sh
zeroshade 9bf3eb9
lint and update from comments
zeroshade 56f4cce
shfmt
zeroshade 32cf8da
adopting stuff from shellcheck
zeroshade fc5d23a
one more fix
zeroshade f1d1c62
finally linting passing
zeroshade File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| #!/usr/bin/env 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. | ||
|
|
||
| set -e | ||
| set -u | ||
|
|
||
| SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| ARROW_DIR="${SOURCE_DIR}/../../" | ||
| : ${ARROW_SITE_DIR:="${ARROW_DIR}/../arrow-site"} | ||
|
|
||
| if [ "$#" -ne 2 ]; then | ||
| echo "Usage: $0 <previous-version> <version>" | ||
| exit 1 | ||
| fi | ||
|
|
||
| previous_version=$1 | ||
| version=$2 | ||
|
|
||
| branch_name=release-note-arrow-go-${version} | ||
| release_dir="${ARROW_SITE_DIR}/_posts" | ||
| announce_file="${release_dir}/$(date +%Y-%m-%d)-arrow-go-${version}.md" | ||
|
|
||
| pushd "${ARROW_SITE_DIR}" | ||
| DEFAULT_BRANCH="$(git rev-parse --abbrev-ref origin/HEAD | sed s@origin/@@)" | ||
| git fetch --all --prune --tags --force -j$(nproc) | ||
| git checkout ${DEFAULT_BRANCH} | ||
zeroshade marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| git branch -D ${branch_name} || : | ||
| git checkout -b ${branch_name} | ||
zeroshade marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| popd | ||
|
|
||
| pushd "${ARROW_DIR}" | ||
|
|
||
| previous_major_version="$(echo v${previous_version} | grep -o '^[0-9]*')" | ||
| major_version="$(echo v${version} | grep -o '^[0-9]*')" | ||
zeroshade marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if [ ${previous_major_version} -eq ${major_version} ]; then | ||
| release_type=patch | ||
| else | ||
| release_type=major | ||
| fi | ||
|
||
|
|
||
| export TZ=UTC | ||
| release_date=$(LC_TIME=C date "+%-d %B %Y") | ||
| release_date_iso8601=$(LC_TIME=C date "+%Y-%m-%d") | ||
| previous_tag_date=$(git log -n 1 --pretty=%aI v${previous_version}) | ||
| rough_previous_release_date=$(date --date "${previous_tag_date}" +%s) | ||
| rough_release_date=$(date +%s) | ||
| rough_n_development_months=$(((\ | ||
| ${rough_release_date} - ${rough_previous_release_date}) / (60 * 60 * 24 * 30))) | ||
|
|
||
| git_tag=v${version} | ||
| git_range=v${previous_version}..v${version} | ||
|
|
||
| contributors_command_line="git shortlog -sn ${git_range}" | ||
| contributors=$(${contributors_command_line} | grep -v dependabot) | ||
|
|
||
| n_commits=$(git log --pretty=oneline ${git_range} | grep -i -v "chore: Bump" | wc -l) | ||
| n_contributors=$(${contributors_command_line} | grep -v dependabot | wc -l) | ||
|
|
||
| git_tag_hash=$(git log -n 1 --pretty=%H ${git_tag}) | ||
| git_changelog="$(gh release view --json body --jq .body | grep -v '@dependabot')" | ||
zeroshade marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| popd | ||
|
|
||
| pushd "${ARROW_SITE_DIR}" | ||
|
|
||
| cat <<ANNOUNCE >>"${announce_file}" | ||
| --- | ||
| layout: post | ||
| title: "Apache Arrow Go ${version} Release" | ||
| date: "${release_date_iso8601} 00:00:00" | ||
| author: pmc | ||
| categories: [release] | ||
| --- | ||
| <!-- | ||
| {% comment %} | ||
| 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. | ||
| {% endcomment %} | ||
| --> | ||
| The Apache Arrow team is pleased to announce the v${version} release ofApache Arrow Go. | ||
zeroshade marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This ${release_type} release covers ${n_commits} commits from ${n_contributors} distinct contributors. | ||
| ## Contributors | ||
| \`\`\`console | ||
| $ ${contributors_command_line} | ||
| ANNOUNCE | ||
|
|
||
| echo "${contributors}" >>"${announce_file}" | ||
|
|
||
| cat <<ANNOUNCE >>"${announce_file}" | ||
| \`\`\` | ||
| ## Changelog | ||
| ${git_changelog} | ||
| ANNOUNCE | ||
|
|
||
| git add "${announce_file}" | ||
| git commit -m "[Release] Add release notes for Arrow Go ${version}" | ||
| git push -u origin ${branch_name} | ||
|
|
||
| github_url=$(git remote get-url origin | | ||
| sed \ | ||
| -e 's,^[email protected]:,https://github.com/,' \ | ||
| -e 's,\.git$,,') | ||
|
|
||
| echo "Success!" | ||
| echo "Create a pull request:" | ||
| echo " ${github_url}/pull/new/${branch_name}" | ||
| popd | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a check whether this working copy is a fork not apache/arrow-site?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added