Skip to content

Commit

Permalink
chore: add release commands to Makefile (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs authored Sep 11, 2024
1 parent 3826c1b commit 00eb247
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,40 @@ install: go.sum ## Installs the roller binary
.PHONY: build
build: ## Compiles the roller binary
go build -o build/roller $(BUILD_FLAGS) .

###############################################################################
### Releasing ###
###############################################################################

PACKAGE_NAME:=github.com/dymensionxyz/roller
GOLANG_CROSS_VERSION = v1.23
GOPATH ?= '$(HOME)/go'
release-dry-run:
docker run \
--rm \
--privileged \
-e CGO_ENABLED=1 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-v ${GOPATH}/pkg:/go/pkg \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
--clean --skip=validate --skip=publish --snapshot

release:
@if [ ! -f ".release-env" ]; then \
echo "\033[91m.release-env is required for release\033[0m";\
exit 1;\
fi
docker run \
--rm \
--privileged \
-e CGO_ENABLED=1 \
--env-file .release-env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
-w /go/src/$(PACKAGE_NAME) \
ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
release --clean --skip=validate

.PHONY: release-dry-run release

0 comments on commit 00eb247

Please sign in to comment.