Skip to content

Commit

Permalink
Merge branch 'lukas/gh/reintroduce-man-page-releases' into maint
Browse files Browse the repository at this point in the history
* lukas/gh/reintroduce-man-page-releases:
  otp: Fix release of man pages
  otp: Add man pages to default doc target if available
  gh: Re-introduce build and release of man pages
  • Loading branch information
garazdawi committed Sep 2, 2024
2 parents 8641020 + 7d84491 commit ece5ad4
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/release-docs.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

docker run -v $PWD/:/github otp "make release docs release_docs && make release_docs DOC_TARGETS='man html pdf' RELEASE_ROOT=/github/docs"
docker run -v $PWD/:/github otp "make release docs release_docs && make release_docs DOC_TARGETS='man html' RELEASE_ROOT=/github/docs"
sudo chown -R `whoami` docs
cd docs
tar czf ../otp_doc_man.tar.gz man
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,16 +421,17 @@ jobs:
RUN make release docs release_docs && sudo make install-docs
EOF
- name: Release docs to publish
run: |
docker run -v $PWD/:/github otp \
"make release_docs DOC_TARGETS='html' RELEASE_ROOT=/github/docs"
sudo chown -R `whoami` docs
cd docs && tar czf ../otp_doc_html.tar.gz *
run: .github/scripts/release-docs.sh
- name: Upload html documentation archive
uses: actions/[email protected]
with:
name: otp_doc_html
path: otp_doc_html.tar.gz
- name: Upload man documentation archive
uses: actions/[email protected]
with:
name: otp_doc_man
path: otp_doc_man.tar.gz
- name: Trigger rebuild of erlang.org/docs/
if: github.ref_name == 'master' && github.repository == 'erlang/otp'
env:
Expand Down Expand Up @@ -603,6 +604,10 @@ jobs:
uses: actions/[email protected]
with:
name: otp_doc_html
- name: Download man docs
uses: actions/[email protected]
with:
name: otp_doc_man

## We add the correct version name into the file names
## and create the hash files for all assets
Expand Down
Empty file removed erts/man/.gitignore
Empty file.
41 changes: 24 additions & 17 deletions make/doc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,24 @@ else
EX_DOC_FORMATS=
endif

# ----------------------------------------------------
# Man dependencies
# ----------------------------------------------------
MAN1_DEPS?=$(wildcard */*_cmd.md)

MAN1_PAGES=$(MAN1_DEPS:references/%_cmd.md=$(MAN1DIR)/%.1)

# ----------------------------------------------------
# Targets
# ----------------------------------------------------
DEFAULT_DOC_TARGETS=html
ifneq ($(CHUNK_FILES),)
DOC_TARGETS?=html chunks
else
DOC_TARGETS?=html
DEFAULT_DOC_TARGETS+=chunks
endif
ifneq ($(MAN1_DEPS),)
DEFAULT_DOC_TARGETS+=man
endif
DOC_TARGETS?=$(DEFAULT_DOC_TARGETS)

EX_DOC_WARNINGS_AS_ERRORS?=true

Expand All @@ -68,22 +78,18 @@ $(HTMLDIR)/index.html: $(HTML_DEPS) docs.exs $(ERL_TOP)/make/ex_doc.exs

html: $(HTMLDIR)/index.html

$(TYPES):

clean clean_docs: clean_html
rm -rf $(EXTRA_FILES)

MAN1_DEPS?=$(wildcard */*_cmd.md)

MAN1_PAGES=$(MAN1_DEPS:references/%_cmd.md=$(MAN1DIR)/%.1)

man: $(MAN1_PAGES)

MARKDOWN_TO_MAN=$(ERL_TOP)/make/markdown_to_man.escript

man1/%.1: references/%_cmd.md $(MARKDOWN_TO_MAN)
escript$(EXEEXT) $(MARKDOWN_TO_MAN) -o $(MAN1DIR) $<

$(TYPES):

clean clean_docs: clean_html
rm -rf $(EXTRA_FILES)

# ----------------------------------------------------
# Release Target
# ----------------------------------------------------
Expand All @@ -100,17 +106,18 @@ ifneq ($(CHUNK_FILES),)
$(INSTALL_DATA) $(CHUNK_FILES) "$(RELSYSDIR)/doc/chunks"
endif

release_man_spec: man
ifneq ($(MAN1_DEPS),)
$(INSTALL_DIR) "$(RELSYS_MANDIR)/man1"
$(INSTALL_DIR_DATA) "$(MAN1DIR)" "$(RELSYS_MANDIR)/man1"
endif

release_docs_spec: $(DOC_TARGETS:%=release_%_spec)
ifneq ($(STANDARDS),)
$(INSTALL_DIR) "$(RELEASE_PATH)/doc/standard"
$(INSTALL_DATA) $(STANDARDS) "$(RELEASE_PATH)/doc/standard"
endif

release_man_spec: man
ifneq ($(wildcard man1/*.1),)
$(INSTALL_DIR) "$(RELSYS_MANDIR)/man1"
$(INSTALL_DIR_DATA) "$(MAN1DIR)" "$(RELSYS_MANDIR)/man1"
endif

release_spec:

Expand Down

0 comments on commit ece5ad4

Please sign in to comment.