diff --git a/.github/workflows/zenodo.yml b/.github/workflows/zenodo.yml index e6b71af33..42f43640f 100644 --- a/.github/workflows/zenodo.yml +++ b/.github/workflows/zenodo.yml @@ -35,6 +35,7 @@ jobs: run: | make generate-changes-html VERSION=${{ github.ref_name }} || true echo "ZENODO_DESCRIPTION=$(cat ${{ env.CHANGES_HTML }} | tr -d '\n' || echo '')" >> $GITHUB_ENV + cat ${{ env.CHANGES_HTML }} - name: Run Zenodo Publish id: deploy_zenodo diff --git a/Makefile b/Makefile index 4ae91606d..d2d81fef7 100644 --- a/Makefile +++ b/Makefile @@ -754,10 +754,10 @@ bump: ## bump version using VERSION specified as user input [make VERSION=> 'VERSION' is not set. It is required to extract changes."; exit 1 ) @-echo "Extracting changes for ${VERSION} ..." - @bash -c '\ + bash -c '\ START=$$(cat "$(APP_ROOT)/CHANGES.rst" | grep -n "crim-ca/weaver/tree/${VERSION}" | cut -d ":" -f 1); \ STOP=$$(tail -n +$$(($${START:-0} + 2)) "$(APP_ROOT)/CHANGES.rst" \ | grep -n ".. _changes" \ @@ -765,18 +765,26 @@ extract-changes: ## uses the specified VERSION to extract its sub-section in CHA tail -n +$${START:-0} "$(APP_ROOT)/CHANGES.rst" | head -n $${STOP:--1} \ > "$(REPORTS_DIR)/CHANGES_${VERSION}.rst" \ ' + @-echo "Generated changes: $(REPORTS_DIR)/CHANGES_${VERSION}.rst" +# note: +# some text must be inserted before and between the first 'version heading' and the 'changes' sub-heading +# otherwise headers levels are not parsed correctly (they are considered sections all using H1) +# therefore, inject the contents needed to parse as desired, and remove the temp HTML content afterwards .PHONY: generate-changes-html generate-changes-html: extract-changes ## extract CHANGES.rst section as HTML using the specified VERSION @[ "${VERSION}" ] || ( echo ">> 'VERSION' is not set. It is required to extract changes."; exit 1 ) - @-echo "Checking necessary Sphinx dependency ..." - @pip show sphinx >/dev/null || bash -c '$(CONDA_CMD) $(MAKE) -C "$(APP_ROOT)" install-doc' + @-echo "Checking necessary documentation dependency ..." + @which rst2html >/dev/null || pip install docutils @-echo "Converting changes for ${VERSION} ..." @echo '%(body)s' > "$(REPORTS_DIR)/html-body-template.txt" + @sed -i -e 's|Changes:|\\ \n\nChanges:|' "$(REPORTS_DIR)/CHANGES_${VERSION}.rst" + @sed -i -e "s|^\`${VERSION}| \n###\n\n\\ \n\n\`${VERSION}|" "$(REPORTS_DIR)/CHANGES_${VERSION}.rst" @rst2html \ --template "$(REPORTS_DIR)/html-body-template.txt" \ "$(REPORTS_DIR)/CHANGES_${VERSION}.rst" "$(REPORTS_DIR)/CHANGES_${VERSION}.html" - @-echo "Generates changes: $(REPORTS_DIR)/CHANGES_${VERSION}.html" + @sed -i -e 's|

###

||' "$(REPORTS_DIR)/CHANGES_${VERSION}.html" + @-echo "Generated changes: $(REPORTS_DIR)/CHANGES_${VERSION}.html" .PHONY: generate-archive generate-archive: ## generate ZIP and TAR.GZ archives using current contents @@ -789,6 +797,7 @@ generate-archive: ## generate ZIP and TAR.GZ archives using current contents --exclude-vcs-ignores \ --exclude=*.zip \ --exclude=*.tar.gz \ + --exclude="$(APP_NAME)-$(APP_VERSION).tar.gz" \ -cvzf "$(APP_NAME)-$(APP_VERSION).tar.gz" \ --transform 's,^\.,$(APP_NAME)-$(APP_VERSION),' \ . diff --git a/README.rst b/README.rst index 9113ba3ed..3eab195dc 100644 --- a/README.rst +++ b/README.rst @@ -116,9 +116,9 @@ for each process. :target: https://app.fossa.com/projects/git%2Bgithub.com%2Fcrim-ca%2Fweaver?ref=badge_shield&issueType=license :alt: FOSSA Status -.. |citation-zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.14210718.svg +.. |citation-zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.14210717.svg :alt: Zenodo DOI - :target: https://zenodo.org/doi/10.5281/zenodo.14210718 + :target: https://zenodo.org/doi/10.5281/zenodo.14210717 .. |citation-cff| image:: https://img.shields.io/badge/citation-cff-blue :alt: CFF