Skip to content

Commit

Permalink
update generated project files
Browse files Browse the repository at this point in the history
Signed-off-by: Jess Frazelle <[email protected]>
  • Loading branch information
jessfraz committed Mar 11, 2018
1 parent f6c03cb commit fd02fed
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,7 @@ Icon

bane
cross/

# Go coverage results
coverage.txt
profile.out
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
notifications:
email: true
go:
- stable
- 1.x
- tip
env:
global:
Expand All @@ -23,7 +23,10 @@
- test -z "$(golint ./... | grep -v vendor | tee /dev/stderr)"
- test -z "$(gofmt -s -l . | grep -v vendor | tee /dev/stderr)"
- go test $(go list ./... | grep -v vendor)
- make cover
- make release
after_success:
- bash <(curl -s https://codecov.io/bash)
deploy:
provider: releases
api_key:
Expand Down Expand Up @@ -64,5 +67,4 @@
- cross/bane-linux-amd64
skip_cleanup: true
on:
go: stable
tags: true
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ENV GOPATH /go
RUN apk add --no-cache \
ca-certificates

COPY . /go/src/github.com/jessfraz/bane
COPY . /go/src/github.com/genuinetools/bane

RUN set -x \
&& apk add --no-cache --virtual .build-deps \
Expand All @@ -16,7 +16,7 @@ RUN set -x \
libc-dev \
libgcc \
make \
&& cd /go/src/github.com/jessfraz/bane \
&& cd /go/src/github.com/genuinetools/bane \
&& make static \
&& mv bane /usr/bin/bane \
&& apk del .build-deps \
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2018 Jessica Frazelle
Copyright (c) 2018 The Genuinetools Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 19 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PREFIX?=$(shell pwd)

# Setup name variables for the package/tool
NAME := bane
PKG := github.com/jessfraz/$(NAME)
PKG := github.com/genuinetools/$(NAME)

# Set any default go build tags
BUILDTAGS :=
Expand All @@ -13,7 +13,7 @@ BUILDDIR := ${PREFIX}/cross

# Populate version variables
# Add to compile time flags
VERSION := $(shell cat VERSION)
VERSION := $(shell cat VERSION.txt)
GITCOMMIT := $(shell git rev-parse --short HEAD)
GITUNTRACKEDCHANGES := $(shell git status --porcelain --untracked-files=no)
ifneq ($(GITUNTRACKEDCHANGES),)
Expand All @@ -31,7 +31,7 @@ all: clean build fmt lint test staticcheck vet install ## Runs a clean, build, f
.PHONY: build
build: $(NAME) ## Builds a dynamic executable or package

$(NAME): *.go VERSION
$(NAME): *.go VERSION.txt
@echo "+ $@"
go build -tags "$(BUILDTAGS)" ${GO_LDFLAGS} -o $(NAME) .

Expand Down Expand Up @@ -67,6 +67,17 @@ staticcheck: ## Verifies `staticcheck` passes
@echo "+ $@"
@staticcheck $(shell go list ./... | grep -v vendor) | grep -v '.pb.go:' | tee /dev/stderr

.PHONY: cover
cover: ## Runs go test with coverage
@echo "" > coverage.txt
@for d in $(shell go list ./... | grep -v vendor); do \
go test -race -coverprofile=profile.out -covermode=atomic "$$d"; \
if [ -f profile.out ]; then \
cat profile.out >> coverage.txt; \
rm profile.out; \
fi; \
done;

.PHONY: install
install: ## Installs the executable or package
@echo "+ $@"
Expand All @@ -83,7 +94,7 @@ sha256sum $(BUILDDIR)/$(1)/$(2)/$(NAME) > $(BUILDDIR)/$(1)/$(2)/$(NAME).sha256;
endef

.PHONY: cross
cross: *.go VERSION ## Builds the cross-compiled binaries, creating a clean directory structure (eg. GOOS/GOARCH/binary)
cross: *.go VERSION.txt ## Builds the cross-compiled binaries, creating a clean directory structure (eg. GOOS/GOARCH/binary)
@echo "+ $@"
$(foreach GOOSARCH,$(GOOSARCHES), $(call buildpretty,$(subst /,,$(dir $(GOOSARCH))),$(notdir $(GOOSARCH))))

Expand All @@ -97,7 +108,7 @@ sha256sum $(BUILDDIR)/$(NAME)-$(1)-$(2) > $(BUILDDIR)/$(NAME)-$(1)-$(2).sha256;
endef

.PHONY: release
release: *.go VERSION ## Builds the cross-compiled binaries, naming them in such a way for release (eg. binary-GOOS-GOARCH)
release: *.go VERSION.txt ## Builds the cross-compiled binaries, naming them in such a way for release (eg. binary-GOOS-GOARCH)
@echo "+ $@"
$(foreach GOOSARCH,$(GOOSARCHES), $(call buildrelease,$(subst /,,$(dir $(GOOSARCH))),$(notdir $(GOOSARCH))))

Expand All @@ -106,11 +117,11 @@ BUMP := patch
bump-version: ## Bump the version in the version file. Set BUMP to [ patch | major | minor ]
@go get -u github.com/jessfraz/junk/sembump # update sembump tool
$(eval NEW_VERSION = $(shell sembump --kind $(BUMP) $(VERSION)))
@echo "Bumping VERSION from $(VERSION) to $(NEW_VERSION)"
echo $(NEW_VERSION) > VERSION
@echo "Bumping VERSION.txt from $(VERSION) to $(NEW_VERSION)"
echo $(NEW_VERSION) > VERSION.txt
@echo "Updating links to download binaries in README.md"
sed -i s/$(VERSION)/$(NEW_VERSION)/g README.md
git add VERSION README.md
git add VERSION.txt README.md
git commit -vsam "Bump version to $(NEW_VERSION)"
@echo "Run make tag to create and push the tag for new version $(NEW_VERSION)"

Expand Down
File renamed without changes.

0 comments on commit fd02fed

Please sign in to comment.