Skip to content

Commit

Permalink
Only error if GITHUB_TOKEN missing for releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Nov 4, 2018
1 parent 0df5a5d commit ecc3a29
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@ install: setup data generate
go install

release: setup-release
ifndef GITHUB_TOKEN
$(error GITHUB_TOKEN must be defined)
endif
@: $(if ${GITHUB_TOKEN},,$(error GITHUB_TOKEN must be defined))
git tag -a $(VERSION) -m "$(VERSION)"
git push origin $(VERSION)
goreleaser --rm-dist --parallelism 1 || (git tag -d $(VERSION) && git push --delete origin $(VERSION))

autorelease: install
ifndef GITHUB_TOKEN
$(error GITHUB_TOKEN must be defined)
endif
@: $(if ${GITHUB_TOKEN},,$(error GITHUB_TOKEN must be defined))
git add . && git diff --cached --exit-code || \
( \
echo 'New data files found, updating...' \
&& git commit -m "Update data files" \
&& git push origin master \
&& $(MAKE) release VERSION=v1.0.$$(date +%s)\
&& GITHUB_TOKEN="${GITHUB_TOKEN}" $(MAKE) release VERSION=v1.0.$$(date +%s)\
)

data:
Expand Down

0 comments on commit ecc3a29

Please sign in to comment.