-
Notifications
You must be signed in to change notification settings - Fork 99
/
Makefile
59 lines (49 loc) · 1.38 KB
/
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
50
51
52
53
54
55
56
57
58
59
# TODO: use this for fetch-dist
TARGET_OBJS ?= todo1.txt todo2.txt
.PHONY: test
test: vendor check-encoding
./scripts/test.sh
.PHONY: covhtml
covhtml:
open .cover/coverage.html
.PHONY: acceptance
acceptance:
./scripts/acceptance.sh
.PHONY: clean
clean:
git status --ignored --short | grep '^!! ' | sed 's/!! //' | xargs rm -rf
.PHONY: check-encoding
check-encoding:
! find pkg examples -name "*.go" -type f -exec file "{}" ";" | grep CRLF
! find scripts -name "*.sh" -type f -exec file "{}" ";" | grep CRLF
.PHONY: fix-encoding
fix-encoding:
find pkg examples -type f -name "*.go" -exec sed -i -e "s/\r//g" {} +
find scripts -type f -name "*.sh" -exec sed -i -e "s/\r//g" {} +
.PHONY: vendor
vendor:
GO111MODULE=on go mod vendor
# TODO: use this
.PHONY: fetch-dist
fetch-dist:
mkdir -p _dist
cd _dist && \
for obj in ${TARGET_OBJS} ; do \
curl -sSL -o oras_${VERSION}_$${obj} https://github.com/oras-project/oras-go/releases/download/v${VERSION}/oras_${VERSION}_$${obj} ; \
done
# 1. mkdir _dist/
# 2. manually download .zip / .tar.gz from release page
# 3. move files into _dist/
# 4. make sign
# 5. upload .asc files back to release page
.PHONY: sign
sign:
for f in $$(ls _dist/*.{zip,tar.gz} 2>/dev/null) ; do \
gpg --armor --detach-sign $${f} ; \
done
.PHONY: checksums
checksums:
cd _dist/ && \
for f in $$(ls *.{zip,tar.gz} 2>/dev/null) ; do \
shasum -a 256 $${f} ; \
done