kou commented on code in PR #41131:
URL: https://github.com/apache/arrow/pull/41131#discussion_r1566707800
##########
dev/release/02-source.sh:
##########
@@ -56,35 +55,20 @@ fi
echo "Using commit $release_hash"
-tarball=${tag}.tar.gz
-
-rm -rf ${tag}
-# be conservative and use the release hash, even though git produces the same
-# archive (identical hashes) using the scm tag
-(cd "${SOURCE_TOP_DIR}" && \
- git archive ${release_hash} --prefix ${tag}/) | \
- tar xf -
-
-# Resolve all hard and symbolic links.
-# If we change this, we must change ArrowSources.archive in
-# dev/archery/archery/utils/source.py too.
-rm -rf ${tag}.tmp
-mv ${tag} ${tag}.tmp
-cp -R -L ${tag}.tmp ${tag}
-rm -rf ${tag}.tmp
-
-# Create a dummy .git/ directory to download the source files from GitHub with
Source Link in C#.
-dummy_git=${tag}/csharp/dummy.git
-mkdir ${dummy_git}
-pushd ${dummy_git}
-echo ${release_hash} > HEAD
-echo '[remote "origin"] url = https://github.com/apache/arrow.git' >> config
-mkdir objects refs
-popd
-
-# Create new tarball from modified source directory
-tar czf ${tarball} ${tag}
-rm -rf ${tag}
+tarball=apache-arrow-${version}.tar.gz
+
+rm -f ${tarball}
+
+if [ ${TEST_RELEASE_SCRIPT} -gt 0 ]; then
+ # Assume calling from arrow's source directory
+ "${SOURCE_DIR}/utils-create-release-tarball.sh" ${version} ${rc}
+else
+ gh release download \
+ ${tag} \
+ --repo apache/arrow \
+ --dir . \
+ --pattern "${tarball}"
+fi
Review Comment:
How about using `apache-arrow-X.Y.Z.tar.gz` in local when
`SOURCE_DOWNLOAD=0`?
```suggestion
if [ ${SOURCE_DOWNLOAD} -gt 0 ]; then
rm -f ${tarball}
gh release download \
${tag} \
--repo apache/arrow \
--dir . \
--pattern "${tarball}"
fi
```
##########
dev/release/utils-create-release-tarball.sh:
##########
@@ -0,0 +1,62 @@
+#!/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.
+#
+
+SOURCE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+SOURCE_TOP_DIR="$(cd "${SOURCE_DIR}/../../" && pwd)"
+
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 <version> <rc-num>"
+ exit
+fi
+
+version=$1
+rc=$2
+
+tag=apache-arrow-${version}-rc${rc}
+tarball=apache-arrow-${version}.tar.gz
+
+: ${release_hash:=$(git rev-list --max-count=1 ${tag})}
+
+rm -rf ${tag}
+
+# be conservative and use the release hash, even though git produces the same
+# archive (identical hashes) using the scm tag
+(cd "${SOURCE_TOP_DIR}" && \
+ git archive ${release_hash} --prefix ${tag}/) | \
Review Comment:
```suggestion
git archive ${release_hash} --prefix ${tag}/) | \
```
##########
docs/source/developers/release.rst:
##########
@@ -325,6 +326,19 @@ Be sure to go through on the following checklist:
Add relevant release data for Arrow to `Apache reporter
<https://reporter.apache.org/addrelease.html?arrow>`_.
+.. dropdown:: Push release tag and create GitHub Release
+ :animate: fade-in-slide-down
+ :class-title: sd-fs-5
+ :class-container: sd-shadow-md
+
+ A committer must push the release tag to GitHub:
+
+ .. code-block:: Bash
+
+
Review Comment:
```suggestion
```
##########
dev/release/02-source-test.rb:
##########
@@ -36,12 +37,13 @@ def source(*targets)
env = {
"SOURCE_DEFAULT" => "0",
"release_hash" => @current_commit,
+ "TEST_RELEASE_SCRIPT" => "1",
}
targets.each do |target|
env["SOURCE_#{target}"] = "1"
end
output = sh(env, @script, @release_version, "0")
Review Comment:
```suggestion
sh(env, File.expand_path("dev/release/utils-create-release-tarball.sh",
@release_version, "0")
output = sh(env, @script, @release_version, "0")
```
##########
.github/workflows/release.yml:
##########
@@ -0,0 +1,73 @@
+# 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.
+
+name: Release
+
+on:
+ push:
+ tags:
+ # Trigger workflow when a tag whose name matches the pattern
+ # pattern "apache-arrow-{MAJOR}.{MINOR}.{PATCH}" is pushed.
+ - "apache-arrow-[0-9]+.[0-9]+.[0-9]+"
+
+permissions:
+ contents: write
+
+env:
+ GH_TOKEN: ${{ github.token }}
+
+jobs:
+ publish:
+ name: Publish
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ steps:
+ - name: Checkout Arrow
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: Get Tag Name of Latest Release Candidate
+ run: |
+ rc_tag=$(gh release list | \
+ cut -f3 | \
+ grep -F "${GITHUB_REF_NAME}-rc" | \
+ head -n1)
+ echo "Latest Release Candidate Tag: ${rc_tag}"
+ echo "RELEASE_CANDIDATE_TAG_NAME=${rc_tag}" >> ${GITHUB_ENV}
+ - name: Store Version and Release Candidate Number
+ run: |
+ version_with_rc=${RELEASE_CANDIDATE_TAG_NAME#apache-arrow-}
+ version=${version_with_rc%-rc*}
+ rc_num=${version_with_rc#${version}-rc}
+ echo "VERSION_WITH_RC=${version_with_rc}" >> ${GITHUB_ENV}
+ echo "VERSION=${version}" >> ${GITHUB_ENV}
+ echo "RC_NUM=${rc_num}" >> ${GITHUB_ENV}
+ - name: Create Release Title
+ run: |
+ title="Apache Arrow ${VERSION}"
+ echo "RELEASE_TITLE=${title}" >> ${GITHUB_ENV}
+ - name: Create Release Notes
+ run: |
+ release_notes="https://arrow.apache.org/release/${VERSION}.html"
+ echo "Release Notes URL: ${release_notes}"
+ echo "RELEASE_NOTES=${release_notes}" >> ${GITHUB_ENV}
+ - name: Create GitHub Release
+ run: |
+ gh release create ${GITHUB_REF_NAME} \
+ --verify-tag \
+ --title "${RELEASE_TITLE}" \
+ --notes "Release Notes: ${RELEASE_NOTES}"
Review Comment:
Could you download artifacts for RC and upload them?
Could you also ensure adding a new line at the end of file?
(`utils-create-release-tarball.sh` also doesn't have the last new line.)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]