diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..fe70a1f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: Build + +on: + push: + tags: + - 'v*' + +jobs: + build: + name: Create Release + permissions: write-all + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Get version from setup.cfg + id: get-version + run: echo "::set-output name=version::$(awk -F "=" '/^version/ {print $2}' setup.cfg | tr -d '[:space:]')" + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: v${{ steps.get-version.outputs.version }} + release_name: Release v${{ steps.get-version.outputs.version }} + draft: false + # prerelease: ${{ contains(github.ref, '-beta') || contains(github.ref, '-alpha') || contains(github.ref, '-rc') }} + prerelease: false diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..57cdb3b --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,20 @@ +name: Publish to PyPI.org +on: + release: + types: [published] + workflow_dispatch: # Add this to allow manual triggering +jobs: + pypi: + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - run: python3 -m pip install --upgrade build && python3 -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/setup.cfg b/setup.cfg index 086321e..7524b6d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = reactea -version = 0.1.1-beta +version = 1.0.0 description = ReactEA: Combining Evolutionary Algorithms with Reaction Rules Towards Focused Molecular Design long_description = file: README.md long_description_content_type = text/markdown @@ -12,7 +12,7 @@ license = GPL-3.0 license license_file = LICENSE platforms = unix, linux, osx, cygwin, win32 classifiers = - Development Status :: 4 - Beta + Development Status :: 5 - Production/Stable License :: OSI Approved :: MIT License Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 diff --git a/src/reactea/__init__.py b/src/reactea/__init__.py index 2f951e2..2dabade 100644 --- a/src/reactea/__init__.py +++ b/src/reactea/__init__.py @@ -9,6 +9,8 @@ from reactea.optimization.jmetal.ea import ChemicalEA from reactea.wrappers import case_study_wrapper, evaluation_functions_wrapper +__version__ = '1.0.0' + def run_reactea(configs_path: Union[str, dict], case_study: CaseStudy,