diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 7287a318..90663bad 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -3,21 +3,6 @@ current_version = 0.2.0 message = Bump version to {new_version} commit = True tag = True -parse = ^ - (?P\d+)\.(?P\d+)\.(?P\d+) - (?: - (?Prc) - (?:(?P\d+(?:\.\d+)*))? - )? -serialize = - {major}.{minor}.{patch}{release}{rc} - {major}.{minor}.{patch} - -[bumpversion:part:release] -optional_value = final -values = - rc - final [bumpversion:file:setup.py] search = version='{current_version}' @@ -30,3 +15,7 @@ replace = release = '{new_version}' [bumpversion:file:src/compas_fd/__init__.py] search = __version__ = '{current_version}' replace = __version__ = '{new_version}' + +[bumpversion:file:CHANGELOG.md] +search = Unreleased +replace = [{new_version}] {now:%Y-%m-%d} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a0aa5760..5afe7303 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -17,11 +17,12 @@ jobs: steps: - uses: actions/checkout@v2 - - uses: compas-dev/compas-actions.docs@v1.3.0 + - uses: compas-dev/compas-actions.docs@v1.4.1 id: docs with: dest: deploy build_to_subfolder: true + test_docs: true - name: Deploy docs if: success() && steps.docs.outputs.commit_type != 'pull' diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 00000000..fa70e312 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,21 @@ +name: verify-pr-checklist +on: + pull_request: + types: [assigned, opened, synchronize, reopened, labeled, unlabeled] + branches: + - main + - master + +jobs: + build: + name: Check Actions + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Changelog check + uses: Zomzog/changelog-checker@v1.2.0 + with: + fileName: CHANGELOG.md + checkNotification: Simple + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29b..1c520aad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,16 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## Unreleased + +### Added +- Workflow for changelog check. + +### Changed + +### Removed +- Release candidate option. diff --git a/tasks.py b/tasks.py index eb3fb140..e7bc7731 100644 --- a/tasks.py +++ b/tasks.py @@ -193,26 +193,20 @@ def prepare_changelog(ctx): @task(help={ - 'release_type': 'Type of release follows semver rules. Must be one of: major, minor, patch, major-rc, minor-rc, patch-rc, rc, release.'}) + 'release_type': 'Type of release follows semver rules. Must be one of: major, minor, patch.'}) def release(ctx, release_type): """Releases the project in one swift command!""" - if release_type not in ('patch', 'minor', 'major', 'major-rc', 'minor-rc', 'patch-rc', 'rc', 'release'): - raise Exit('The release type parameter is invalid.\nMust be one of: major, minor, patch, major-rc, minor-rc, patch-rc, rc, release') - - is_rc = release_type.find('rc') >= 0 - release_type = release_type.split('-')[0] + if release_type not in ('patch', 'minor', 'major'): + raise Exit('The release type parameter is invalid.\nMust be one of: major, minor, patch.') # Run checks ctx.run('invoke check') # Bump version and git tag it - if is_rc: - ctx.run('bump2version %s --verbose' % release_type) - elif release_type == 'release': - ctx.run('bump2version release --verbose') - else: - ctx.run('bump2version %s --verbose --no-tag' % release_type) - ctx.run('bump2version release --verbose') + ctx.run('bump2version %s --verbose' % release_type) + + # Prepare the change log for the next release + prepare_changelog(ctx) @contextlib.contextmanager