Skip to content

Commit

Permalink
updating relase notes generation
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanejohnson committed Dec 9, 2022
1 parent cbf3133 commit 3af4f50
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ dist/
*.app
*.hugo_build.lock
*~

.RELEASE.CHANGELOG.md
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ LAST_TAG ?= $(shell git describe --tags --first-parent --abbrev=0)
# e.g. 1.5.5
VERSION ?= $(shell git describe --tags --first-parent --abbrev=0 | cut -c 2-)


# GOFLAGS is the flags for the go compiler.
GOFLAGS ?= -mod=vendor -ldflags "-X main.version=$(CUR_TAG)"

Expand Down Expand Up @@ -112,11 +113,19 @@ tag:
build/tag.sh

# gorelease runs goreleaser to build and publish the artifacts
.PHONY: gorelease
gorelease:
.PHONY: gorelease .RELEASE.CHANGELOG.md
gorelease: changelog
[ -x "$(GORELEASER)" ] || ( echo "goreleaser not installed"; exit 1)
GOVERSION=$(GOVERSION) goreleaser --rm-dist --release-notes=.RELEASE.CHANGELOG.md

.PHONY: goreleasedryrun
goreleasedryrun: changelog
[ -x "$(GORELEASER)" ] || ( echo "goreleaser not installed"; exit 1)
GOVERSION=$(GOVERSION) goreleaser --rm-dist
GOVERSION=$(GOVERSION) goreleaser --rm-dist --skip-publish --skip-validate --release-notes=.RELEASE.CHANGELOG.md

.PHONY: changelog
changelog:
RELEASE=$(CUR_TAG) build/releasenotes.pl <CHANGELOG.md > .RELEASE.CHANGELOG.md
# homebrew updates the brew recipe since goreleaser can only
# handle taps right now.
.PHONY: homebrew
Expand Down
9 changes: 9 additions & 0 deletions build/releasenotes.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env perl

use strict;

local $/;
$_ = <>;
if (/^### \[$ENV{RELEASE}.*?\n\s*(.*?)^### \[v/gms) {
print $1;
};

0 comments on commit 3af4f50

Please sign in to comment.