Skip to content

feat: add upload assets to doc-build - #467

Merged
SMoraisAnsys merged 27 commits into
mainfrom
feat/doc-build-upload-assets
Jun 11, 2024
Merged

SMoraisAnsys merged 27 commits into
mainfrom
feat/doc-build-upload-assets

Conversation

@SMoraisAnsys

@SMoraisAnsys SMoraisAnsys commented Apr 19, 2024 •

Copy link
Copy Markdown
Contributor

Some repos are using an extra step in the documentation build to add download assets to the HTML documentation.
See for example assets page where the assets are listed and a button has been added to download PDF files from HTML documentation.

This PR adds extra steps to zip / copy / paste files to the expected directory doc/_build/html/_static/assets/download.
Build files are expected to be in doc/_build. The PDF file name is expected to be PROJECT_NAME.pdf where PROJECT_NAME is obtained by looking at the project variable in doc/conf.py file. If the file is not found, then every PDF file created in doc/_build/latex will be copy pasted.

Closes #466

@ansys-reviewer-bot

Copy link
Copy Markdown
Contributor

Thanks for opening a Pull Request. If you want to perform a review write a comment saying:

@ansys-reviewer-bot review

@github-actions github-actions Bot added the enhancement General improvements to existing features label Apr 19, 2024
@RobPasMue

Copy link
Copy Markdown
Member

Isn't there a way to read the BUILD_DIR variable? That way we don't hardcode it to doc/_build

@SMoraisAnsys

Copy link
Copy Markdown
Contributor Author

Isn't there a way to read the BUILD_DIR variable? That way we don't hardcode it to doc/_build

We could parse the make.bat or Makefile but if one uses another variable name in the script file, the problem would remain.
Though, as we share the "same" pattern for doc scripts, we could try to retrieve that information and direct to doc/_build if BUILD_DIR is not defined.

@RobPasMue

Copy link
Copy Markdown
Member

Ah, no need. I see we are uploading artifacts from a hardcoded direction doc/_build/html so all good. You can assume that directory exists

Comment thread _doc-build-windows/action.yml Resolved
@RobPasMue

Copy link
Copy Markdown
Member

@SMoraisAnsys - do we have any expected date for this?

SMoraisAnsys and others added 2 commits May 31, 2024 15:39
Changes include:
- leveraging conf.py to determine PDF filename
- using 'shared' python script to sanitize PDF filename

@SMoraisAnsys SMoraisAnsys left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be performed once the action is tested and ready

Comment thread doc-build/action.yml Resolved
Comment thread doc-build/action.yml Resolved
@SMoraisAnsys
SMoraisAnsys marked this pull request as ready for review June 3, 2024 12:25
@SMoraisAnsys
SMoraisAnsys requested a review from a team as a code owner June 3, 2024 12:25
@SMoraisAnsys

Copy link
Copy Markdown
Contributor Author

Changes have been tested on pyedb, see https://github.com/ansys/pyedb/actions/runs/8968715375 (note that this run was executed before the last commit which makes this action point to the main branch instead of feat/doc-build-upload-assets)

@SMoraisAnsys

Copy link
Copy Markdown
Contributor Author

@SMoraisAnsys - do we have any expected date for this?

@RobPasMue Feel free to have a look. The action changed a bit and doesn't leverage the pyproject.toml file anymore (because documentation project don't have a pyproject.toml file). Instead we parse the doc/conf.py file to retrieve the value of project and sanitize it.

@RobPasMue

Copy link
Copy Markdown
Member

Let me check whenever I get the chance :)

@RobPasMue RobPasMue left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM!

Comment thread _doc-build-linux/action.yml Resolved
Comment thread _doc-build-windows/action.yml Resolved
Co-authored-by: Roberto Pastor Muela <[email protected]>
@RobPasMue

Copy link
Copy Markdown
Member

Is it ready to merge?

@SMoraisAnsys

SMoraisAnsys commented Jun 5, 2024 •

Copy link
Copy Markdown
Contributor Author

Is it ready to merge?

Yep, didn't wanted to merge it myself to let others have a look. I tested it on pyedb and it worked fine for windows and linux.
If you want to have a look, see ansys/pyedb#267

@RobPasMue

Copy link
Copy Markdown
Member

looks like it works fine. Let's merge and release then

@RobPasMue

Copy link
Copy Markdown
Member

Unless... @ansys/pyansys-core - any complaints?

@clatapie clatapie left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me as well!

Comment thread _doc-build-linux/action.yml Resolved
Co-authored-by: Revathy Venugopal <[email protected]>
Comment thread doc-build/parse_doc_conf.py Resolved
@SMoraisAnsys SMoraisAnsys mentioned this pull request Jun 6, 2024
2 of 8 tasks
Comment thread doc-build/parse_doc_conf.py Resolved
@RobPasMue

Copy link
Copy Markdown
Member

Can we get this merged and released?

@SMoraisAnsys

Copy link
Copy Markdown
Contributor Author

Can we get this merged and released?

I'm waiting for this feature as much as you haha !

@RobPasMue

Copy link
Copy Markdown
Member

What's missing??

@SMoraisAnsys

Copy link
Copy Markdown
Contributor Author

What's missing??

Nothing, I just though that I wasn't the one that should merge the PR.

@SMoraisAnsys
SMoraisAnsys merged commit b0d8045 into main Jun 11, 2024
@SMoraisAnsys
SMoraisAnsys deleted the feat/doc-build-upload-assets branch June 11, 2024 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement General improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend doc-build action with asset upload

5 participants