-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
421e6c5
commit cec134f
Showing
6 changed files
with
139 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: kava-build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- 'bin/builder' | ||
- 'arch.Dockerfile' | ||
- 'alpine.Dockerfile' | ||
- '.github/workflows/docker-build.yml' | ||
- '.github/workflows/kava-build.yml' | ||
|
||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'bin/builder' | ||
- 'arch.Dockerfile' | ||
- 'alpine.Dockerfile' | ||
- '.github/workflows/docker-build.yml' | ||
- '.github/workflows/kava-build.yml' | ||
|
||
jobs: | ||
kava-build: | ||
uses: ./.github/workflows/docker-build.yml | ||
secrets: inherit | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
#platform: ["linux/amd64", "linux/arm64"] # need arm runners | ||
platform: ["linux/amd64"] | ||
distro: ["alpine"] | ||
version: | ||
- "0.25.0" | ||
|
||
include: | ||
# Include Defaults (keep at top) | ||
- name: "kava-rocksdb" | ||
binary: "kava" | ||
build_command: "make install" | ||
chain_registry_name: "kava" | ||
repo: "Kava-Labs/kava" | ||
go_version: "1.20" | ||
os: "linux" | ||
arch: "amd64" | ||
rocksdb_version: "8.1.1" | ||
cosmos_build_options: "nostrip rocksdb" | ||
|
||
- version: "0.25.0" | ||
go_version: "1.20" | ||
|
||
with: | ||
binary: ${{ matrix.binary }} | ||
build_command: ${{ matrix.build_command }} | ||
chain_registry_name: ${{ matrix.chain_registry_name }} | ||
go_version: ${{ matrix.go_version }} | ||
name: ${{ matrix.name }} | ||
os: ${{ matrix.os }} | ||
arch: ${{ matrix.arch }} | ||
distro: ${{ matrix.distro }} | ||
platform: ${{ matrix.platform }} | ||
repo: ${{ matrix.repo }} | ||
version: ${{ matrix.version }} | ||
rocksdb_version: ${{ matrix.rocksdb_version }} | ||
denom: ukava |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
ROCKSDB_VERSION="$1" | ||
|
||
if [ -n "${ROCKSDB_VERSION}" ]; then | ||
mkdir -p "${GOPATH}/src/rocksdb" | ||
cd "${GOPATH}/src/rocksdb" | ||
git clone --depth 1 --branch "${ROCKSDB_VERSION}" \ | ||
https://github.com/facebook/rocksdb ./ | ||
# busybox install doesn't support -C flag | ||
sed -i "s/install -C/install/g" Makefile | ||
apk add zstd-static lz4-static zlib-static snappy-static | ||
make -j$(nproc) static_lib | ||
make install-static | ||
else | ||
echo "ROCKSDB_VERSION not set" >&2 | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh -x | ||
|
||
BASEDIR=$(dirname "$0") | ||
DOCKER_DIR="${BASEDIR}/.." | ||
IMAGE="alpine" | ||
NAME="kava-rocksdb" | ||
REPO="Kava-Labs/kava" | ||
TAG="0.25.0" | ||
GO_VERSION="1.19" | ||
ROCKSDB_VERSION="8.1.1" | ||
COSMOS_BUILD_OPTIONS="nostrip rocksdb" | ||
|
||
cd "${DOCKER_DIR}" | ||
docker buildx build "." -f "${IMAGE}.Dockerfile" \ | ||
--load \ | ||
--progress plain \ | ||
--target "builder" \ | ||
--tag "terraformlabs/${NAME}:${TAG}" \ | ||
--platform "linux/amd64" \ | ||
--build-arg "OS=linux" \ | ||
--build-arg "ARCH=amd64" \ | ||
--build-arg "DENOM=ukava" \ | ||
--build-arg "APP_NAME=${NAME}" \ | ||
--build-arg "BIN_NAME=${NAME}" \ | ||
--build-arg "BUILD_COMMAND=make install" \ | ||
--build-arg "BUILD_TAGS=netgo ledger muslc" \ | ||
--build-arg "COSMOS_BUILD_OPTIONS=${COSMOS_BUILD_OPTIONS}" \ | ||
--build-arg "GIT_TAG=v${TAG}" \ | ||
--build-arg "GIT_REPO=${REPO}" \ | ||
--build-arg "GO_VERSION=${GO_VERSION}" \ | ||
--build-arg "MIMALLOC_VERSION=" \ | ||
--build-arg "ROCKSDB_VERSION=v${ROCKSDB_VERSION}" \ | ||
--build-arg "BIN_NAME=kava" \ | ||
--build-arg "LDFLAGS=-w -s -linkmode=external -extldflags \"-Wl,-z,muldefs -static\"" \ | ||
$@ |