Skip to content

Commit

Permalink
ci: Build with experimental tag for non-semver tagged release
Browse files Browse the repository at this point in the history
  • Loading branch information
yondonfu authored and jailuthra committed Jun 23, 2021
1 parent 911d040 commit 5d6fc12
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Build livepeer in a container shared between Linux and Windows
run: |
docker pull livepeerci/build:latest || echo 'no pre-existing cache found'
./ci_env.sh docker build --build-arg HIGHEST_CHAIN_TAG -t livepeerci/build:latest --cache-from=livepeerci/build:latest -f docker/Dockerfile.build .
./ci_env.sh docker build --build-arg BUILD_TAGS -t livepeerci/build:latest --cache-from=livepeerci/build:latest -f docker/Dockerfile.build .
docker push livepeerci/build:latest
- name: Build minimal livepeer distributable
run: |
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -26,11 +26,11 @@ endif

.PHONY: livepeer
livepeer:
GO111MODULE=on CGO_LDFLAGS="$(cgo_ldflags)" go build -tags "$(HIGHEST_CHAIN_TAG)" -ldflags="$(ldflags)" cmd/livepeer/*.go
GO111MODULE=on CGO_LDFLAGS="$(cgo_ldflags)" go build -tags $(BUILD_TAGS) -ldflags="$(ldflags)" cmd/livepeer/*.go

.PHONY: livepeer_cli
livepeer_cli:
GO111MODULE=on CGO_LDFLAGS="$(cgo_ldflags)" go build -tags "$(HIGHEST_CHAIN_TAG)" -ldflags="$(ldflags)" cmd/livepeer_cli/*.go
GO111MODULE=on CGO_LDFLAGS="$(cgo_ldflags)" go build -tags $(BUILD_TAGS) -ldflags="$(ldflags)" cmd/livepeer_cli/*.go

.PHONY: livepeer_bench
livepeer_bench:
Expand All @@ -46,6 +46,6 @@ localdocker:
# docker build -t livepeerbinary:debian -f Dockerfile.debian .
# Manually build our context... this is hacky but docker refuses to support symlinks
# or selectable .dockerignore files
tar ch --exclude=.git . | docker build --build-arg HIGHEST_CHAIN_TAG=${HIGHEST_CHAIN_TAG} -t livepeerbinary:debian -f docker/Dockerfile.debian -
tar ch --exclude=.git . | docker build --build-arg BUILD_TAGS=$(BUILD_TAGS) -t livepeerbinary:debian -f docker/Dockerfile.debian -
rm .git.describe

7 changes: 7 additions & 0 deletions ci_env.sh
Expand Up @@ -48,4 +48,11 @@ if [[ $HIGHEST_CHAIN_TAG != "mainnet" ]]; then
fi
fi

export BUILD_TAGS="$HIGHEST_CHAIN_TAG"

# Only build with experimental tag for non-semver tagged releases
if [[ $generatedVersion != $definedVersion ]]; then
export BUILD_TAGS="${BUILD_TAGS},experimental"
fi

exec "$@"
4 changes: 2 additions & 2 deletions docker/Dockerfile.build
Expand Up @@ -5,8 +5,8 @@

FROM livepeerci/build-platform:latest

ARG HIGHEST_CHAIN_TAG
ENV HIGHEST_CHAIN_TAG ${HIGHEST_CHAIN_TAG}
ARG BUILD_TAGS
ENV BUILD_TAGS ${BUILD_TAGS}

COPY ./install_ffmpeg.sh ./install_ffmpeg.sh
RUN ./install_ffmpeg.sh
Expand Down

0 comments on commit 5d6fc12

Please sign in to comment.