File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : Test
1+ name : Test-Publish
22
33on :
44 push :
55 branches : ['master']
6+ tags :
7+ - ' v*' # only publish when pushing version tags (e.g., v1.0.0)
68 pull_request :
79 workflow_dispatch :
810
1214 timeout-minutes : 30
1315 strategy :
1416 matrix :
15- python-version : ['3.10', '3.12']
17+ python-version : ['3.10', '3.12', '3.13' ]
1618 os : ['ubuntu-latest', 'windows-latest']
1719 omc-version : ['nightly']
1820
6163 custom-arguments : ' -v '
6264 click-to-expand : true
6365 report-title : ' Test Report'
66+
67+ Publish :
68+ name : Publish to PyPI
69+ runs-on : ${{ matrix.os }}
70+ needs : test
71+ strategy :
72+ matrix :
73+ python-version : ['3.10']
74+ os : ['ubuntu-latest']
75+ if : startsWith(github.ref, 'refs/tags/')
76+ steps :
77+ - uses : actions/checkout@v5
78+
79+ - name : Set up Python ${{ matrix.python-version }}
80+ uses : actions/setup-python@v5
81+ with :
82+ python-version : ${{ matrix.python-version }}
83+ architecture : ' x64'
84+
85+ - name : Install dependencies
86+ run : |
87+ python -m pip install --upgrade pip build setuptools wheel twine
88+
89+ - name : Build wheel and sdist packages
90+ run : python -m build --wheel --sdist --outdir dist
91+
92+ - name : Publish wheel and sdist packages to PyPI
93+ env :
94+ TWINE_USERNAME : __token__
95+ TWINE_PASSWORD : ${{ secrets.PYPI_OMPYTHON_API_TOKEN }}
96+ run : |
97+ python -m twine upload dist/* --skip-existing
You can’t perform that action at this time.
0 commit comments