diff --git a/Makefile b/Makefile index aa3a7e5d3..c437f5ae3 100644 --- a/Makefile +++ b/Makefile @@ -215,8 +215,27 @@ ci: all verify test changelog: hack/changelog.sh +# release builds a GitHub release using goreleaser within the build container. +# +# To dry-run the release, which will build the binaries/artifacts locally but +# will *not* create a GitHub release: +# GITHUB_TOKEN=an-invalid-token-so-you-dont-accidentally-push-release \ +# RELEASE_NOTES_FILE=changelogs/CHANGELOG-1.2.md \ +# PUBLISH=false \ +# make release +# +# To run the release, which will publish a *DRAFT* GitHub release in github.com/vmware-tanzu/velero +# (you still need to review/publish the GitHub release manually): +# GITHUB_TOKEN=your-github-token \ +# RELEASE_NOTES_FILE=changelogs/CHANGELOG-1.2.md \ +# PUBLISH=true \ +# make release release: - hack/goreleaser.sh + $(MAKE) shell CMD="-c '\ + GITHUB_TOKEN=$(GITHUB_TOKEN) \ + RELEASE_NOTES_FILE=$(RELEASE_NOTES_FILE) \ + PUBLISH=$(PUBLISH) \ + ./hack/goreleaser.sh'" serve-docs: docker run \ diff --git a/hack/build-image/Dockerfile b/hack/build-image/Dockerfile index de978d6de..b7d0fa9ad 100644 --- a/hack/build-image/Dockerfile +++ b/hack/build-image/Dockerfile @@ -46,3 +46,7 @@ WORKDIR /go/src/github.com/golang RUN git clone -b v1.0.0 https://github.com/golang/protobuf WORKDIR /go/src/github.com/golang/protobuf RUN go install ./protoc-gen-go +RUN wget --quiet https://github.com/goreleaser/goreleaser/releases/download/v0.120.8/goreleaser_Linux_x86_64.tar.gz && \ + tar xvf goreleaser_Linux_x86_64.tar.gz && \ + mv goreleaser /usr/bin/goreleaser && \ + chmod +x /usr/bin/goreleaser