Skip to content

Commit 27df600

Browse files
committed
update makefile
1 parent 25ca121 commit 27df600

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525
strategy:
2626
matrix:
27-
build_type: ['build-linux']
27+
build_type: ['build-release-amd64']
2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v3

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SIMAPP = ./app
1010
HTTPS_GIT := https://github.com/classic-terra/core.git
1111
DOCKER := $(shell which docker)
1212
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
13+
GO_VERSION ?= "1.20"
1314

1415
#TESTNET PARAMETERS
1516
TESTNET_NVAL := $(if $(TESTNET_NVAL),$(TESTNET_NVAL),7)
@@ -135,6 +136,22 @@ build-linux-with-shared-library:
135136
docker cp temp:/lib/libwasmvm.so $(BUILDDIR)/
136137
docker rm temp
137138

139+
build-release-amd64: go.sum $(BUILDDIR)/
140+
$(DOCKER) buildx create --name core-builder || true
141+
$(DOCKER) buildx use core-builder
142+
$(DOCKER) buildx build \
143+
--platform linux/amd64 \
144+
-t core:local-amd64 \
145+
--load \
146+
-f Dockerfile .
147+
$(DOCKER) rm -f core-builder || true
148+
$(DOCKER) create -ti --name core-builder core:local-amd64
149+
mkdir -p build/release
150+
$(DOCKER) cp core-builder:/usr/local/bin/terrad $(BUILDDIR)/release/terrad
151+
tar -czvf $(BUILDDIR)/release/terra_$(VERSION)_Linux_x86_64.tar.gz -C $(BUILDDIR)/release/ terrad
152+
rm $(BUILDDIR)/release/terrad
153+
$(DOCKER) rm -f core-builder
154+
138155
install: go.sum
139156
go install -mod=readonly $(BUILD_FLAGS) ./cmd/terrad
140157

0 commit comments

Comments
 (0)