diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ff060d3..fc228db 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -4,4 +4,4 @@ commit = False tag = False [bumpversion:file:rest_framework_api_key/__init__.py] - +[bumpversion:file:pyproject.toml] diff --git a/.travis.yml b/.travis.yml index 24ac909..e2936ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,4 +36,4 @@ deploy: tags: true # deploy only once python: "3.7" - condition: "$DJANGO_VERSION = 2.2" + condition: "$DJANGO_VERSION = 2.2.*" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 368f2e2..b22dc08 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,27 +46,12 @@ $ python scripts/makemigrations.py - `test`: run test suite. - `lint`: run linters and auto-formatters. - `check`: check code style. - -### CI/CD - -Travis CI is in use to automatically: - -- Test the package on supported versions of Python and Django. -- Release _tagged commits_ to PyPI. - -See `.travis.yml` for further details. +- `bump (patch | minor | major)`: bump package version (extra options are forwared to [bumpversion](https://pypi.org/project/bumpversion/)). ### Releasing -When ready to release a new version, use [bumpversion](https://pypi.org/project/bumpversion/) to update the package's version: - -```bash -$ bumpversion (patch | minor | major) -``` - -This will create a new commit and tag that commit with the new version. See [.bumpversion.cfg](.bumpversion.cfg) for more info. - -Then, push the tagged commit to remote: +- Update the package version using the `bump` script. +- Push the tagged commit to remote: ```bash $ git push --tags diff --git a/scripts/bumpversion.sh b/scripts/bump similarity index 74% rename from scripts/bumpversion.sh rename to scripts/bump index dbd2a84..1ad5f59 100755 --- a/scripts/bumpversion.sh +++ b/scripts/bump @@ -1,7 +1,4 @@ -#!/bin/bash - -# Stop if any command fails. -set -e +#!/bin/bash -e ARGS="$@" CHANGELOG="CHANGELOG.md" @@ -14,7 +11,7 @@ CURRENT_VERSION=$(get current_version) NEW_VERSION=$(get new_version) bumpversion "$@" --no-tag --no-commit -python scripts/changelog_bump.py "$CHANGELOG" "v$NEW_VERSION" +python scripts/bump_changelog.py "$CHANGELOG" "v$NEW_VERSION" git add -A git commit -m "Bump version: $CURRENT_VERSION → $NEW_VERSION" diff --git a/scripts/changelog_bump.py b/scripts/bump_changelog.py similarity index 100% rename from scripts/changelog_bump.py rename to scripts/bump_changelog.py