diff --git a/.github/workflows/build-tests.yml b/.github/workflows/build-tests.yml new file mode 100644 index 0000000..ad311b2 --- /dev/null +++ b/.github/workflows/build-tests.yml @@ -0,0 +1,13 @@ +name: Build Tests + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + build: + uses: OpenVoiceOS/gh-automations/.github/workflows/build-tests.yml@dev + secrets: inherit + with: + python_versions: '["3.10", "3.11", "3.12", "3.13", "3.14"]' diff --git a/.github/workflows/license_check.yml b/.github/workflows/license_check.yml new file mode 100644 index 0000000..8757eee --- /dev/null +++ b/.github/workflows/license_check.yml @@ -0,0 +1,11 @@ +name: License Check + +on: + pull_request: + branches: [dev] + workflow_dispatch: + +jobs: + license_check: + uses: OpenVoiceOS/gh-automations/.github/workflows/license-check.yml@dev + secrets: inherit diff --git a/.github/workflows/license_tests.yml b/.github/workflows/license_tests.yml deleted file mode 100644 index 7d0c4f6..0000000 --- a/.github/workflows/license_tests.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Run License Tests -on: - push: - workflow_dispatch: - pull_request: - branches: - - master -jobs: - license_tests: - uses: neongeckocom/.github/.github/workflows/license_tests.yml@master diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..aa45c3d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,14 @@ +name: Lint + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + lint: + uses: OpenVoiceOS/gh-automations/.github/workflows/lint.yml@dev + secrets: inherit + with: + ruff: true + pre_commit: false diff --git a/.github/workflows/opm-check.yml b/.github/workflows/opm-check.yml new file mode 100644 index 0000000..7545741 --- /dev/null +++ b/.github/workflows/opm-check.yml @@ -0,0 +1,14 @@ +name: OPM Plugin Check + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + opm_check: + uses: OpenVoiceOS/gh-automations/.github/workflows/opm-check.yml@dev + secrets: inherit + with: + python_version: '3.11' + plugin_type: 'auto' diff --git a/.github/workflows/pip_audit.yml b/.github/workflows/pip_audit.yml new file mode 100644 index 0000000..bb3ca4d --- /dev/null +++ b/.github/workflows/pip_audit.yml @@ -0,0 +1,11 @@ +name: PIP Audit + +on: + pull_request: + branches: [dev] + workflow_dispatch: + +jobs: + pip_audit: + uses: OpenVoiceOS/gh-automations/.github/workflows/pip-audit.yml@dev + secrets: inherit diff --git a/.github/workflows/publish_stable.yml b/.github/workflows/publish_stable.yml index 59302c4..4faee45 100644 --- a/.github/workflows/publish_stable.yml +++ b/.github/workflows/publish_stable.yml @@ -1,72 +1,23 @@ -name: Stable Release +name: Publish Stable Release + on: - push: - branches: [master] workflow_dispatch: + push: + branches: [master, main] + +permissions: + contents: write # required for version bump commit and release tag jobs: publish_stable: - uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master - secrets: inherit + if: github.actor != 'github-actions[bot]' + uses: OpenVoiceOS/gh-automations/.github/workflows/publish-stable.yml@dev + secrets: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }} with: - branch: 'master' version_file: 'ovos_PHAL_plugin_oauth/version.py' - setup_py: 'setup.py' + publish_pypi: true publish_release: true - - publish_pypi: - needs: publish_stable - if: success() # Ensure this job only runs if the previous job succeeds - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: dev - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: version - run: echo "::set-output name=version::$(python setup.py --version)" - id: version - - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: V${{ steps.version.outputs.version }} - release_name: Release ${{ steps.version.outputs.version }} - body: | - Changes in this Release - ${{ steps.changelog.outputs.changelog }} - draft: false - prerelease: true - commitish: dev - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{secrets.PYPI_TOKEN}} - - - sync_dev: - needs: publish_stable - if: success() # Ensure this job only runs if the previous job succeeds - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - ref: master - - name: Push master -> dev - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: dev \ No newline at end of file + sync_dev: true + notify_matrix: true diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml new file mode 100644 index 0000000..0621684 --- /dev/null +++ b/.github/workflows/release-preview.yml @@ -0,0 +1,14 @@ +name: Release Preview + +on: + pull_request: + branches: [dev] + workflow_dispatch: + +jobs: + release_preview: + uses: OpenVoiceOS/gh-automations/.github/workflows/release-preview.yml@dev + secrets: inherit + with: + package_name: 'ovos_PHAL_plugin_oauth' + version_file: 'ovos_PHAL_plugin_oauth/version.py' diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml index c16bee2..4169ae0 100644 --- a/.github/workflows/release_workflow.yml +++ b/.github/workflows/release_workflow.yml @@ -1,108 +1,28 @@ name: Release Alpha and Propose Stable on: + workflow_dispatch: pull_request: types: [closed] branches: [dev] +permissions: + contents: write + pull-requests: write + jobs: publish_alpha: - if: github.event.pull_request.merged == true - uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master - secrets: inherit + if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' + uses: OpenVoiceOS/gh-automations/.github/workflows/publish-alpha.yml@dev + secrets: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + MATRIX_TOKEN: ${{ secrets.MATRIX_TOKEN }} with: branch: 'dev' version_file: 'ovos_PHAL_plugin_oauth/version.py' - setup_py: 'setup.py' update_changelog: true publish_prerelease: true - changelog_max_issues: 100 - - notify: - if: github.event.pull_request.merged == true - needs: publish_alpha - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Send message to Matrix bots channel - id: matrix-chat-message - uses: fadenb/matrix-chat-message@v0.0.6 - with: - homeserver: 'matrix.org' - token: ${{ secrets.MATRIX_TOKEN }} - channel: '!WjxEKjjINpyBRPFgxl:krbel.duckdns.org' - message: | - new ${{ github.event.repository.name }} PR merged! https://github.com/${{ github.repository }}/pull/${{ github.event.number }} - - publish_pypi: - needs: publish_alpha - if: success() # Ensure this job only runs if the previous job succeeds - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: dev - fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - name: Install Build Tools - run: | - python -m pip install build wheel - - name: version - run: echo "::set-output name=version::$(python setup.py --version)" - id: version - - name: Build Distribution Packages - run: | - python setup.py sdist bdist_wheel - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{secrets.PYPI_TOKEN}} - - - propose_release: - needs: publish_alpha - if: success() # Ensure this job only runs if the previous job succeeds - runs-on: ubuntu-latest - steps: - - name: Checkout dev branch - uses: actions/checkout@v3 - with: - ref: dev - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - - - name: Get version from setup.py - id: get_version - run: | - VERSION=$(python setup.py --version) - echo "VERSION=$VERSION" >> $GITHUB_ENV - - - name: Create and push new branch - run: | - git checkout -b release-${{ env.VERSION }} - git push origin release-${{ env.VERSION }} - - - name: Open Pull Request from dev to master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Variables - BRANCH_NAME="release-${{ env.VERSION }}" - BASE_BRANCH="master" - HEAD_BRANCH="release-${{ env.VERSION }}" - PR_TITLE="Release ${{ env.VERSION }}" - PR_BODY="Human review requested!" - - # Create a PR using GitHub API - curl -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token $GITHUB_TOKEN" \ - -d "{\"title\":\"$PR_TITLE\",\"body\":\"$PR_BODY\",\"head\":\"$HEAD_BRANCH\",\"base\":\"$BASE_BRANCH\"}" \ - https://api.github.com/repos/${{ github.repository }}/pulls - + propose_release: true + changelog_max_issues: 50 + publish_pypi: true + notify_matrix: true diff --git a/.github/workflows/repo-health.yml b/.github/workflows/repo-health.yml new file mode 100644 index 0000000..bdaa4eb --- /dev/null +++ b/.github/workflows/repo-health.yml @@ -0,0 +1,13 @@ +name: Repo Health + +on: + pull_request: + branches: [dev, master, main] + workflow_dispatch: + +jobs: + repo_health: + uses: OpenVoiceOS/gh-automations/.github/workflows/repo-health.yml@dev + secrets: inherit + with: + version_file: 'ovos_PHAL_plugin_oauth/version.py' diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml deleted file mode 100644 index 3e380f3..0000000 --- a/.github/workflows/unit_tests.yml +++ /dev/null @@ -1,10 +0,0 @@ -name: Unit Tests -on: - push: - workflow_dispatch: - -jobs: - py_build_tests: - uses: neongeckocom/.github/.github/workflows/python_build_tests.yml@master - with: - python_version: "3.8" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5be74f4..85285c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,44 @@ # Changelog -## [0.1.3a1](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/tree/0.1.3a1) (2024-11-20) +## [0.1.6a2](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/tree/0.1.6a2) (2026-06-16) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/compare/V0.1.2...0.1.3a1) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/compare/0.1.6a1...0.1.6a2) **Merged pull requests:** -- move oauth utils to ovos-utils and deprecate backend-client [\#28](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/pull/28) ([JarbasAl](https://github.com/JarbasAl)) +- chore: add missing shared CI workflows [\#39](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/pull/39) ([JarbasAl](https://github.com/JarbasAl)) -## [V0.1.2](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/tree/V0.1.2) (2024-11-06) +## [0.1.6a1](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/tree/0.1.6a1) (2026-06-06) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/compare/0.1.2...V0.1.2) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/compare/0.1.5a1...0.1.6a1) + +## [0.1.5a1](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/tree/0.1.5a1) (2026-06-06) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/compare/0.1.4a2...0.1.5a1) + +**Merged pull requests:** + +- fix\(deps\): allow ovos-bus-client 2.x \(widen cap to \<3.0.0\) [\#38](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/pull/38) ([JarbasAl](https://github.com/JarbasAl)) + +## [0.1.4a2](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/tree/0.1.4a2) (2025-12-19) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/compare/0.1.4a1...0.1.4a2) + +**Merged pull requests:** + +- chore\(deps\): update dependency python to 3.14 [\#31](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/pull/31) ([renovate[bot]](https://github.com/apps/renovate)) + +## [0.1.4a1](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/tree/0.1.4a1) (2025-12-18) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/compare/V0.1.3...0.1.4a1) + +**Merged pull requests:** + +- chore: Configure Renovate [\#30](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/pull/30) ([renovate[bot]](https://github.com/apps/renovate)) + +## [V0.1.3](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/tree/V0.1.3) (2024-11-20) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth/compare/0.1.3...V0.1.3) diff --git a/ovos_PHAL_plugin_oauth/version.py b/ovos_PHAL_plugin_oauth/version.py index 35edff0..486c9d8 100644 --- a/ovos_PHAL_plugin_oauth/version.py +++ b/ovos_PHAL_plugin_oauth/version.py @@ -1,6 +1,7 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 1 -VERSION_BUILD = 3 -VERSION_ALPHA = 0 +VERSION_BUILD = 6 +VERSION_ALPHA = 2 # END_VERSION_BLOCK +__version__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_BUILD}" + (f"a{VERSION_ALPHA}" if VERSION_ALPHA else "") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..a43eb30 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,44 @@ +[build-system] +requires = ["setuptools>=61", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "ovos-PHAL-plugin-oauth" +dynamic = ["version"] +description = "A plugin for OpenVoiceOS hardware abstraction layer" +readme = "README.md" +license = {text = "Apache-2.0"} +authors = [ + {name = "JarbasAi", email = "jarbasai@mailfence.com"} +] +requires-python = ">=3.5" +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Topic :: Text Processing :: Linguistic", + "License :: OSI Approved :: Apache Software License", + "Programming Language :: Python :: 3" +] +dependencies = [ + "ovos-utils>=0.4.1,<1.0.0", + "ovos-bus-client>=0.0.3,<3.0.0", + "Flask>=0.12", + "oauthlib~=3.0", + "qrcode[pil]~=7.3.1" +] + +[project.urls] +Homepage = "https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth" + +[project.entry-points."opm.phal"] +"ovos-PHAL-plugin-oauth" = "ovos_PHAL_plugin_oauth:OAuthPlugin" + +[tool.setuptools.dynamic] +version = {attr = "ovos_PHAL_plugin_oauth.version.__version__"} + +[tool.setuptools.packages.find] +where = ["."] +include = ["ovos_PHAL_plugin_oauth*"] + +[tool.setuptools.package-data] +ovos_PHAL_plugin_oauth = ["*.json"] diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..5db72dd --- /dev/null +++ b/renovate.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] +} diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index ffa2b4a..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -ovos-utils>=0.4.1,<1.0.0 -ovos-bus-client>=0.0.3,<2.0.0 -Flask>=0.12 -oauthlib~=3.0 -qrcode[pil]~=7.3.1 diff --git a/setup.py b/setup.py deleted file mode 100755 index a079a7a..0000000 --- a/setup.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/env python3 -import os -from setuptools import setup - -BASEDIR = os.path.abspath(os.path.dirname(__file__)) - - -def get_version(): - """ Find the version of the package""" - version_file = os.path.join(BASEDIR, 'ovos_PHAL_plugin_oauth', 'version.py') - major, minor, build, alpha = (None, None, None, None) - with open(version_file) as f: - for line in f: - if 'VERSION_MAJOR' in line: - major = line.split('=')[1].strip() - elif 'VERSION_MINOR' in line: - minor = line.split('=')[1].strip() - elif 'VERSION_BUILD' in line: - build = line.split('=')[1].strip() - elif 'VERSION_ALPHA' in line: - alpha = line.split('=')[1].strip() - - if ((major and minor and build and alpha) or - '# END_VERSION_BLOCK' in line): - break - version = f"{major}.{minor}.{build}" - if alpha and int(alpha) > 0: - version += f"a{alpha}" - return version - - -def package_files(directory): - paths = [] - for (path, directories, filenames) in os.walk(directory): - for filename in filenames: - paths.append(os.path.join('..', path, filename)) - return paths - - -def get_description(): - with open(os.path.join(BASEDIR, "README.md"), "r") as f: - long_description = f.read() - return long_description - - -def required(requirements_file): - """ Read requirements file and remove comments and empty lines. """ - with open(os.path.join(BASEDIR, requirements_file), 'r') as f: - requirements = f.read().splitlines() - if 'MYCROFT_LOOSE_REQUIREMENTS' in os.environ: - print('USING LOOSE REQUIREMENTS!') - requirements = [r.replace('==', '>=').replace('~=', '>=') - for r in requirements] - return [pkg for pkg in requirements - if pkg.strip() and not pkg.startswith("#")] - - -PLUGIN_ENTRY_POINT = 'ovos-PHAL-plugin-oauth=ovos_PHAL_plugin_oauth:OAuthPlugin' -setup( - name='ovos-PHAL-plugin-oauth', - version=get_version(), - description='A plugin for OpenVoiceOS hardware abstraction layer', - long_description=get_description(), - long_description_content_type="text/markdown", - url='https://github.com/OpenVoiceOS/ovos-PHAL-plugin-oauth', - author='JarbasAi', - author_email='jarbasai@mailfence.com', - license='Apache-2.0', - packages=['ovos_PHAL_plugin_oauth'], - package_data={'': package_files('ovos_PHAL_plugin_oauth')}, - install_requires=required("requirements.txt"), - zip_safe=True, - classifiers=[ - 'Development Status :: 3 - Alpha', - 'Intended Audience :: Developers', - 'Topic :: Text Processing :: Linguistic', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - ], - entry_points={'ovos.plugin.phal': PLUGIN_ENTRY_POINT} -)