diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000..61862fc --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,58 @@ +--- + name: Package CI/CD + on: + push: + branches: + - main + tags: + - '*' # Later: \b[0-9]\.[0-9]+\.[0-9]+[ab]?[0-9]?\b + pull_request: + types: + - opened + - synchronize + branches: + - main + + jobs: + pre-commit: + name: Apply pre-commit hooks + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python version + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install extra dependencies + run: | + python -m pip install --upgrade pip + pip install .[dev,test] + - name: Cache pre-commit hooks + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: ${{ runner.os }}-precommit-${{ hashFiles('.pre-commit-config.yaml') }} + - name: Run pre-commit hooks + run: pre-commit run --all-files + publish: + needs: pre-commit + if: success() && startsWith(github.ref, 'refs/tags') + name: Publish release to PyPI + runs-on: ubuntu-latest + environment: release + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python version + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Build package + run: | + python -m pip install --upgrade build + python -m build + - name: Upload package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/docs/pages/index.html b/docs/pages/index.html index f46aa61..54eab70 100644 --- a/docs/pages/index.html +++ b/docs/pages/index.html @@ -39,7 +39,7 @@ diff --git a/pyproject.toml b/pyproject.toml index 4484a69..54526d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,12 +12,12 @@ authors = [ ] classifiers = [ # - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Intended Audience :: Developers", + "Topic :: Software Development :: Libraries :: Python Modules", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", # "Programming Language :: Python :: 3.12", no wheels 3.12 for dependency ecmwflibs - "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ @@ -36,22 +36,17 @@ dependencies = [ [project.optional-dependencies] test = ["pytest", "coverage"] -doc = ["mkdocs-material", "mkdocstrings[python]"] +doc = ["mkdocs-material", "mkdocstrings[python]", "jinja2==3.0.3"] mypy = ["mypy"] ruff = ["ruff"] -all = [ - "meteole[test]", - "meteole[doc]", - "meteole[mypy]", - "meteole[ruff]", - "pre-commit", -] +dev = ["mypy", "pre-commit", "ruff"] +all = ["meteole[test,dev,doc,mypy,ruff]"] [tool.setuptools] -package-dir = { "" = "src" } # +package-dir = { "" = "src" } [tool.pytest.ini_options] -pythonpath = ["src"] # +pythonpath = ["src"] testpaths = ["tests"] [tool.mypy]