diff --git a/.github/workflows/proto-docker.yml b/.github/workflows/proto-docker.yml deleted file mode 100644 index 3f98a4566..000000000 --- a/.github/workflows/proto-docker.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Build & Push TM Proto Builder -on: - pull_request: - paths: - - "tools/proto/*" - push: - branches: - - master - paths: - - "tools/proto/*" - schedule: - # run this job once a month to recieve any go or buf updates - - cron: "* * 1 * *" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.4.0 - - name: Prepare - id: prep - run: | - DOCKER_IMAGE=tendermintdev/docker-build-proto - VERSION=noop - if [[ $GITHUB_REF == refs/tags/* ]]; then - VERSION=${GITHUB_REF#refs/tags/} - elif [[ $GITHUB_REF == refs/heads/* ]]; then - VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g') - if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then - VERSION=latest - fi - fi - TAGS="${DOCKER_IMAGE}:${VERSION}" - echo ::set-output name=tags::${TAGS} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1.6.0 - - - name: Login to DockerHub - uses: docker/login-action@v1.10.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Publish to Docker Hub - uses: docker/build-push-action@v2.7.0 - with: - context: ./tools/proto - file: ./tools/proto/Dockerfile - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.prep.outputs.tags }} diff --git a/Makefile b/Makefile index b313b1d07..9d1530f76 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ endif LD_FLAGS = -X github.com/tendermint/tendermint/version.TMVersion=$(VERSION) BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS)" HTTPS_GIT := https://github.com/tendermint/tendermint.git -DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace bufbuild/buf +DOCKER_BUF := docker run -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto CGO_ENABLED ?= 0 # handle nostrip @@ -83,25 +83,26 @@ proto-all: proto-gen proto-lint proto-check-breaking .PHONY: proto-all proto-gen: + @docker pull -q tendermintdev/docker-build-proto @echo "Generating Protobuf files" @docker run -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto sh ./scripts/protocgen.sh .PHONY: proto-gen proto-lint: - @$(DOCKER_BUF) lint --error-format=json + @$(DOCKER_PROTO_BUILDER) buf lint --error-format=json .PHONY: proto-lint proto-format: @echo "Formatting Protobuf files" - docker run -v $(shell pwd):/workspace --workdir /workspace tendermintdev/docker-build-proto find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; + @$(DOCKER_PROTO_BUILDER) find ./ -not -path "./third_party/*" -name *.proto -exec clang-format -i {} \; .PHONY: proto-format proto-check-breaking: - @$(DOCKER_BUF) breaking --against .git#branch=master + @$(DOCKER_PROTO_BUILDER) buf breaking --against .git#branch=master .PHONY: proto-check-breaking proto-check-breaking-ci: - @$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=master + @$(DOCKER_PROTO_BUILDER) buf breaking --against $(HTTPS_GIT)#branch=master .PHONY: proto-check-breaking-ci ###############################################################################