forked from ukparliament/parliament-ruby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (25 loc) · 777 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
.PHONY: checkout_to_release
# Github variables
GITHUB_API=https://api.github.com
ORG=ukparliament
REPO=parliament-ruby
LATEST_REL=$(GITHUB_API)/repos/$(ORG)/$(REPO)/releases
REL_TAG=$(shell curl -s $(LATEST_REL) | jq -r '.[0].tag_name')
checkout_to_release:
git checkout -b release $(REL_TAG)
checkout_to_pull_request:
git fetch origin refs/pull/$(PULL_REQUEST_NUMBER)/merge
git checkout $(shell git show-ref –s refs/pull/$(PULL_REQUEST_NUMBER)/merge)
gemset:
rvm gemset create parliament-ruby
rvm --force gemset empty parliament-ruby
rvm gemset use parliament-ruby
test: gemset
bundle install
bundle exec rake
build:
rm -f parliament-ruby-*.gem
gem build parliament-ruby.gemspec
release: build test
gem push parliament-ruby-*.gem
rm parliament-ruby-*.gem