-
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.
- Loading branch information
1 parent
19f0f8b
commit fb18986
Showing
2 changed files
with
49 additions
and
58 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 |
---|---|---|
|
@@ -9,8 +9,9 @@ on: | |
- main | ||
env: | ||
MAIN_PYTHON_VERSION : '3.10' | ||
pyansys-actions: 'pyansys/actions/.github/workflows' | ||
cname: 'sphinxdocs.ansys.com' | ||
PACKAGE_NAME: 'ansys-sphinx-theme' | ||
PACKAGE_NAMESPACE: 'ansys_sphinx_theme' | ||
DOCUMENTATION_CNAME: 'sphinxdocs.ansys.com' | ||
|
||
jobs: | ||
|
||
|
@@ -19,14 +20,16 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Run PyAnsys code style checks" | ||
uses: pyansys/actions/code-style@main | ||
uses: pyansys/actions/code-style@v1 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
doc-style: | ||
name: Doc style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Run Ansys documentation style checks" | ||
uses: pyansys/actions/doc-style@main | ||
uses: pyansys/actions/doc-style@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
@@ -36,7 +39,9 @@ jobs: | |
needs: doc-style | ||
steps: | ||
- name: "Run Ansys documentation building action" | ||
uses: pyansys/actions/doc-build@main | ||
uses: pyansys/actions/doc-build@v1 | ||
with: | ||
python-version: ${{ env.MAIN_PYTHON_VERSION }} | ||
|
||
doc-deploy-development: | ||
name: Doc dev version deploy | ||
|
@@ -45,9 +50,9 @@ jobs: | |
needs: doc-build | ||
steps: | ||
- name: "Deploy developers documentation" | ||
uses: pyansys/actions/doc-deploy-dev@main | ||
uses: pyansys/actions/doc-deploy-dev@v1 | ||
with: | ||
cname: ${{ env.cname }} | ||
cname: ${{ env.DOCUMENTATION_CNAME }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
doc-deploy-stable: | ||
|
@@ -57,67 +62,44 @@ jobs: | |
needs: doc-deploy-development | ||
steps: | ||
- name: "Deploy stable documentation" | ||
uses: pyansys/actions/doc-deploy-stable@main | ||
uses: pyansys/actions/doc-deploy-stable@v1 | ||
with: | ||
cname: ${{ env.cname }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
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: [code-style] | ||
needs: doc-deploy-stable | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- name: "Build library source and wheel artifacts" | ||
uses: pyansys/actions/build-library@v1 | ||
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] | ||
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: 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