...

Text file src/oras.land/oras-go/Makefile

Documentation: oras.land/oras-go

     1# TODO: use this for fetch-dist
     2TARGET_OBJS ?= todo1.txt todo2.txt
     3
     4.PHONY: test
     5test: vendor check-encoding
     6	./scripts/test.sh
     7
     8.PHONY: covhtml
     9covhtml:
    10	open .cover/coverage.html
    11
    12.PHONY: acceptance
    13acceptance:
    14	./scripts/acceptance.sh
    15
    16.PHONY: clean
    17clean:
    18	git status --ignored --short | grep '^!! ' | sed 's/!! //' | xargs rm -rf
    19
    20.PHONY: check-encoding
    21check-encoding:
    22	! find pkg examples -name "*.go" -type f -exec file "{}" ";" | grep CRLF
    23	! find scripts -name "*.sh" -type f -exec file "{}" ";" | grep CRLF
    24
    25.PHONY: fix-encoding
    26fix-encoding:
    27	find pkg examples -type f -name "*.go" -exec sed -i -e "s/\r//g" {} +
    28	find scripts -type f -name "*.sh" -exec sed -i -e "s/\r//g" {} +
    29
    30.PHONY: vendor
    31vendor:
    32	GO111MODULE=on go mod vendor
    33
    34# TODO: use this
    35.PHONY: fetch-dist
    36fetch-dist:
    37	mkdir -p _dist
    38	cd _dist && \
    39	for obj in ${TARGET_OBJS} ; do \
    40		curl -sSL -o oras_${VERSION}_$${obj} https://github.com/oras-project/oras-go/releases/download/v${VERSION}/oras_${VERSION}_$${obj} ; \
    41	done
    42
    43# 1. mkdir _dist/
    44# 2. manually download .zip / .tar.gz from release page
    45# 3. move files into _dist/
    46# 4. make sign
    47# 5. upload .asc files back to release page
    48.PHONY: sign
    49sign:
    50	for f in $$(ls _dist/*.{zip,tar.gz} 2>/dev/null) ; do \
    51		gpg --armor --detach-sign $${f} ; \
    52	done
    53
    54.PHONY: checksums
    55checksums:
    56	cd _dist/ && \
    57	for f in $$(ls *.{zip,tar.gz} 2>/dev/null) ; do \
    58		shasum -a 256 $${f} ; \
    59	done

View as plain text