-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: migrate to pyansys/actions and include get_version_match funct…
…ion (#153) * Add default position for version switcher * use pyansys actions * change the workflow name * change the workflow names * Add version in conf * Change lib name * Add queue for build * add version match fn in theme * Add context * give default version to the switcher * Update init file * delete version html file * CI: update workflows Co-authored-by: Jorge Martinez Garrido <[email protected]>
- Loading branch information
1 parent
7ff17bd
commit 1397b1b
Showing
4 changed files
with
83 additions
and
115 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,147 +7,99 @@ on: | |
- "*" | ||
branches: | ||
- main | ||
env: | ||
MAIN_PYTHON_VERSION : '3.10' | ||
PACKAGE_NAME: 'ansys-sphinx-theme' | ||
PACKAGE_NAMESPACE: 'ansys_sphinx_theme' | ||
DOCUMENTATION_CNAME: 'sphinxdocs.ansys.com' | ||
|
||
jobs: | ||
|
||
style: | ||
code-style: | ||
name: Code style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- name: "Run PyAnsys code style checks" | ||
uses: pyansys/actions/code-style@v1 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip tox | ||
- name: Test with tox | ||
run: tox -e style | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
docs-style: | ||
name: Documentation Style Check | ||
doc-style: | ||
name: Doc style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Running Vale | ||
uses: errata-ai/vale-action@reviewdog | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- name: "Run Ansys documentation style checks" | ||
uses: pyansys/actions/doc-style@v1 | ||
with: | ||
files: doc | ||
reporter: github-pr-check | ||
level: error | ||
filter_mode: nofilter | ||
fail_on_error: true | ||
vale_flags: "--config=doc/.vale.ini" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
docs: | ||
name: Documentation | ||
doc-build: | ||
name: Doc building | ||
runs-on: ubuntu-latest | ||
needs: docs-style | ||
needs: doc-style | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt-get install -y build-essential zip pandoc texlive-latex-extra latexmk texlive-pstricks | ||
python -m pip install --upgrade pip tox | ||
python -m pip install -r requirements/requirements_doc.txt | ||
python -m pip install --editable . | ||
- name: Build HTML documentation | ||
run: tox -e doc | ||
|
||
- name: Upload HTML Documentation | ||
uses: actions/[email protected] | ||
- name: "Run Ansys documentation building action" | ||
uses: pyansys/actions/doc-build@v1 | ||
with: | ||
name: HTML-Documentation | ||
path: .tox/doc_out/ | ||
retention-days: 7 | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
- name: Build PDF Documentation | ||
run: | | ||
make -C doc pdf | ||
- name: Upload PDF Documentation | ||
uses: actions/[email protected] | ||
doc-deploy-development: | ||
name: Doc dev version deploy | ||
if: github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
needs: doc-build | ||
steps: | ||
- name: "Deploy developers documentation" | ||
uses: pyansys/actions/doc-deploy-dev@v1 | ||
with: | ||
name: PDF-Documentation | ||
path: doc/build/latex/ansys_sphinx_theme.pdf | ||
retention-days: 7 | ||
cname: ${{ env.DOCUMENTATION_CNAME }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Deploy to gh-pages | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | ||
uses: JamesIves/[email protected] | ||
doc-deploy-stable: | ||
name: Doc stable version deploy | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | ||
runs-on: ubuntu-latest | ||
needs: doc-deploy-development | ||
steps: | ||
- name: "Deploy stable documentation" | ||
uses: pyansys/actions/doc-deploy-stable@v1 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: .tox/doc_out/ | ||
CLEAN: true | ||
SINGLE_COMMIT: true | ||
cname: ${{ env.DOCUMENTATION_CNAME }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
build: | ||
name: Build | ||
build-library: | ||
name: "Build library" | ||
runs-on: ubuntu-latest | ||
needs: style | ||
needs: doc-deploy-stable | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip pipx | ||
python -m pip install -r requirements/requirements_build.txt | ||
- name: Build wheel and sdist | ||
run: | | ||
python -m build && python -m twine check dist/* | ||
- name: Upload wheel and sdist to artifacts | ||
uses: actions/[email protected] | ||
- name: "Build library source and wheel artifacts" | ||
uses: pyansys/actions/build-library@v1 | ||
with: | ||
name: ansys-sphinx-theme | ||
path: dist/ | ||
retention-days: 7 | ||
library-name: ${{ env.PACKAGE_NAME }} | ||
|
||
release: | ||
name: Release | ||
name: "Release project to private PyPI, public PyPI and GitHub" | ||
if: github.event_name == 'push' && contains(github.ref, 'refs/tags') | ||
needs: [style, docs-style, docs, build] | ||
needs: build-library | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
|
||
- name: "Release to the private PyPI repository" | ||
uses: pyansys/actions/release-pypi-private@v1 | ||
with: | ||
python-version: 3.9 | ||
- name: Display structure of downloaded files | ||
run: ls -R | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip twine | ||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: | | ||
python -m twine upload --skip-existing ./**/*.whl | ||
python -m twine upload --skip-existing ./**/*.tar.gz | ||
- name: Publish to GitHub | ||
uses: softprops/action-gh-release@v1 | ||
library-name: ${{ env.PACKAGE_NAME }} | ||
twine-username: "__token__" | ||
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }} | ||
|
||
- name: "Release to the public PyPI repository" | ||
uses: pyansys/actions/release-pypi-public@v1 | ||
with: | ||
files: | | ||
./**/*.whl | ||
./**/*.tar.gz | ||
./PDF-Documentation/ansys_sphinx_theme.pdf | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
library-name: ${{ env.PACKAGE_NAME }} | ||
twine-username: "__token__" | ||
twine-token: ${{ secrets.PYPI_TOKEN }} | ||
|
||
- name: "Release to GitHub" | ||
uses: pyansys/actions/release-github@v1 | ||
with: | ||
generate_release_notes: true | ||
library-name: ${{ env.PACKAGE_NAME }} |
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
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 |
---|---|---|
|
@@ -10,4 +10,4 @@ show_breadcrumbs = True | |
show_icons = True | ||
hidden_icons = | ||
additional_breadcrumbs = | ||
switcher = | ||
switcher = |