Skip to content

Commit

Permalink
Release auto-generator, bump
Browse files Browse the repository at this point in the history
  • Loading branch information
mperham committed Oct 11, 2018
1 parent 4ca3671 commit 71472bc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
24 changes: 24 additions & 0 deletions .github/notes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require 'erb'

# GitHub release notes auto-generator
# Use like `ruby notes.rb 0.9.0`
raise "invalid arguments" unless ARGV.size == 1
bigver = ARGV[0]
shortver = bigver.gsub(/[^0-9]/, "")
title = bigver
sums = {}

Dir["packaging/output/systemd/*"].each do |fullname|
name = File.basename(fullname)

output = `shasum -p -a 256 #{fullname}`
if $?.exitstatus != 0
raise output
end
sums[name] = output.split[0]
end

content = ERB.new(File.read(".github/release-notes.md.erb"), nil, '-').result(binding)
File.open("/tmp/release-notes.md", "w") do |file|
file.write(content)
end
11 changes: 11 additions & 0 deletions .github/release-notes.md.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<%= title %>

Notable changes can be found in the [Faktory changelog](/contribsys/faktory/blob/master/Changes.md#<%= shortver %>).

| Filename | SHA256 |
| --- | --- |
<% sums.each do |filename, sum| -%>
| <%= filename %> | <%= sum %> |
<% end -%>

Verify with `shasum -p -a 256 <filename>`.
2 changes: 1 addition & 1 deletion Changes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Faktory Changelog

## 0.9.0-beta
## 0.9.0

- Switch Faktory from RocksDB to Redis for storage. [#160]
- Implement Faktory-internal middleware hooks [#168]
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ NAME=faktory
VERSION=0.9.0

# when fixing packaging bugs but not changing the binary, we increment ITERATION
ITERATION=beta3
ITERATION=1
BASENAME=$(NAME)_$(VERSION)-$(ITERATION)

TEST_FLAGS=-parallel 4
Expand All @@ -18,10 +18,13 @@ endif
all: test

release: clean test package tag
@echo Generating release notes
ruby .github/notes.rb $(VERSION)
@echo Releasing $(NAME) $(VERSION)-$(ITERATION)
hub release create v$(VERSION)-$(ITERATION) \
-a packaging/output/systemd/$(NAME)_$(VERSION)-$(ITERATION)_amd64.deb \
-a packaging/output/systemd/$(NAME)-$(VERSION)-$(ITERATION).x86_64.rpm -m "v$(VERSION)-$(ITERATION)" -p
-a packaging/output/systemd/$(NAME)-$(VERSION)-$(ITERATION).x86_64.rpm \
-F /tmp/release-notes.md -e -o

prepare: ## Download all dependencies
@go get github.com/golang/dep/cmd/dep
Expand All @@ -46,8 +49,8 @@ dimg: ## Make a Docker image for the current version
docker build \
--build-arg GOLANG_VERSION=1.10.3 \
--tag contribsys/faktory:$(VERSION) \
--tag contribsys/faktory:latest \
.
#--tag contribsys/faktory:latest \

drun: ## Run Faktory in a local Docker image, see also "make dimg"
docker run --rm -it -e "FAKTORY_PASSWORD=${PASSWORD}" \
Expand All @@ -70,7 +73,7 @@ dmon: ## Run Faktory in a local Docker image, see also "make dimg"

dpush: tag
docker push contribsys/faktory:$(VERSION)
#docker push contribsys/faktory:latest
docker push contribsys/faktory:latest

generate:
go generate github.com/contribsys/faktory/webui
Expand Down

0 comments on commit 71472bc

Please sign in to comment.