Skip to content

Commit 70f36bc

Browse files
author
yuzelin
committed
set gpg
1 parent f790b45 commit 70f36bc

File tree

3 files changed

+69
-19
lines changed

3 files changed

+69
-19
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one or more
2+
# contributor license agreements. See the NOTICE file distributed with
3+
# this work for additional information regarding copyright ownership.
4+
# The ASF licenses this file to You under the Apache License, Version 2.0
5+
# (the "License"); you may not use this file except in compliance with
6+
# the License. You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Create Source Release
17+
18+
on:
19+
workflow_dispatch:
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v2
28+
29+
- name: Setup GPG
30+
env:
31+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
32+
run: |
33+
mkdir -p ~/.gnupg
34+
chmod 700 ~/.gnupg
35+
echo $GPG_PRIVATE_KEY | base64 --decode | gpg --batch --import --yes
36+
echo "use-agent" >> ~/.gnupg/gpg.conf
37+
echo "pinentry-program /usr/bin/pinentry" >> ~/.gnupg/gpg-agent.conf
38+
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
39+
40+
- name: Create source release
41+
env:
42+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
43+
run: |
44+
mkdir -p output
45+
chmod +x tools/releasing/create_source_release.sh
46+
OUTPUT_DIR=output GPG_PASSPHRASE=$GPG_PASSPHRASE tools/releasing/create_source_release.sh
47+
48+
- name: Upload source release
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: source-release
52+
path: output/*

.github/workflows/paimon-python-checks.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,8 @@ jobs:
4343
with:
4444
java-version: ${{ env.JDK_VERSION }}
4545
distribution: 'adopt'
46-
- name: Set up hadoop dependency
47-
run: |
48-
mkdir -p ${{ github.workspace }}/temp
49-
curl -L -o ${{ github.workspace }}/temp/bundled-hadoop.jar \
50-
https://repo.maven.apache.org/maven2/org/apache/flink/flink-shaded-hadoop-2-uber/2.8.3-10.0/flink-shaded-hadoop-2-uber-2.8.3-10.0.jar
46+
5147
- name: Run lint-python.sh
52-
env:
53-
_PYPAIMON_HADOOP_CLASSPATH: ${{ github.workspace }}/temp/bundled-hadoop.jar
5448
run: |
5549
chmod +x dev/lint-python.sh
5650
./dev/lint-python.sh

tools/releasing/create_source_release.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@
1818
#
1919

2020
##
21-
## Required variables
21+
## set build vars
2222
##
23-
RELEASE_VERSION=${RELEASE_VERSION}
23+
OUTPUT_DIR=${OUTPUT_DIR}
24+
GPG_PASSPHRASE=${GPG_PASSPHRASE}
2425

25-
if [ -z "${RELEASE_VERSION}" ]; then
26-
echo "RELEASE_VERSION was not set"
26+
if [ -z "${OUTPUT_DIR}" ]; then
27+
echo "OUTPUT_DIR was not set"
28+
exit 1
29+
fi
30+
31+
if [ -z "${GPG_PASSPHRASE}" ]; then
32+
echo "GPG_PASSPHRASE was not set"
2733
exit 1
2834
fi
2935

@@ -63,9 +69,8 @@ if grep -q "<version>.*SNAPSHOT</version>" "pom.xml"; then
6369
exit 1
6470
fi
6571

66-
# get version
72+
# get bridge jar version
6773
JAR_VERSION=$(sed -n 's/.*<version>\(.*\)<\/version>.*/\1/p' pom.xml | head -n 1)
68-
echo $JAR_VERSION
6974

7075
mvn clean install -DskipTests
7176
cp "target/paimon-python-java-bridge-${JAR_VERSION}.jar" ${DEPS_DIR}
@@ -74,9 +79,8 @@ cd ${CURR_DIR}
7479

7580
# build source release
7681

77-
RELEASE_DIR=${PROJECT_ROOT}/release
78-
rm -rf ${RELEASE_DIR}
79-
mkdir -p ${RELEASE_DIR}
82+
# get release version
83+
RELEASE_VERSION=$(sed -n 's/^__version__ = "\(.*\)"/\1/p' ${PROJECT_ROOT}/pypaimon/version.py)
8084

8185
# use lint-python.sh script to create a python environment.
8286
dev/lint-python.sh -s basic
@@ -85,12 +89,12 @@ source dev/.conda/bin/activate
8589
python setup.py sdist
8690
conda deactivate
8791
WHEEL_FILE_NAME="pypaimon-${RELEASE_VERSION}.tar.gz"
88-
cp "dist/${WHEEL_FILE_NAME}" "${RELEASE_DIR}/${WHEEL_FILE_NAME}"
92+
cp "dist/${WHEEL_FILE_NAME}" "${OUTPUT_DIR}/${WHEEL_FILE_NAME}"
8993

90-
cd ${RELEASE_DIR}
94+
cd ${OUTPUT_DIR}
9195

9296
# Sign sha the wheel package
93-
gpg --armor --detach-sig ${WHEEL_FILE_NAME}
97+
gpg --batch --yes --pinentry-mode loopback --passphrase=$GPG_PASSPHRASE --armor --detach-sign ${WHEEL_FILE_NAME}
9498
$SHASUM ${WHEEL_FILE_NAME} > "${WHEEL_FILE_NAME}.sha512"
9599

96100
rm -rf DEPS_DIR

0 commit comments

Comments
 (0)