diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 000000000..e66aae5a6 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,3 @@ +{ + "extends": ["github>Hapag-Lloyd/Renovate-Global-Configuration"] +} diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml new file mode 100644 index 000000000..414e0e4d9 --- /dev/null +++ b/.github/workflows/clean.yml @@ -0,0 +1,18 @@ +name: clean packages + +on: + schedule: + - cron: '30 1 * * 1' + +jobs: + clean_packages: + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - uses: actions/delete-package-versions@v4 + with: + package-name: errbot + package-type: container + # do not delete releases + ignore-versions: '^\d+\.\d+\.\d+$' diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 89ec1720d..fa13a2e3b 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,28 +1,26 @@ name: build docker image on: - push: - branches: - - master + pull_request: + release: + types: [published] permissions: contents: read + packages: write jobs: build: - if: github.repository_owner == 'errbotio' runs-on: ubuntu-latest steps: - name: checkout uses: actions/checkout@v4.1.1 - - name: build and push docker image + - name: build and push image uses: mr-smithers-excellent/docker-build-push@v6 with: - image: errbotio/errbot - tags: latest - registry: docker.io - dockerfile: Dockerfile - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + image: errbot-hl + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 000000000..43f50d735 --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,49 @@ +--- +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - reopened + - synchronize + +jobs: + main: + name: Lint PR title + runs-on: ubuntu-latest + permissions: + pull-requests: read + contents: read + statuses: write + steps: + - uses: amannn/action-semantic-pull-request@47b15d52c5c30e94a17ec87eb8dd51ff5221fed9 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + build + chore + ci + docs + feat + fix + perf + refactor + revert + style + test + # Configure which scopes are allowed. + # deps - dependency updates + # master - for release-please (scope used for releases) + scopes: | + deps + master + requireScope: false + # ensure that the subject doesn't start with an uppercase character. + subjectPattern: ^(?![A-Z]).+$ + subjectPatternError: | + The subject "{subject}" found in the pull request title "{title}" + didn't match the configured pattern. Please ensure that the subject + doesn't start with an uppercase character. diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..721d6feb1 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,50 @@ +name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI + +on: + release: + types: [published] + +jobs: + build: + name: Build distribution 📦 + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install pypa/build + run: >- + python3 -m pip install build --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v3 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: >- + Publish Python 🐍 distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/errbot-hl # Replace with your PyPI project name + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index f1294949b..5c5830a1d 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -4,8 +4,6 @@ name: Python package on: - push: - branches: [ master ] pull_request: branches: [ master ] @@ -19,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, "3.10"] + python-version: [3.8, 3.9, "3.10", "3.11"] steps: - uses: actions/checkout@v4.1.1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..db4d2b0c5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,30 @@ +--- +name: Release + +on: # yamllint disable-line rule:truthy + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - uses: actions/create-github-app-token@v1 + id: app-token + with: + app-id: ${{ vars.GET_TOKEN_APP_ID }} + private-key: ${{ secrets.GET_TOKEN_PRIVATE_KEY }} + # bootstrap-sha and release-as needs to be removed after first release + - name: Release + uses: google-github-actions/release-please-action@1ddb669c677d585663a83fc535edc428954c4aeb # ratchet:google-github-actions/release-please-action@v3 + with: + release-type: python + token: ${{ steps.app-token.outputs.token }} + include-v-in-tag: false + pull-request-header: '' + bootstrap-sha: cb9e671b30bac5976c51300e820e95db74a8be0f + last-release-sha: 0001618fb3f5986f5b4033f98edee5baa7df5b89 diff --git a/.github/workflows/update_release_branch.yml b/.github/workflows/update_release_branch.yml new file mode 100644 index 000000000..b3e1716eb --- /dev/null +++ b/.github/workflows/update_release_branch.yml @@ -0,0 +1,39 @@ +--- +name: Auto update release version + +on: # yamllint disable-line rule:truthy + push: + branches: + - release-please--branches--master + +jobs: + set-version: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout branch + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 # ratchet:actions/checkout@v3 + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump job context + env: + JOB_CONTEXT: ${{ toJson(job) }} + run: echo "$JOB_CONTEXT" + - name: Dump steps context + env: + STEPS_CONTEXT: ${{ toJson(steps) }} + run: echo "$STEPS_CONTEXT" + - name: Set release version + id: set_release_version + env: + HEAD_COMMIT_TITLE: ${{ github.event.head_commit.message }} + run: | + file=$(find . -name "version.py") + version_number=${HEAD_COMMIT_TITLE##* } + sed -i "s/^VERSION .*$/VERSION = \"$version_number\"/" $file + - uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: set release version diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..6bf129680 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,94 @@ +# Changelog + +## [6.1.21](https://github.com/Hapag-Lloyd/errbot/compare/6.1.20...6.1.21) (2023-11-17) + + +### Bug Fixes + +* fix the tests ([#36](https://github.com/Hapag-Lloyd/errbot/issues/36)) ([7178eb2](https://github.com/Hapag-Lloyd/errbot/commit/7178eb2fa38e40ddac2648fe3a10280fbaccb641)) + +## [6.1.20](https://github.com/Hapag-Lloyd/errbot/compare/6.1.19...6.1.20) (2023-11-17) + + +### Bug Fixes + +* remove `changes` from `setup.py` ([#34](https://github.com/Hapag-Lloyd/errbot/issues/34)) ([20ab0cc](https://github.com/Hapag-Lloyd/errbot/commit/20ab0cca141f9ad3016f94b1fd3770effe029626)) + +## [6.1.19](https://github.com/Hapag-Lloyd/errbot/compare/6.1.18...6.1.19) (2023-11-17) + + +### Bug Fixes + +* add `read()` again ([#32](https://github.com/Hapag-Lloyd/errbot/issues/32)) ([65c0a4e](https://github.com/Hapag-Lloyd/errbot/commit/65c0a4eb067db3ce6e25cb51baa5c2cb2c50bbf2)) + +## [6.1.18](https://github.com/Hapag-Lloyd/errbot/compare/6.1.17...6.1.18) (2023-11-17) + + +### Bug Fixes + +* do not check if release notes were added ([#30](https://github.com/Hapag-Lloyd/errbot/issues/30)) ([32ac9a8](https://github.com/Hapag-Lloyd/errbot/commit/32ac9a8997263ef2a60f160b5112d7ff75855905)) + +## [6.1.17](https://github.com/Hapag-Lloyd/errbot/compare/6.1.16...6.1.17) (2023-11-17) + + +### Bug Fixes + +* add closing `"` ([#26](https://github.com/Hapag-Lloyd/errbot/issues/26)) ([f684d40](https://github.com/Hapag-Lloyd/errbot/commit/f684d400250d5a8c0be83bf88a8ed68cf13194db)) +* dump context ([#28](https://github.com/Hapag-Lloyd/errbot/issues/28)) ([b8e8903](https://github.com/Hapag-Lloyd/errbot/commit/b8e8903733b12cbe648d8c2004d66730338e8ed6)) +* get version number from commit message ([#29](https://github.com/Hapag-Lloyd/errbot/issues/29)) ([8e3b6d1](https://github.com/Hapag-Lloyd/errbot/commit/8e3b6d189c402ab47d8ee8d70ba6a3848f9016c1)) +* set release version in `version.py` ([#24](https://github.com/Hapag-Lloyd/errbot/issues/24)) ([ac26dcf](https://github.com/Hapag-Lloyd/errbot/commit/ac26dcf61f78ff2f87b5c8bcf70b911810cfb999)) +* show PR title ([#27](https://github.com/Hapag-Lloyd/errbot/issues/27)) ([614d1ed](https://github.com/Hapag-Lloyd/errbot/commit/614d1ed92e10703ce2f38d47ca36eb2d285231f7)) + +## [6.1.16](https://github.com/Hapag-Lloyd/errbot/compare/6.1.15...6.1.16) (2023-11-17) + + +### Bug Fixes + +* use standard token ([#22](https://github.com/Hapag-Lloyd/errbot/issues/22)) ([4b028f8](https://github.com/Hapag-Lloyd/errbot/commit/4b028f81cc4b35c421732a22fe61b47d799a71bd)) + +## [6.1.15](https://github.com/Hapag-Lloyd/errbot/compare/6.1.14...6.1.15) (2023-11-17) + + +### Bug Fixes + +* change project name to `errbot-hl` ([#20](https://github.com/Hapag-Lloyd/errbot/issues/20)) ([9e5b066](https://github.com/Hapag-Lloyd/errbot/commit/9e5b0664c2e624e09ccbe0bfb9e7c791623206d5)) + +## [6.1.14](https://github.com/Hapag-Lloyd/errbot/compare/6.1.13...6.1.14) (2023-11-17) + + +### Bug Fixes + +* upload for a published release only ([#18](https://github.com/Hapag-Lloyd/errbot/issues/18)) ([4c54589](https://github.com/Hapag-Lloyd/errbot/commit/4c545893005aebb3208d5f72823e7a8a31dd50a5)) + +## [6.1.13](https://github.com/Hapag-Lloyd/errbot/compare/6.1.12...6.1.13) (2023-11-17) + + +### Bug Fixes + +* update for release only ([#16](https://github.com/Hapag-Lloyd/errbot/issues/16)) ([ac2b317](https://github.com/Hapag-Lloyd/errbot/commit/ac2b31748bb6acb06cec9ead5e7de79ecdc06413)) + +## [6.1.12](https://github.com/Hapag-Lloyd/errbot/compare/6.1.11...6.1.12) (2023-11-17) + + +### Bug Fixes + +* show verbose upload to PyPi ([#13](https://github.com/Hapag-Lloyd/errbot/issues/13)) ([f3386d9](https://github.com/Hapag-Lloyd/errbot/commit/f3386d987d0ef7af24aedadae524078e73f4d8ae)) + +## [6.1.11](https://github.com/Hapag-Lloyd/errbot/compare/6.1.10...6.1.11) (2023-11-17) + + +### Bug Fixes + +* update for release ([#11](https://github.com/Hapag-Lloyd/errbot/issues/11)) ([eeb3e2c](https://github.com/Hapag-Lloyd/errbot/commit/eeb3e2ceb4ebccea2e6e9b664e72bf78fbec3e01)) + +## [6.1.10](https://github.com/Hapag-Lloyd/errbot/compare/6.1.9...6.1.10) (2023-11-16) + + +### Bug Fixes + +* broken integration tests ([#1668](https://github.com/Hapag-Lloyd/errbot/issues/1668)) ([9373e9e](https://github.com/Hapag-Lloyd/errbot/commit/9373e9ebc7b0b8c2ad17c5ccb5a38f08692068ad)) + + +### Documentation + +* add readthedocs yaml config ([#1661](https://github.com/Hapag-Lloyd/errbot/issues/1661)) ([b6acb81](https://github.com/Hapag-Lloyd/errbot/commit/b6acb8150265a614c32248b758a822261b9fea57)) diff --git a/CHANGES.rst b/CHANGES.rst index 8afb72189..39b2a5590 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,4 +1,4 @@ -v9.9.9 (unreleased) +v7.0.0 ------------------- breaking: diff --git a/Dockerfile b/Dockerfile index f8a4872fa..1f734cc3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN apt update && \ apt install -y git && \ cd /wheel && \ pip3 -vv install --no-cache-dir --no-index --find-links /wheel \ - errbot errbot[${INSTALL_EXTRAS}] && \ + errbot-hl errbot-hl[${INSTALL_EXTRAS}] && \ rm -rf /wheel /var/lib/apt/lists/* RUN useradd -m errbot diff --git a/README.rst b/README.rst index 24166cbde..aaad83ff1 100644 --- a/README.rst +++ b/README.rst @@ -21,6 +21,13 @@ | +Note: This is a forked version of Errbot. The main reason was, to be able to have an automated release process and release the +changes often. The base for this fork was version 6.1.9 (commit: 7609f6c) from June 2023. The first released version here is +7.0.0 and contains all unreleased changes up to commit 0080eff1324930207f021f55674d5240abae172d from 2023-10-30. + +- Docker image: `ghcr.io/hapag-lloyd/errbot-hl `__ +- PyPi package: `errbot-hl `__ + Errbot ====== diff --git a/errbot/version.py b/errbot/version.py index d04f3d94e..044958f0e 100644 --- a/errbot/version.py +++ b/errbot/version.py @@ -1,3 +1,3 @@ # Just the current version of Errbot. # It is used for deployment on pypi AND for version checking at plugin load time. -VERSION = "9.9.9" # leave it at 9.9.9 on master until it is branched to a version. +VERSION = "6.1.21" diff --git a/setup.py b/setup.py index 26ae9ffe8..99335e935 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,6 @@ #!/usr/bin/env python + # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or @@ -72,18 +73,13 @@ def read(fname, encoding="ascii"): args = set(sys.argv) - changes = read("CHANGES.rst", "utf8") - - if changes.find(VERSION) == -1: - raise Exception("You forgot to put a release note in CHANGES.rst ?!") - if args & {"bdist", "bdist_dumb", "bdist_rpm", "bdist_wininst", "bdist_msi"}: raise Exception("err doesn't support binary distributions") packages = find_packages(src_root, include=["errbot", "errbot.*"]) setup( - name="errbot", + name="errbot-hl", version=VERSION, packages=packages, entry_points={ @@ -137,7 +133,7 @@ def read(fname, encoding="ascii"): author_email="info@errbot.io", description="Errbot is a chatbot designed to be simple to extend with plugins written in Python.", long_description_content_type="text/x-rst", - long_description="".join([read("README.rst"), "\n\n", changes]), + long_description="".join([read("README.rst")]), license="GPL", keywords="xmpp irc slack hipchat gitter tox chatbot bot plugin chatops", url="http://errbot.io/", diff --git a/tests/assets/requirements_already_there.txt b/tests/assets/requirements_already_there.txt index 732a1f9f2..01cf05786 100644 --- a/tests/assets/requirements_already_there.txt +++ b/tests/assets/requirements_already_there.txt @@ -1 +1 @@ -errbot \ No newline at end of file +errbot-hl