-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (36 loc) · 941 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: auth clean gem publish test
NAME?=data_services_api
OWNER?=epimorphics
VERSION?=$(shell ruby -e 'require "./lib/${NAME}/version" ; puts DataServicesApi::VERSION')
PAT?=$(shell read -p 'Github access token:' TOKEN; echo $$TOKEN)
AUTH=${HOME}/.gem/credentials
GEM=${NAME}-${VERSION}.gem
GPR=https://rubygems.pkg.github.com/${OWNER}
SPEC=${NAME}.gemspec
all: publish
${AUTH}:
@mkdir -p ${HOME}/.gem
@echo '---' > ${AUTH}
@echo ':github: Bearer ${PAT}' >> ${AUTH}
@chmod 0600 ${AUTH}
${GEM}: ${SPEC} ./lib/${NAME}/version.rb
gem build ${SPEC}
auth: ${AUTH}
build: gem
gem: ${GEM}
@echo ${GEM}
test: gem
@bundle install
@bundle exec rake test
publish: ${AUTH} ${GEM}
@echo Publishing package ${NAME}:${VERSION} to ${OWNER} ...
@gem push --key github --host ${GPR} ${GEM}
@echo Done.
clean:
@rm -rf ${GEM}
realclean: clean
@rm -rf ${AUTH}
tags:
@echo name=${NAME}
@echo owner=${OWNER}
@echo version=${VERSION}