Skip to content

Commit

Permalink
Merge branch 'main' into bug/save-folder-does-not-handle-relative-pat…
Browse files Browse the repository at this point in the history
…hs-with-duplicate-file-names-correctly
  • Loading branch information
priscavdsluis authored Sep 6, 2024
2 parents 42d944b + 3b8ab0b commit d50de7c
Show file tree
Hide file tree
Showing 361 changed files with 27,624 additions and 5,375 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.12"]
os: [ubuntu-latest, windows-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Run image
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.1.11
poetry-version: 1.8.2
- name: Cache Poetry virtualenv
uses: actions/cache@v3
id: cache
Expand Down Expand Up @@ -53,3 +53,7 @@ jobs:
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
git commit -am "autoformat: isort & black" && git push || true
- uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
python-version: 3.8

- name: Run image
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.1.11
poetry-version: 1.4.0
- name: Cache Poetry virtualenv
uses: actions/cache@v3
id: cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
python-version: 3.8

- name: Run image
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.1.11
poetry-version: 1.4.0
- name: Cache Poetry virtualenv
uses: actions/cache@v3
id: cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Run image
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.1.11
poetry-version: 1.4.0

- name: Cache Poetry virtualenv
uses: actions/cache@v3
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Automated release workflow

on:
workflow_dispatch:
inputs:
major:
description: "The new major version."
required: true
type: string
minor:
description: "The new minor version."
required: true
type: string
patch:
description: "The new patch version."
required: true
type: string
increment:
description: "The type of increment."
required: true
type: choice
options:
- MAJOR
- MINOR
- PATCH

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Run image
uses: abatilo/[email protected]
with:
poetry-version: 1.4.0

- name: Cache Poetry virtualenv
uses: actions/cache@v3
id: cache
with:
path: ~/.virtualenvs
key: venv-ubuntu-latest-3.8-${{ hashFiles('**/poetry.lock') }}

- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'

- name: Generate changelog
run: poetry run cz changelog --unreleased-version="${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}" --incremental

- name: Get user info
id: user_info
run: |
USER_JSON=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/users/${{ github.actor }}")
USER_NAME=$(echo "$USER_JSON" | jq -r .name)
USER_EMAIL=$(echo "$USER_JSON" | jq -r .email)
echo "::set-output name=name::$USER_NAME"
echo "::set-output name=email::$USER_EMAIL"
- name: Configure git
run: |
git config --local user.email "${{ steps.user_info.outputs.email }}"
git config --local user.name "${{ steps.user_info.outputs.name }}"
- name: Bump version
run: |
poetry run cz bump --yes --increment ${{ github.event.inputs.increment }}
git push
git push --tags
- name: Build hydrolib-core package
run: poetry build

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
name: Release v${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}
tag_name: ${{ github.event.inputs.major }}.${{ github.event.inputs.minor }}.${{ github.event.inputs.patch }}
generate_release_notes: true
token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,6 @@ tests/data/output

# Visual Studio Code
.vscode/

# PyCharm
.idea/
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![ci](https://github.com/Deltares/HYDROLIB-core/actions/workflows/ci.yml/badge.svg)](https://github.com/Deltares/HYDROLIB-core/actions/workflows/ci.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Deltares_HYDROLIB-core&metric=alert_status)](https://sonarcloud.io/dashboard?id=Deltares_HYDROLIB-core)

[![codecov](https://img.shields.io/codecov/c/github/deltares/HYDROLIB-core.svg?style=flat-square)](https://app.codecov.io/gh/deltares/HYDROLIB-core?displayType=list)
[![Supported versions](https://img.shields.io/pypi/pyversions/hydrolib-core.svg)](https://pypi.org/project/hydrolib-core)

# HYDROLIB-core
HYDROLIB-core is the core library of Python wrappers around the D-HYDRO model files (input and output) and model engines (kernel libraries).
Expand Down
Loading

0 comments on commit d50de7c

Please sign in to comment.