Skip to content

Commit 6fa7406

Browse files
authored
Improve examples in docs (#16)
* Fix return types and color band range (#5) * fix types and remove non-existing function * fix tests * fix color band range * increment patch number * fix range and tests * changelog * bring back function * more tests * missing include * typo * better docstrings * correctness * ws * docs only publish * more examples * point to pypi (#3) * remove multi-statement lines * remove vb references * better explanation * simpler * cleanup and make sure the scripts work * Update readme.rst * remove unnecessary fallback
1 parent 10b9b15 commit 6fa7406

File tree

2 files changed

+446
-18
lines changed

2 files changed

+446
-18
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
description: "Confirm publish package"
88
required: true
99
type: boolean
10+
docs_only:
11+
description: "Only publish documentation (skip package publish)"
12+
required: false
13+
type: boolean
14+
default: false
1015

1116
jobs:
1217
guard-ci-success:
@@ -77,9 +82,16 @@ jobs:
7782
with:
7883
python-version: '3.13'
7984

85+
- name: Install dependencies for docs
86+
if: ${{ github.event.inputs.docs_only == 'true' }}
87+
run: |
88+
python -m pip install --upgrade pip
89+
pip install -r requirements.txt
90+
8091
- name: Check if version exists on PyPI
8192
id: pypi_check
8293
shell: pwsh
94+
if: ${{ github.event.inputs.docs_only != 'true' }}
8395
run: |
8496
$packageName = 'moldflow'
8597
@@ -100,30 +112,30 @@ jobs:
100112
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
101113
102114
- name: Skip publish, version already exists
103-
if: steps.pypi_check.outputs.exists == 'true'
115+
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'true' }}
104116
run: Write-Output "Version ${{ steps.pypi_check.outputs.version }} already exists on PyPI. Skipping publish."
105117

106118
- name: Install build dependencies
107-
if: steps.pypi_check.outputs.exists == 'false'
119+
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'false' }}
108120
run: |
109121
python -m pip install --upgrade pip
110122
pip install -r requirements.txt
111123
112124
- name: Build package
113-
if: steps.pypi_check.outputs.exists == 'false'
125+
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'false' }}
114126
run: |
115127
python run.py build
116128
117129
- name: Publish to PyPI
118-
if: steps.pypi_check.outputs.exists == 'false'
130+
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'false' }}
119131
env:
120132
TWINE_USERNAME: __token__
121133
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
122134
run: |
123135
python run.py publish --skip-build
124136
125137
- name: Create GitHub Release
126-
if: steps.pypi_check.outputs.exists == 'false'
138+
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'false' }}
127139
run: |
128140
python run.py release
129141
env:

0 commit comments

Comments
 (0)