diff --git a/.github/scripts/release-docs.sh b/.github/scripts/release-docs.sh index a21e32406a34..1b8cdbcec6a9 100755 --- a/.github/scripts/release-docs.sh +++ b/.github/scripts/release-docs.sh @@ -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 diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c4c7ec72a819..feb1f4ff0cec 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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/upload-artifact@v4.3.3 with: name: otp_doc_html path: otp_doc_html.tar.gz + - name: Upload man documentation archive + uses: actions/upload-artifact@v4.3.0 + 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: @@ -603,6 +604,10 @@ jobs: uses: actions/download-artifact@v4.1.7 with: name: otp_doc_html + - name: Download man docs + uses: actions/download-artifact@v4.1.1 + with: + name: otp_doc_man ## We add the correct version name into the file names ## and create the hash files for all assets diff --git a/erts/man/.gitignore b/erts/man/.gitignore deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/make/doc.mk b/make/doc.mk index 2bf55851fa3d..887d67b875b0 100644 --- a/make/doc.mk +++ b/make/doc.mk @@ -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 @@ -68,15 +78,6 @@ $(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 @@ -84,6 +85,11 @@ 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 # ---------------------------------------------------- @@ -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: