diff --git a/.github/workflows/FMITest.yml b/.github/workflows/FMITest.yml index cfa0f9d8..7ecfffa8 100644 --- a/.github/workflows/FMITest.yml +++ b/.github/workflows/FMITest.yml @@ -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: | diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 16494400..3fc4493d 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -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: @@ -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 @@ -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: | @@ -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 diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..e8d69943 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/pyproject.toml b/pyproject.toml index 0abafd0c..14d509fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ @@ -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",