Skip to content

Commit

Permalink
Move Pages build logic to Make
Browse files Browse the repository at this point in the history
  • Loading branch information
lukateras committed Jan 3, 2025
1 parent eab27b0 commit 14f8e42
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ jobs:
steps:
- run: sudo apt install -y mandoc
- uses: actions/checkout@v4
- run: mkdir -p pub/man/
- run: mman -T html ./nanoid.3 > pub/man/nanoid.3.html
- run: mman -T html ./nanoidgen.1 > pub/man/nanoidgen.1.html
- run: mman -T pdf ./nanoid.3 ./nanoidgen.1 > pub/man.pdf
- run: mkdir -p pub/openbsd/man/
- run: mman -T html ./openbsd/nanoid.3 > pub/openbsd/man/nanoid.3.html
- run: mman -T pdf ./openbsd/nanoid.3 ./nanoidgen.1 > pub/openbsd/man.pdf
- run: make all
- uses: actions/upload-pages-artifact@v3
with:
path: pub
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/pub/
/nanoidgen
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
MANDOC ?= mandoc

default: nanoidgen

all: default pub/man.pdf pub/man/nanoid.3.html pub/man/nanoidgen.1.html \
pub/openbsd/man.pdf pub/openbsd/man/nanoid.3.html

pub:
mkdir -p $@

pub/man: pub
mkdir -p $@

pub/man.pdf: nanoid.3 nanoidgen.1 pub
$(MANDOC) -T pdf nanoid.3 nanoidgen.1 > $@

pub/man/%.html: % pub/man
$(MANDOC) -T html $< > $@

pub/openbsd: pub
mkdir -p $@

pub/openbsd/man: pub/openbsd
mkdir -p $@

pub/openbsd/man.pdf: openbsd/nanoid.3 nanoidgen.1 pub/openbsd
$(MANDOC) -T pdf openbsd/nanoid.3 nanoidgen.1 > $@

pub/openbsd/man/%.html: openbsd/% pub/openbsd/man
$(MANDOC) -T html $< > $@
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ support requires a [`getentropy(3)`][] shim.
To include [`nanoid(3)`][] copy [`nanoid.h`][] and [`LICENSE.txt`][] to your
project.

To build [`nanoidgen(1)`][] run `make nanoidgen`. (No `Makefile` required.)
To build [`nanoidgen(1)`][] run `make nanoidgen`.

To build and install the project use [Meson][]:

Expand Down
2 changes: 1 addition & 1 deletion openbsd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ support requires a [`getentropy(2)`][] shim.
To include [`nanoid(3)`][] copy [`nanoid.h`][] and [`LICENSE.txt`][] to your
project.

To build [`nanoidgen(1)`][] run `make nanoidgen`. (No `Makefile` required.)
To build [`nanoidgen(1)`][] run `make nanoidgen`.

To build and install the project use [Meson][]:

Expand Down

0 comments on commit 14f8e42

Please sign in to comment.