Skip to content

Commit

Permalink
Package ckb with statically linked OpenSSL 3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
eval-exec committed Oct 12, 2023
1 parent 2163e4f commit 6d0fb94
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
GPG_SIGNER: ${{ secrets.GPG_SIGNER }}
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
docker run --rm -i -w /ckb -v $(pwd):/ckb -e OPENSSL_STATIC=1 -e OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu -e OPENSSL_INCLUDE_DIR=/usr/include $BUILDER_IMAGE make ${{ matrix.build_target }}
docker run --rm -i -w /ckb -v $(pwd):/ckb -e OPENSSL_STATIC=1 -e OPENSSL_LIB_DIR=/usr/local/lib64 -e OPENSSL_INCLUDE_DIR=/usr/local/include $BUILDER_IMAGE make ${{ matrix.build_target }}
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg
gpg --import devtools/ci/signer.asc
devtools/ci/package.sh target/prod/ckb
Expand All @@ -78,7 +78,7 @@ jobs:
name: ckb_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
path: ckb_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
env:
BUILDER_IMAGE: nervos/ckb-docker-builder:bionic-rust-1.71.1
BUILDER_IMAGE: nervos/ckb-docker-builder:bionic-rust-1.71.1-openssl-3.1.3
REL_PKG: ${{ matrix.rel_pkg }}

package-for-linux-aarch64:
Expand All @@ -104,14 +104,14 @@ jobs:
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
export TOP_DIR=$(pwd)
curl -LO https://www.openssl.org/source/openssl-1.1.1.tar.gz
tar -xzf openssl-1.1.1.tar.gz
cd openssl-1.1.1
curl -LO https://www.openssl.org/source/openssl-3.1.3.tar.gz
tar -xzf openssl-3.1.3.tar.gz
cd openssl-3.1.3
CC=aarch64-linux-gnu-gcc ./Configure linux-aarch64 shared
CC=aarch64-linux-gnu-gcc make
cd ..
export OPENSSL_LIB_DIR=${TOP_DIR}/openssl-1.1.1
export OPENSSL_INCLUDE_DIR=${TOP_DIR}/openssl-1.1.1/include
export OPENSSL_LIB_DIR=${TOP_DIR}/openssl-3.1.3
export OPENSSL_INCLUDE_DIR=${TOP_DIR}/openssl-3.1.3/include
PKG_CONFIG_ALLOW_CROSS=1 CC=gcc CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc CKB_BUILD_TARGET="--target=aarch64-unknown-linux-gnu" make prod_portable
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg
gpg --import devtools/ci/signer.asc
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
name: ckb_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
path: ckb_${{env.GIT_TAG_NAME }}_${{env.REL_PKG }}.asc
env:
BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.71.1
BUILDER_IMAGE: nervos/ckb-docker-builder:centos-7-rust-1.71.1-openssl-3.1.3
REL_PKG: ${{ matrix.rel_pkg }}

package-for-mac:
Expand All @@ -189,13 +189,18 @@ jobs:
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
echo "GIT_TAG_NAME=$GIT_TAG_NAME" >> $GITHUB_ENV
- name: Install Dependencies
run: |
if ! [ -d /opt/homebrew/opt/openssl@3.1 ]; then
brew install "openssl@3.1"
fi
- name: Build CKB and Package CKB
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
GPG_SIGNER: ${{ secrets.GPG_SIGNER }}
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
make OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/usr/local/opt/openssl@1.1/lib OPENSSL_INCLUDE_DIR=/usr/local/opt/openssl@1.1/include ${{ matrix.build_target }}
make OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/opt/homebrew/opt/openssl@3.1/lib OPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl@3.1/include ${{ matrix.build_target }}
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg
gpg --import devtools/ci/signer.asc
devtools/ci/package.sh target/prod/ckb
Expand Down Expand Up @@ -233,8 +238,8 @@ jobs:
- name: Install Depedencies
run: |
if ! [ -d /opt/homebrew/opt/openssl@1.1 ]; then
brew install "openssl@1.1"
if ! [ -d /opt/homebrew/opt/openssl@3.1 ]; then
brew install "openssl@3.1"
fi
if ! type -f gpg &> /dev/null; then
brew install gnupg
Expand All @@ -254,7 +259,7 @@ jobs:
GPG_SIGNER: ${{ secrets.GPG_SIGNER }}
run: |
export GIT_TAG_NAME=` echo ${{ github.ref }} | awk -F '/' '{print $4}' `
make OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/opt/homebrew/opt/openssl@1.1/lib OPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl@1.1/include ${{ matrix.build_target }}
make OPENSSL_STATIC=1 OPENSSL_LIB_DIR=/opt/homebrew/opt/openssl@3.1/lib OPENSSL_INCLUDE_DIR=/opt/homebrew/opt/openssl@3.1/include ${{ matrix.build_target }}
gpg --quiet --batch --yes --decrypt --passphrase="$LARGE_SECRET_PASSPHRASE" --output devtools/ci/signer.asc devtools/ci/signer.asc.gpg
gpg --import devtools/ci/signer.asc
devtools/ci/package.sh target/prod/ckb
Expand Down
10 changes: 5 additions & 5 deletions devtools/ci/ci_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ case $GITHUB_WORKFLOW in
sudo apt-get install -y gcc-multilib
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu clang
rustup target add aarch64-unknown-linux-gnu
curl -LO https://www.openssl.org/source/openssl-1.1.1.tar.gz
tar -xvzf openssl-1.1.1.tar.gz
cd openssl-1.1.1
curl -LO https://www.openssl.org/source/openssl-3.1.3.tar.gz
tar -xvzf openssl-3.1.3.tar.gz
cd openssl-3.1.3
CC=aarch64-linux-gnu-gcc ./Configure linux-aarch64 shared
CC=aarch64-linux-gnu-gcc make
cd ..
export TOP
export OPENSSL_LIB_DIR=$(pwd)/openssl-1.1.1
export OPENSSL_INCLUDE_DIR=$(pwd)/openssl-1.1.1/include
export OPENSSL_LIB_DIR=$(pwd)/openssl-3.1.3
export OPENSSL_INCLUDE_DIR=$(pwd)/openssl-3.1.3/include
export PKG_CONFIG_ALLOW_CROSS=1
export CC=gcc
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
Expand Down

0 comments on commit 6d0fb94

Please sign in to comment.