File tree Expand file tree Collapse file tree 3 files changed +76
-1
lines changed Expand file tree Collapse file tree 3 files changed +76
-1
lines changed Original file line number Diff line number Diff line change 1+ name : cd-badger
2+ on : workflow_dispatch
3+ jobs :
4+ badger-build :
5+ runs-on : ubuntu-latest
6+ steps :
7+ - uses : actions/checkout@v3
8+ - name : Get Go Version
9+ run : |
10+ #!/bin/bash
11+ GOVERSION=$({ [ -f .go-version ] && cat .go-version; })
12+ echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV
13+ - name : Set up Go
14+ uses : actions/setup-go@v3
15+ with :
16+ go-version : ${{ env.GOVERSION }}
17+ - name : Set Badger Release Version
18+ run : |
19+ #!/bin/bash
20+ GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
21+ if [[ "$GIT_BRANCH_NAME" == "release/v"* ]];
22+ then
23+ echo "this is a release branch"
24+ else
25+ echo "this is NOT a release branch"
26+ exit 1
27+ fi
28+ BADGER_RELEASE_VERSION=$(git rev-parse --abbrev-ref HEAD | sed 's/release\///')
29+ echo "making a new release for "$BADGER_RELEASE_VERSION
30+ echo "BADGER_RELEASE_VERSION=$BADGER_RELEASE_VERSION" >> $GITHUB_ENV
31+ - name : Fetch dependencies
32+ run : sudo apt-get -y install build-essential
33+ - name : Build badger linux/amd64
34+ run : make badger
35+ - name : Generate SHA for Linux Build
36+ run : cd badger && sha256sum badger-linux-amd64 | cut -c-64 > badger-checksum-linux-amd64.sha256
37+ - name : Tar Archive for Linux Build
38+ run : cd badger && tar -zcvf badger-linux-amd64.tar.gz badger-linux-amd64
39+ - name : Upload Badger Binary Build Artifacts
40+ uses : actions/upload-artifact@v3
41+ with :
42+ path : |
43+ badger/badger-checksum-linux-amd64.sha256
44+ badger/badger-linux-amd64.tar.gz
Original file line number Diff line number Diff line change @@ -19,7 +19,12 @@ HAS_JEMALLOC = $(shell test -f /usr/local/lib/libjemalloc.a && echo "jemalloc")
1919JEMALLOC_URL = "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2"
2020
2121
22- .PHONY : all test jemalloc dependency
22+ .PHONY : all badger test jemalloc dependency
23+
24+ badger : jemalloc
25+ @echo " Compiling Badger binary..."
26+ @$(MAKE ) -C badger badger
27+ @echo " Badger binary located in badger directory."
2328
2429test : jemalloc
2530 @echo " Running Badger tests..."
Original file line number Diff line number Diff line change 1+ #
2+ # Copyright 2022 Dgraph Labs, Inc. and Contributors
3+ #
4+ # Licensed under the Apache License, Version 2.0 (the "License");
5+ # you may not use this file except in compliance with the License.
6+ # 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+
17+ GOOS ?= $(shell go env GOOS)
18+ GOARCH ?= $(shell go env GOARCH)
19+
20+ .PHONY : badger
21+
22+ all : badger
23+
24+ badger :
25+ # build badger binary
26+ @go build --tags=jemalloc -o badger-$(GOOS)-$(GOARCH) .
You can’t perform that action at this time.
0 commit comments