-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce new workflow creating a downloadable version of the documentation #3417
Merged
Merged
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
211226c
Revert "rtd: enable htmlzip build (#3355)"
behackl 441d38d
use python3.11 to build docs
behackl 332c3e8
upgrade python version used in release publish workflow
behackl f10c19d
new workflow for building downloadable docs
behackl eef701c
change event trigger for testing
behackl cbe2fe9
sudo apt
behackl 3dacaab
rename release job; build html in poetry env
behackl 740d85e
set GITHUB_PATH instead of PATH
behackl b0d20be
introduce additional step
behackl da4fbcd
use correct binary path
behackl 6f05fdf
forgot microtype
behackl d452a9c
fonts-roboto + actually compress files correctly
behackl cb6fc47
fix asset path
behackl f316c1e
Update .github/workflows/release-publish-documentation.yml
behackl 4c6063a
pull_request -> workflow_dispatch
behackl 51ec1df
Merge branch 'main' into fix-docbuild-zip
naveen521kk cbc5c51
Update .github/workflows/release-publish-documentation.yml
naveen521kk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Publish downloadable documentation | ||
|
||
on: | ||
release: | ||
types: [released] | ||
pull_request: | ||
branches: [main, fix-docbuild-zip] | ||
|
||
jobs: | ||
build-and-publish-htmldocs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt update && sudo apt install -y \ | ||
pkg-config libcairo-dev libpango1.0-dev ffmpeg wget fonts-roboto | ||
wget -qO- "https://yihui.org/tinytex/install-bin-unix.sh" | sh | ||
echo ${HOME}/.TinyTeX/bin/x86_64-linux >> $GITHUB_PATH | ||
|
||
- name: Install LaTeX and Python dependencies | ||
run: | | ||
tlmgr install \ | ||
babel-english ctex doublestroke dvisvgm frcursive fundus-calligra jknapltx \ | ||
mathastext microtype physics preview ragged2e relsize rsfs setspace standalone \ | ||
wasy wasysym | ||
python -m pip install --upgrade poetry | ||
poetry install | ||
|
||
- name: Build and package documentation | ||
run: | | ||
cd docs/ | ||
poetry run make html | ||
cd build/html/ | ||
tar -czvf ../html-docs.tar.gz * | ||
|
||
- name: Store artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: /home/runner/work/manim/manim/docs/build/html-docs.tar.gz | ||
naveen521kk marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: html-docs.tar.gz | ||
|
||
- name: Install Dependency | ||
run: pip install requests | ||
|
||
- name: Get Upload URL | ||
if: github.event == 'release' | ||
id: create_release | ||
shell: python | ||
env: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag_act: ${{ github.ref }} | ||
run: | | ||
import requests | ||
import os | ||
ref_tag = os.getenv('tag_act').split('/')[-1] | ||
access_token = os.getenv('access_token') | ||
headers = { | ||
"Accept":"application/vnd.github.v3+json", | ||
"Authorization": f"token {access_token}" | ||
} | ||
url = f"https://api.github.com/repos/ManimCommunity/manim/releases/tags/{ref_tag}" | ||
c = requests.get(url,headers=headers) | ||
upload_url=c.json()['upload_url'] | ||
with open(os.getenv('GITHUB_OUTPUT'), 'w') as f: | ||
print(f"upload_url={upload_url}", file=f) | ||
print(f"tag_name={ref_tag[1:]}", file=f) | ||
|
||
- name: Upload Release Asset | ||
if: github.event == 'release' | ||
id: upload-release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: /home/runner/work/manim/manim/docs/build/html-docs.tar.gz | ||
behackl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
asset_name: manim-htmldocs-${{ steps.create_release.outputs.tag_name }}.tar.gz | ||
asset_content_type: application/gzip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,4 @@ | ||
version: 2 | ||
|
||
formats: | ||
- htmlzip | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add a
workflow_dispatch
event here? Also, I think we can also run this on every push and remove the pull-request target since readthedocs builds it anyway.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! I think running on every push is overkill, but the
pull_request
trigger was just to test this here. I've replaced it withworkflow_dispatch
. 👍Done in 4c6063a.