Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Optimise Docker build #365

Merged
merged 14 commits into from
Aug 15, 2022
12 changes: 6 additions & 6 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
**/*.md

# Skip build/test folders
build-tools/
installer/
networks/
tests/
build-tools/**
installer/**
networks/**
tests/**

# Skip Git-related folders
.github
.git
.github/**
**/.git
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ jobs:
go-version-file: ./go.mod
cache: true

- name: Generate Protobufs
run: make proto-gen

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

- uses: actions/setup-go@v3
with:
Expand All @@ -34,6 +35,10 @@ jobs:
cache: 'npm'
cache-dependency-path: '**/package-lock.json'

# Setup for pushing to Buf.build later
- uses: bufbuild/buf-setup-action@v1.7.0

# Required for short-lived token provided to Semantic Release
- name: "Obtain Github App token"
id: app-token
uses: getsentry/action-github-app-token@v1.0.6
Expand Down Expand Up @@ -64,6 +69,12 @@ jobs:
RELEASE_VERSION=$( git describe --tags ${{ github.sha }})
echo ::set-output name=RELEASE_VERSION::"$RELEASE_VERSION"

# Push Protobufs to Buf.build registry
- uses: bufbuild/buf-push-action@v1
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}

release-docker:
name: "Docker image"
needs: release-binary
Expand All @@ -73,15 +84,13 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version
persist-credentials: false

- uses: actions/setup-go@v3
with:
go-version-file: ./go.mod
cache: true

- name: Generate golang code
run: make proto-gen

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ checksum:
algorithm: sha256

changelog:
use: github
use: github-native
sort: asc
groups:
- title: Features
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WORKDIR /go/src/github.com/cheqd/cheqd-node
COPY . .

# Make node binary
RUN make install && make build
RUN go mod download && make build-linux

###############################################################
### STAGE 2: Build cheqd-node image ###
Expand Down
Empty file added proto/buf.md
Empty file.
4 changes: 2 additions & 2 deletions proto/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Buf Build config for cheqd-node DID module
# Buf Build config for cheqd Cosmos SDK modules

version: v1

name: buf.build/cheqd/cheqd-node
name: buf.build/cheqd/cheqd-proto

deps:
- buf.build/cosmos/cosmos-sdk
Expand Down