diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f76c1da --- /dev/null +++ b/.github/workflows/release.yml @@ -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 diff --git a/Makefile b/Makefile index 08ac069..91c4261 100644 --- a/Makefile +++ b/Makefile @@ -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" \