Skip to content

Commit 20de14d

Browse files
committed
Test with python 3.13
Added Publish job to put the wheel on PyPI
1 parent 2536d66 commit 20de14d

1 file changed

Lines changed: 36 additions & 2 deletions

File tree

.github/workflows/Test.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: Test
1+
name: Test-Publish
22

33
on:
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

@@ -12,7 +14,7 @@ jobs:
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

@@ -61,3 +63,35 @@ jobs:
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

0 commit comments

Comments
 (0)