Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chamber-$(VERSION).sha256sums generation #126

Merged
merged 1 commit into from
Sep 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,27 @@ release: gh-release clean dist
--name chamber-$(VERSION)-linux-amd64 \
--file dist/chamber-$(VERSION)-linux-amd64

github-release upload \
--security-token $$GH_LOGIN \
--user segmentio \
--repo chamber \
--tag $(VERSION) \
--name chamber-$(VERSION).sha256sums \
--file dist/chamber-$(VERSION).sha256sums

clean:
rm -rf ./dist

dist:
mkdir dist
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o dist/chamber-$(VERSION)-darwin-amd64
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build $(LDFLAGS) -o dist/chamber-$(VERSION)-linux-amd64
@which sha256sum 2>&1 > /dev/null || ( \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not especially proud of this platform-specific code. Improvements appreciated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could use shasum -a 256 on mac instead of requiring sha256sum. is that what you meant by platform-specific code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was hoping to find some program that'd work cross platform. I've heard of shasum creating subtly incompatible sum files (maybe unfounded rumours), so it'd be nice to stick to one. I bet this shell code could be nicer maybe, and error earlier? I dunno. Good enough I guess.

echo 'missing sha256sum; install on MacOS with `brew install coreutils && ln -s $$(which gsha256sum) /usr/local/bin/sha256sum`' ; \
exit 1; \
)
cd dist && \
sha256sum chamber-$(VERSION)-* > chamber-$(VERSION).sha256sums

gh-release:
go get -u github.com/aktau/github-release
Expand Down