~kt/udprelay

863a1618aa79bec655b74238c78db42cfafa7271 — Katie Wolfe 4 months ago e0cf99f
Add Makefile rule to generate .txt files for man pages
2 files changed, 14 insertions(+), 3 deletions(-)

M .build.yml
M Makefile
M .build.yml => .build.yml +7 -2
@@ 4,6 4,8 @@ packages:
- go
- musl-dev
- curl
- groff
- util-linux # col command for stripping plaintext output from groff
sources:
- https://git.sr.ht/~kt/udprelay
secrets:


@@ 12,13 14,13 @@ tasks:
- build: |
    cd udprelay
    go get -v .
    make docs
    make docs docs-text
    make udprelay-linux-386
    make udprelay-linux-amd64
    make udprelay-linux-arm64
- upload: |
    ref="$(git -C udprelay describe --exact-match HEAD)" || exit 0
    for f in udprelay/{udprelay-linux-*,udprelay.{1,7}}; do
    for f in udprelay/{udprelay-linux-*,udprelay.{1,7}{,.txt}}; do
      filename="$(basename "${f}")"
      filename="udprelay-${ref}-${filename#udprelay-}"
      curl -H @.sr.ht.headers -F "file=@$f;filename=\"${filename}\"" "https://git.sr.ht/api/~kt/repos/udprelay/artifacts/${ref}"


@@ 28,4 30,7 @@ artifacts:
- udprelay/udprelay-linux-amd64
- udprelay/udprelay-linux-arm64
- udprelay/udprelay.1
- udprelay/udprelay.1.txt
- udprelay/udprelay.7
- udprelay/udprelay.7.txt


M Makefile => Makefile +7 -1
@@ 30,6 30,9 @@ $(PLATFORMS): *.go
list-binary-targets:
	@echo $(PLATFORMS)

%.txt: %
	groff -Tutf8 -man < $< | col -bx > $@

%: %.scd
ifdef VERSION
	sed '1 s/v\([0-9]\+\.\)\{2\}[0-9]\+/$(VERSION)/' $< | scdoc > $@


@@ 40,10 43,13 @@ endif
.PHONY: docs
docs: udprelay.1 udprelay.7

.PHONY: docs-text
docs-text: udprelay.1.txt udprelay.7.txt

.PHONY: deps
deps:
	@echo 'no dependencies :)'

.PHONY: clean
clean:
	rm -f udprelay.1 udprelay.7 udprelay $(PLATFORMS)
	rm -f udprelay.1 udprelay.1.txt udprelay.7 udprelay.7.txt udprelay $(PLATFORMS)