Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: CI/CD to build/release radiance tool with rocksdb #10

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
65 changes: 65 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release radiance tool

on:
push:
branches: [ tx_meta ]
tags:
- v*
pull_request:
branches: [ main ]

# on:
# push:

jobs:
build:
runs-on: [ubuntu-20.04]

steps:
- name: checkout repo
uses: actions/checkout@v3

- name: setup go env
uses: actions/setup-go@v3
with:
go-version: '1.19.7'
check-latest: true

- name: Cache rocksdb build
uses: actions/cache@v3
with:
key: ${{ runner.os }}-build
path: |
~/radiance-triton/facebook/
~/radiance-triton/radiance-triton/facebook/
~/work/radiance-triton/radiance-triton/facebook/

- name: build binaries
run: |

# snappy
sudo apt update
sudo apt-get install -y libsnappy-dev build-essential cmake zlib1g-dev libbz2-dev liblz4-dev libzstd-dev

# protoc
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
export PATH="$PATH:$(go env GOPATH)/bin"
wget https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip
unzip protoc-22.3-linux-x86_64.zip
sudo mv bin/protoc /usr/bin/protoc
sudo chmod +x /usr/bin/protoc

# deps
make gen-proto

# build
make full

ls -lha radiance

- name: Create release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
radiance
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ build_rocksdb:
-DWITH_TESTS=OFF \
-DWITH_TOOLS=OFF \
-DWITH_TRACE_TOOLS=OFF ; \
make -j
# limit concurrency to number of CPU cores (not threads)
# helps managing memory use during build
make -j `nproc`
lite: install_compatible_golang_version
go1.19.7 build -tags=lite ./cmd/radiance
go build -tags=lite ./cmd/radiance
full: install_compatible_golang_version build_rocksdb
CGO_CFLAGS="-I$$(pwd)/facebook/rocksdb/include" \
CGO_LDFLAGS="-L$$(pwd)/facebook/rocksdb/build -lbz2" \
go1.19.7 build ./cmd/radiance
go build ./cmd/radiance
radiance: install_compatible_golang_version build_rocksdb
CGO_CFLAGS="-I$$(pwd)/facebook/rocksdb/include" \
CGO_LDFLAGS="-L$$(pwd)/facebook/rocksdb/build -lbz2" \
Expand Down