Skip to content
2 changes: 1 addition & 1 deletion .github/workflows/FMITest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
- uses: actions/checkout@v5
- name: "Set up OpenModelica Compiler"
uses: OpenModelica/setup-openmodelica@v1.0
uses: OpenModelica/setup-openmodelica@v1.0.2
with:
version: ${{ matrix.omc-version }}
packages: |
Expand Down
42 changes: 38 additions & 4 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: Test
name: Test-Publish

on:
push:
branches: ['master']
tags:
- 'v*' # only publish when pushing version tags (e.g., v1.0.0)
pull_request:
workflow_dispatch:

Expand All @@ -12,9 +14,9 @@ jobs:
timeout-minutes: 30
strategy:
matrix:
python-version: ['3.10', '3.12']
python-version: ['3.10', '3.12', '3.13']
os: ['ubuntu-latest', 'windows-latest']
omc-version: ['stable']
omc-version: ['nightly']

steps:
- uses: actions/checkout@v5
Expand All @@ -39,7 +41,7 @@ jobs:
run: 'pre-commit run --all-files'

- name: "Set up OpenModelica Compiler"
uses: OpenModelica/setup-openmodelica@v1.0
uses: OpenModelica/setup-openmodelica@v1.0.2
with:
version: ${{ matrix.omc-version }}
packages: |
Expand All @@ -61,3 +63,35 @@ jobs:
custom-arguments: '-v '
click-to-expand: true
report-title: 'Test Report'

Publish:
name: Publish to PyPI
runs-on: ${{ matrix.os }}
needs: test
strategy:
matrix:
python-version: ['3.10']
os: ['ubuntu-latest']
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v5

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'

- name: Install dependencies
run: |
python -m pip install --upgrade pip build setuptools wheel twine

- name: Build wheel and sdist packages
run: python -m build --wheel --sdist --outdir dist

- name: Publish wheel and sdist packages to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_OMPYTHON_API_TOKEN }}
run: |
python -m twine upload dist/* --skip-existing
26 changes: 26 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
This project is part of OpenModelica.

Copyright (c) 1998-CurrentYear, Open Source Modelica Consortium (OSMC),
c/o Linköpings universitet, Department of Computer and Information Science,
SE-58183 Linköping, Sweden.

All rights reserved.

THIS PROGRAM IS PROVIDED UNDER THE TERMS OF THE BSD NEW LICENSE OR THE
GPL VERSION 3 LICENSE OR THE OSMC PUBLIC LICENSE (OSMC-PL) VERSION 1.2.
ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS PROGRAM CONSTITUTES
RECIPIENT'S ACCEPTANCE OF THE OSMC PUBLIC LICENSE OR THE GPL VERSION 3,
ACCORDING TO RECIPIENTS CHOICE.

The OpenModelica software and the OSMC (Open Source Modelica Consortium)
Public License (OSMC-PL) are obtained from OSMC, either from the above
address, from the URLs: http://www.openmodelica.org or
http://www.ida.liu.se/projects/OpenModelica, and in the OpenModelica
distribution. GNU version 3 is obtained from:
http://www.gnu.org/copyleft/gpl.html. The New BSD License is obtained from:
http://www.opensource.org/licenses/BSD-3-Clause.

This program is distributed WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, EXCEPT AS
EXPRESSLY SET FORTH IN THE BY RECIPIENT SELECTED SUBSIDIARY LICENSE
CONDITIONS OF OSMC-PL.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "OMPython"
version = "3.6.0"
version = "4.0.0"
description = "OpenModelica-Python API Interface"
readme = "README.md"
authors = [
Expand All @@ -13,7 +13,7 @@ authors = [
maintainers = [
{name = "Adeel Asghar", email = "adeel.asghar@liu.se"},
]
license = "BSD-3-Clause OR LicenseRef-OSMC-PL-1.2 OR GPL-3.0-only"
license = { file = "LICENSE" }
requires-python = ">=3.10"
dependencies = [
"numpy",
Expand Down