ci: Fix man page build
This commit is contained in:
parent
af28a0ca07
commit
170417f974
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: $0 <output-dir> <input-file>..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
outdir="$1"
|
||||
shift
|
||||
|
||||
for input in "$@"; do
|
||||
echo "Building $input.."
|
||||
asciidoctor --doctype manpage --backend manpage --destination-dir "$outdir" "$input"
|
||||
done
|
||||
|
|
@ -1,19 +1,45 @@
|
|||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
set -e
|
||||
|
||||
# Attempt to install `asciidoctor` on Debian, Arch Linux and MacOS.
|
||||
install() {
|
||||
os="$(uname)"
|
||||
|
||||
case "$os" in
|
||||
Linux)
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
# Debian
|
||||
apt-get update
|
||||
apt-get install -y asciidoctor
|
||||
elif command -v pacman >/dev/null 2>&1; then
|
||||
# Arch Linux
|
||||
pacman -Sy --noconfirm asciidoctor
|
||||
fi ;;
|
||||
Darwin) # MacOS
|
||||
if command -v brew >/dev/null 2>&1; then
|
||||
brew install asciidoctor
|
||||
fi ;;
|
||||
*)
|
||||
echo "fatal: unknown operating system: $os"
|
||||
exit 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
main () {
|
||||
if [[ $# -ne 1 ]]; then
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "$#: Wrong number of arguments"
|
||||
return 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local target=$1
|
||||
if ! command -v asciidoctor >/dev/null 2>&1; then
|
||||
install
|
||||
fi
|
||||
|
||||
target="$1"
|
||||
rustup target add "$target"
|
||||
|
||||
local staging="radicle-$target"
|
||||
staging="radicle-$target"
|
||||
mkdir -p "$staging"
|
||||
|
||||
cargo build --target="$target" --package=radicle-httpd --release
|
||||
|
|
@ -28,7 +54,7 @@ main () {
|
|||
cargo build --target="$target" --bin git-remote-rad --release
|
||||
cp target/"$target"/release/git-remote-rad "$staging"/
|
||||
|
||||
./build-man-pages.sh "$staging" "$(find . -name '*.1.adoc')"
|
||||
scripts/build-man-pages.sh "$staging" "$(find . -name '*.1.adoc')"
|
||||
|
||||
tar czf "$staging.tar.gz" "$staging"
|
||||
cp "$staging.tar.gz" "$staging"/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
main() {
|
||||
if [ $# -lt 2 ]; then
|
||||
echo "usage: $0 <output-dir> <input-file>..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
outdir="$1"
|
||||
shift
|
||||
|
||||
for input in "$@"; do
|
||||
echo "Building $input.."
|
||||
asciidoctor --doctype manpage --backend manpage --destination-dir "$outdir" "$input"
|
||||
done
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Loading…
Reference in New Issue