Skip to content

Commit 0d296df

Browse files
authored
GH-587: [Release] Add .env description to dev/release/README.md (#724)
## What's Changed Add missing `dev/release/.env` description to `dev/release/README.md`. This also moves `GH_TOKEN` to `dev/release/.env`. Closes #587.
1 parent d2465c3 commit 0d296df

File tree

5 files changed

+89
-43
lines changed

5 files changed

+89
-43
lines changed

dev/release/.env.example

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
# The GitHub token to upload artifacts to GitHub Release.
19+
#
20+
# You must set this.
21+
#GH_TOKEN=secret
22+
1823
# The GPG key ID to sign artifacts. The GPG key ID must be registered
1924
# to both of the followings:
2025
#

dev/release/README.md

+63-36
Original file line numberDiff line numberDiff line change
@@ -27,45 +27,38 @@
2727
4. Publish (detailed later)
2828
5. Bump version for new development (detailed later)
2929

30-
### Bump version for new release
30+
### Prepare release environment
3131

32-
Run `dev/release/bump_version.sh` on a working copy of your fork not
33-
`[email protected]:apache/arrow-java`:
32+
This step is needed only when you act as a release manager first time.
3433

35-
```console
36-
$ git clone [email protected]:${YOUR_GITHUB_ACCOUNT}/arrow-java.git arrow-java.${YOUR_GITHUB_ACCOUNT}
37-
$ cd arrow-java.${YOUR_GITHUB_ACCOUNT}
38-
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/bump_version.sh ${NEW_VERSION}
39-
```
34+
We use the following variables in multiple steps:
4035

41-
Here is an example to bump version to 19.0.0:
36+
* `GH_TOKEN`: GitHub personal access token to automate GitHub related
37+
operations
38+
* `GPG_KEY_ID`: PGP key ID that is used for signing official artifacts
39+
by GnuPG
4240

43-
```
44-
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/bump_version.sh 19.0.0
45-
```
41+
We use `dev/release/.env` to share these variables in multiple
42+
steps. You can use `dev/release/.env.example` as a template:
4643

47-
It creates a feature branch and adds a commit that bumps version. This
48-
opens a pull request from the feature branch by `gh pr create`. So you
49-
need `gh` command and GitHub personal access token.
44+
```console
45+
$ cp dev/release/.env{.example,}
46+
$ chmod go-r dev/release/.env
47+
$ editor dev/release/.env
48+
```
5049

51-
See also:
50+
See
5251
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
52+
how to prepare GitHub personal access token for `GH_TOKEN`.
5353

54-
We need to merge the pull request before we cut a RC. If we try cut a
55-
RC without merging the pull request, the script to cut a RC is failed.
54+
Note that you also need to install `gh` command because our scripts
55+
use `gh` command to use GitHub API. See
56+
https://github.com/cli/cli#installation how to install `gh`
57+
command.
5658

57-
### Prepare RC and vote
58-
59-
You can use `dev/release/release_rc.sh`.
60-
61-
Requirements to run `release_rc.sh`:
62-
63-
* You must be an Apache Arrow committer or PMC member
64-
* You must prepare your PGP key for signing
65-
* You must configure Maven
66-
67-
If you don't have a PGP key,
68-
https://infra.apache.org/release-signing.html#generate may be helpful.
59+
If you don't have a PGP key for `GPG_KEY_ID`, see
60+
https://infra.apache.org/release-signing.html#genegrate how to
61+
generate your PGP key.
6962

7063
Your PGP key must be registered to the followings:
7164

@@ -85,6 +78,40 @@ $ head KEYS
8578
$ svn ci KEYS
8679
```
8780

81+
### Bump version for new release
82+
83+
Run `dev/release/bump_version.sh` on a working copy of your fork not
84+
`[email protected]:apache/arrow-java`:
85+
86+
```console
87+
$ git clone [email protected]:${YOUR_GITHUB_ACCOUNT}/arrow-java.git arrow-java.${YOUR_GITHUB_ACCOUNT}
88+
$ cd arrow-java.${YOUR_GITHUB_ACCOUNT}
89+
$ dev/release/bump_version.sh ${NEW_VERSION}
90+
```
91+
92+
Here is an example to bump version to 19.0.0:
93+
94+
```
95+
$ dev/release/bump_version.sh 19.0.0
96+
```
97+
98+
It creates a feature branch and adds a commit that bumps version. This
99+
opens a pull request from the feature branch.
100+
101+
We need to merge the pull request before we cut a RC. If we try
102+
cutting a RC without merging the pull request, the script to cut a RC
103+
is failed.
104+
105+
### Prepare RC and vote
106+
107+
You can use `dev/release/release_rc.sh`.
108+
109+
Requirements to run `release_rc.sh`:
110+
111+
* You must be an Apache Arrow committer or PMC member
112+
* You must prepare your PGP key for signing
113+
* You must configure Maven
114+
88115
Configure Maven to publish artifacts to Apache repositories. You will
89116
need to setup a master password at `~/.m2/settings-security.xml` and
90117
`~/.m2/settings.xml` as specified on [the Apache
@@ -102,15 +129,15 @@ Run `dev/release/release_rc.sh` on a working copy of
102129
```console
103130
$ git clone [email protected]:apache/arrow-java.git
104131
$ cd arrow-java
105-
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release_rc.sh ${RC}
132+
$ dev/release/release_rc.sh ${RC}
106133
(Send a vote email to [email protected].
107134
You can use a draft shown by release_rc.sh for the email.)
108135
```
109136

110137
Here is an example to release RC1:
111138

112139
```console
113-
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release_rc.sh 1
140+
$ dev/release/release_rc.sh 1
114141
```
115142

116143
The argument of `release_rc.sh` is the RC number. If RC1 has a
@@ -128,13 +155,13 @@ Run `dev/release/release.sh` on a working copy of
128155
archive to apache.org:
129156

130157
```console
131-
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release.sh ${VERSION} ${RC}
158+
$ dev/release/release.sh ${VERSION} ${RC}
132159
```
133160

134161
Here is an example to release 19.0.0 RC1:
135162

136163
```console
137-
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/release.sh 19.0.0 1
164+
$ dev/release/release.sh 19.0.0 1
138165
```
139166

140167
Add the release to ASF's report database via [Apache Committee Report
@@ -160,13 +187,13 @@ Run `dev/release/bump_version.sh` on a working copy of your fork not
160187
```console
161188
$ git clone [email protected]:${YOUR_GITHUB_ACCOUNT}/arrow-java.git arrow-java.${YOUR_GITHUB_ACCOUNT}
162189
$ cd arrow-java.${YOUR_GITHUB_ACCOUNT}
163-
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/bump_version.sh ${NEW_VERSION}-SNAPSHOT
190+
$ dev/release/bump_version.sh ${NEW_VERSION}-SNAPSHOT
164191
```
165192

166193
Here is an example to bump version to 19.0.1-SNAPSHOT:
167194

168195
```
169-
$ GH_TOKEN=${YOUR_GITHUB_TOKEN} dev/release/bump_version.sh 19.0.0-SNAPSHOT
196+
$ dev/release/bump_version.sh 19.0.0-SNAPSHOT
170197
```
171198

172199
It creates a feature branch and adds a commit that bumps version. This

dev/release/bump_version.sh

+7
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ fi
3131

3232
version=$1
3333

34+
if [ ! -f "${SOURCE_DIR}/.env" ]; then
35+
echo "You must create ${SOURCE_DIR}/.env"
36+
echo "You can use ${SOURCE_DIR}/.env.example as template"
37+
exit 1
38+
fi
39+
. "${SOURCE_DIR}/.env"
40+
3441
cd "${SOURCE_TOP_DIR}"
3542

3643
git_origin_url="$(git remote get-url origin)"

dev/release/release.sh

+7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ fi
2828
version=$1
2929
rc=$2
3030

31+
if [ ! -f "${SOURCE_DIR}/.env" ]; then
32+
echo "You must create ${SOURCE_DIR}/.env"
33+
echo "You can use ${SOURCE_DIR}/.env.example as template"
34+
exit 1
35+
fi
36+
. "${SOURCE_DIR}/.env"
37+
3138
git_origin_url="$(git remote get-url origin)"
3239
repository="${git_origin_url#*github.com?}"
3340
repository="${repository%.git}"

dev/release/release_rc.sh

+7-7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ rc=$1
3636
: "${RELEASE_SIGN:=${RELEASE_DEFAULT}}"
3737
: "${RELEASE_UPLOAD:=${RELEASE_DEFAULT}}"
3838

39+
if [ ! -f "${SOURCE_DIR}/.env" ]; then
40+
echo "You must create ${SOURCE_DIR}/.env"
41+
echo "You can use ${SOURCE_DIR}/.env.example as template"
42+
exit 1
43+
fi
44+
. "${SOURCE_DIR}/.env"
45+
3946
cd "${SOURCE_TOP_DIR}"
4047

4148
if [ "${RELEASE_PULL}" -gt 0 ] || [ "${RELEASE_PUSH_TAG}" -gt 0 ]; then
@@ -84,13 +91,6 @@ artifacts_dir="apache-arrow-java-${version}-rc${rc}"
8491
signed_artifacts_dir="${artifacts_dir}-signed"
8592

8693
if [ "${RELEASE_SIGN}" -gt 0 ]; then
87-
if [ ! -f "${SOURCE_DIR}/.env" ]; then
88-
echo "You must create ${SOURCE_DIR}/.env"
89-
echo "You can use ${SOURCE_DIR}/.env.example as template"
90-
exit 1
91-
fi
92-
. "${SOURCE_DIR}/.env"
93-
9494
git_origin_url="$(git remote get-url origin)"
9595
repository="${git_origin_url#*github.com?}"
9696
repository="${repository%.git}"

0 commit comments

Comments
 (0)