From 6dc9d8ab7781345e184558bd97a778b3cb7e806c Mon Sep 17 00:00:00 2001 From: Michal Zielenkiewicz Date: Thu, 7 Mar 2024 17:26:16 +0100 Subject: [PATCH] Align relese notes with other repositories --- .github/workflows/release.yaml | 5 +++++ .goreleaser.yaml | 5 ----- Makefile | 2 +- common.mk | 20 ++++++++++++++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5b114befe..f58deea53 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -34,6 +34,11 @@ jobs: run: | make release-build env: + # Instruct Make to create a real release. + NEXUS_REAL_RELEASE: "true" + # Pass automatically created GitHub App installation token to the action. + # For more info, see: + # https://help.github.com/en/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Prepare the tagged Docker image. diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 49f99e1bc..079d81ca9 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -35,8 +35,3 @@ release: # If set to auto, will mark the release as not ready for production # in case there is an indicator for this in the tag e.g. v1.0.0-rc1. prerelease: auto - - footer: | - **Full Changelog**: https://github.com/oasisprotocol/nexus/compare/{{ .PreviousTag }}...{{ .Tag }} - ### Running Nexus in Docker - https://github.com/oasisprotocol/nexus/blob/{{ .Tag }}/README.md#docker-development diff --git a/Makefile b/Makefile index 2870b95fe..8a4d5320c 100644 --- a/Makefile +++ b/Makefile @@ -215,7 +215,7 @@ release-tag: confirm-version @$(ECHO) "$(CYAN)*** Tag '$(RELEASE_TAG)' has been successfully pushed to $(GIT_ORIGIN_REMOTE) remote.$(OFF)" release-build: codegen-go - @goreleaser release --rm-dist + @goreleaser $(GORELEASER_ARGS) changelog: confirm-version @$(ECHO) "$(CYAN)*** Generating Change Log for version $(RELEASE_TAG)...$(OFF)" diff --git a/common.mk b/common.mk index 9247f2e5c..2cf84122f 100644 --- a/common.mk +++ b/common.mk @@ -205,3 +205,23 @@ define newline endef + +# GitHub release text in Markdown format. +define RELEASE_TEXT = +For a list of changes in this release, see the [Change Log]. + +*NOTE: If you are upgrading from an earlier release, please **carefully review** +the [Change Log] for **Removals and Breaking changes**.* + +[Change Log]: https://github.com/oasisprotocol/nexus/blob/v$(VERSION)/CHANGELOG.md + +endef + +GORELEASER_ARGS ?= release --rm-dist +# If the appropriate environment variable is set, create a real release. +ifeq ($(NEXUS_REAL_RELEASE), true) +# Create temporary file with GitHub release's text. +_RELEASE_NOTES_FILE := $(shell mktemp /tmp/nexus.XXXXX) +_ := $(shell printf "$(subst ",\",$(subst $(newline),\n,$(RELEASE_TEXT)))" > $(_RELEASE_NOTES_FILE)) +GORELEASER_ARGS = release --release-notes $(_RELEASE_NOTES_FILE) +endif