Skip to content

Commit d08cdd5

Browse files
authored
Fix the staging release process (#1373)
### Motivation The "Build and inspect an artifact." step in the [release process](https://github.com/apache/pulsar-client-go/blob/master/docs/release-process.md) would also include the `.git` folder. https://lists.apache.org/thread/pndqy7lfb8nrsgjh0wfq1bsrs1g7ds3y ### Modifications - Added a new script for staging the release artifact: `stag-release.sh` - Updated the release process to exclude the `.git` folder from the release artifact
1 parent a5c6dee commit d08cdd5

File tree

2 files changed

+45
-11
lines changed

2 files changed

+45
-11
lines changed

docs/release-process.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,10 @@ git push origin v0.X.0-candidate-1
5151

5252
3. Build and inspect an artifact.
5353

54-
Generate a release candidate package.
54+
Stage and sign the release artifacts.
5555

5656
```bash
57-
$ tar -zcvf apache-pulsar-client-go-0.X.0-src.tar.gz .
58-
```
59-
60-
4. Sign and stage the artifacts
61-
62-
The src artifact need to be signed and uploaded to the dist SVN repository for staging.
63-
64-
```
65-
$ gpg -b --armor apache-pulsar-client-go-0.X.0-src.tar.gz
66-
$ shasum -a 512 apache-pulsar-client-go-0.X.0-src.tar.gz > apache-pulsar-client-go-0.X.0-src.tar.gz.sha512
57+
$ ./scripts/stage-release.sh 0.X.0 .
6758
```
6859

6960
Checkout repo for uploading artifacts

scripts/stage-release.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
set -euo pipefail
20+
21+
if [ $# -ne 2 ]; then
22+
echo "Usage: $0 <version> <destination_directory>"
23+
exit 1
24+
fi
25+
26+
VERSION=$1
27+
28+
DEST_PATH=$2
29+
DEST_PATH="$(cd "$DEST_PATH" && pwd)"
30+
31+
pushd "$(dirname "$0")"
32+
REPO_PATH=$(git rev-parse --show-toplevel)
33+
popd
34+
35+
pushd "$REPO_PATH"
36+
git archive --format=tar.gz --output="$DEST_PATH/apache-pulsar-client-go-$VERSION-src.tar.gz" HEAD
37+
popd
38+
39+
# Sign all files
40+
cd "$DEST_PATH"
41+
gpg -b --armor apache-pulsar-client-go-$VERSION-src.tar.gz
42+
shasum -a 512 apache-pulsar-client-go-$VERSION-src.tar.gz > apache-pulsar-client-go-$VERSION-src.tar.gz.sha512
43+

0 commit comments

Comments
 (0)