diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb87d3b..316bc70 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Install dependencies run: | - pip install .[pre_commit] + pip install .[dev] - name: Run pre-commit run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 ) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ae09e4f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,15 @@ +--- +name: Release +on: + push: + tags: + - v* +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: softprops/action-gh-release@v0.1.14 + name: Create release. + with: + generate_release_notes: true diff --git a/README.md b/README.md index 897d73f..1a21b28 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,20 @@ Users of AiiDAlab are kindly asked to cite the following publication in their ow A. V. Yakutovich et al., Comp. Mat. Sci. 188, 110165 (2021). [DOI:10.1016/j.commatsci.2020.110165](https://doi.org/10.1016/j.commatsci.2020.110165) +## For maintainers + +To create a new release, clone the repository, install development dependencies with `pip install '.[dev]'`, and then execute `bumpver update`. +This will: + + 1. Create a tagged release with bumped version and push it to the repository. + 2. Trigger a GitHub actions workflow that creates a GitHub release. + +Additional notes: + + - Use the `--dry` option to preview the release change. + - The release tag (e.g. a/b/rc) is determined from the last release. + Use the `--tag` option to switch the release tag. + ## Acknowledgements This work is supported by the [MARVEL National Centre for Competency in Research]() diff --git a/setup.cfg b/setup.cfg index f3225b1..330aef6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,7 +33,8 @@ install_requires = python_requires = >=3.8 [options.extras_require] -pre_commit = +dev = + bumpver==2022.1118 pre-commit==2.15.0 [flake8] @@ -41,3 +42,17 @@ ignore = E501 # Line length handled by black. W503 # Line break before binary operator, preferred formatting for black. E203 # Whitespace before ':', preferred formatting for black. + +[bumpver] +current_version = "v22.08.0" +version_pattern = "v0Y.0M.PATCH[PYTAGNUM]" +commit_message = "Bump version {old_version} -> {new_version}." +commit = True +tag = True +push = True + +[bumpver:file_patterns] +home/__init__.py = + __version__ = "{version}" +setup.cfg = + current_version = "{version}"