-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(cd): cd steps for badger (#1830)
This PR adds CD steps for Badger releases. Artifacts (badger binary and checksum) will be uploaded automatically to Github. Final step will be to add artifacts to release. This reflects the process we already have in place for Dgraph. Badger build flags were taken from the [Dgraph release script](https://github.com/dgraph-io/dgraph/blob/main/contrib/release.sh). We add a Makefile to streamline the build process.
- Loading branch information
1 parent
14dc96a
commit 11c81e3
Showing
3 changed files
with
76 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: cd-badger | ||
on: workflow_dispatch | ||
jobs: | ||
badger-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Get Go Version | ||
run: | | ||
#!/bin/bash | ||
GOVERSION=$({ [ -f .go-version ] && cat .go-version; }) | ||
echo "GOVERSION=$GOVERSION" >> $GITHUB_ENV | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GOVERSION }} | ||
- name: Set Badger Release Version | ||
run: | | ||
#!/bin/bash | ||
GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | ||
if [[ "$GIT_BRANCH_NAME" == "release/v"* ]]; | ||
then | ||
echo "this is a release branch" | ||
else | ||
echo "this is NOT a release branch" | ||
exit 1 | ||
fi | ||
BADGER_RELEASE_VERSION=$(git rev-parse --abbrev-ref HEAD | sed 's/release\///') | ||
echo "making a new release for "$BADGER_RELEASE_VERSION | ||
echo "BADGER_RELEASE_VERSION=$BADGER_RELEASE_VERSION" >> $GITHUB_ENV | ||
- name: Fetch dependencies | ||
run: sudo apt-get -y install build-essential | ||
- name: Build badger linux/amd64 | ||
run: make badger | ||
- name: Generate SHA for Linux Build | ||
run: cd badger && sha256sum badger-linux-amd64 | cut -c-64 > badger-checksum-linux-amd64.sha256 | ||
- name: Tar Archive for Linux Build | ||
run: cd badger && tar -zcvf badger-linux-amd64.tar.gz badger-linux-amd64 | ||
- name: Upload Badger Binary Build Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: | | ||
badger/badger-checksum-linux-amd64.sha256 | ||
badger/badger-linux-amd64.tar.gz |
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,26 @@ | ||
# | ||
# Copyright 2022 Dgraph Labs, Inc. and Contributors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
GOOS ?= $(shell go env GOOS) | ||
GOARCH ?= $(shell go env GOARCH) | ||
|
||
.PHONY: badger | ||
|
||
all: badger | ||
|
||
badger: | ||
# build badger binary | ||
@go build --tags=jemalloc -o badger-$(GOOS)-$(GOARCH) . |