diff --git a/.github/workflows/create-tag.yml b/.github/workflows/create-tag.yml new file mode 100644 index 0000000..b74b735 --- /dev/null +++ b/.github/workflows/create-tag.yml @@ -0,0 +1,42 @@ +name: Create Git Tag + +on: + workflow_dispatch: + inputs: + tag_name: + description: "Tag name (eg. v1.3.0)" + required: true + type: string + +permissions: + contents: write + +jobs: + create_tag: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # serve per i tag + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Check if the tag is already existing + run: | + TAG="${{ inputs.tag_name }}" + git fetch --tags + if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then + echo "❌ Tag $TAG esiste già" + exit 1 + fi + + - name: Create and push the tag + run: | + TAG="${{ inputs.tag_name }}" + git tag "$TAG" + git push origin "$TAG" diff --git a/.github/workflows/sphinx-build.yml b/.github/workflows/sphinx-build.yml index 3419477..f606ac7 100644 --- a/.github/workflows/sphinx-build.yml +++ b/.github/workflows/sphinx-build.yml @@ -1,4 +1,4 @@ -name: "Deploy Documentation" +name: "Continuous Deployment" on: push: @@ -6,41 +6,47 @@ on: - "*" jobs: - docs: - runs-on: ubuntu-18.04 + + ############################################################################# + # Create and online deployment of the documentation ######################### + docs: ####################################################################### + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup miniconda - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true - python-version: 3.7 - - - name: Conda install dependecies - shell: bash -l {0} - run: conda install --yes -c conda-forge pythonocc-core=7.4.0 numpy scipy matplotlib vtk nose setuptools coveralls sphinx_rtd_theme sphinx python=3.7 - - - name: Conda info - shell: bash -l {0} - run: conda info + python-version: 3.10 - - name: Conda info - shell: bash -l {0} - run: cd docs && sphinx-build -b html -d build/doctrees --keep-going --no-color -w '/tmp/sphinx-log' source build/html - - #- name: Create the new documentation - #uses: ammaraskar/sphinx-action@master - #with: - #docs-folder: "docs/" - #pre-build-command: "ls -l /usr/share" - #build-command: "sphinx-build -b html -d build/doctrees --keep-going --no-color -w '/tmp/sphinx-log' source build/html" + - name: Install Dependencies (conda and pip) + shell: bash + run: | + conda install --yes -c conda-forge pythonocc-core + python -m pip install --upgrade pip + python -m pip install .[doc] + - name: Build Documentation + run: | + make html + working-directory: docs/ - name: Deploy uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - #deploy_key: ${{ secrets.DEPLOY_PRIVATE_KEY }} publish_dir: ./docs/build/html allow_empty_commit: true + + ############################################################################# + ## Create a public "Release" on the Github page ############################# + release_github: ############################################################# + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + - uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/source/conf.py b/docs/source/conf.py index 4c4e0d6..332d770 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -45,10 +45,10 @@ ] intersphinx_mapping = { - "python": ("http://docs.python.org/3", None), - "numpy": ("http://docs.scipy.org/doc/numpy/", None), - "scipy": ("http://docs.scipy.org/doc/scipy/reference/", None), - "matplotlib": ("http://matplotlib.sourceforge.net/", None), + "python": ("https://docs.python.org/3", None), + "numpy": ("https://numpy.org/doc/stable/", None), + "scipy": ("https://docs.scipy.org/doc/scipy/", None), + "matplotlib": ("https://matplotlib.org/stable", None), } # Add any paths that contain templates here, relative to this directory. @@ -87,7 +87,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: @@ -133,7 +133,7 @@ # classes and attributes. As side effects, this option ... ??? # If false, ... ???. # The default is True. -viewcode_import = True +# viewcode_import = True # -- Options for HTML output ---------------------------------------------- @@ -149,7 +149,7 @@ # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. -html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +# html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". diff --git a/pyproject.toml b/pyproject.toml index 9b5b836..49b2a81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,13 @@ -[build-system] -requires = ["setuptools>=45", "wheel"] -build-backend = "setuptools.build_meta" - [project] name = "pygem" -dynamic = ["version"] +dynamic = "2.0.1" description = "Python Geometrical Morphing" readme = {file = "README.md", content-type = "text/markdown"} -keywords = ["dimension_reduction", "mathematics", "ffd", "morphing", "iges", "stl", "vtk", "openfoam"] +keywords = [ + "vtk", "free-form-deformation", "iges", "radial-basis-function", + "deformation", "shape design", "inverse-distance-weighting", + "custom deformation", "mesh parameterization" +] authors = [ {name = "Marco Tezzele", email = "marcotez@gmail.com"}, {name = "Nicola Demo", email = "demo.nicola@gmail.com"}, @@ -68,21 +68,15 @@ dev = [ "pylint" ] +[build-system] +requires = ["setuptools>=45", "wheel"] +build-backend = "setuptools.build_meta" + [tool.setuptools] include-package-data = true [tool.setuptools.packages.find] -where = ["."] include = ["pygem*"] -exclude = ["tests*", "docs*", "tutorials*"] - -[tool.setuptools.dynamic] -version = { attr = "pygem.meta.__version__" } [tool.black] line-length = 80 -target-version = ['py39'] - -[tool.flake8] -ignore = "F401" -