From 0a76403dff9d1acf1f09b1cd84bef50b0cf38f0f Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Mon, 24 Apr 2023 08:30:21 +0000 Subject: [PATCH 01/11] Prepare Next Version --- ovos_tts_plugin_mimic/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ovos_tts_plugin_mimic/version.py b/ovos_tts_plugin_mimic/version.py index 443d87d..a8f245d 100644 --- a/ovos_tts_plugin_mimic/version.py +++ b/ovos_tts_plugin_mimic/version.py @@ -2,6 +2,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 2 -VERSION_BUILD = 8 +VERSION_BUILD = 9 VERSION_ALPHA = 0 # END_VERSION_BLOCK From fe8c99739ecb0acc02ad16704af93b3da1675a69 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Tue, 4 Jul 2023 12:11:50 +0100 Subject: [PATCH 02/11] feat/g2p (#9) phonemes plugin, allows mouth for movements for all TTS in the mk1 --- ovos_tts_plugin_mimic/__init__.py | 57 ++++++++++++++++++++++++++++++- setup.py | 4 ++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/ovos_tts_plugin_mimic/__init__.py b/ovos_tts_plugin_mimic/__init__.py index b0d1b86..9dd324a 100755 --- a/ovos_tts_plugin_mimic/__init__.py +++ b/ovos_tts_plugin_mimic/__init__.py @@ -13,7 +13,7 @@ import subprocess from distutils.spawn import find_executable from os.path import join, isfile, expanduser - +from ovos_plugin_manager.templates.g2p import Grapheme2PhonemePlugin, OutOfVocabulary from ovos_plugin_manager.templates.tts import TTS, TTSValidator from ovos_utils.configuration import get_xdg_base from ovos_utils.configuration import read_mycroft_config @@ -21,6 +21,61 @@ from ovos_utils.xdg_utils import xdg_config_home +class MimicPhonemesPlugin(Grapheme2PhonemePlugin): + + def __init__(self, config=None): + super().__init__(config) + self.mimic_bin = expanduser(self.config.get("binary") or + find_executable("mimic") or + "mimic") + + @staticmethod + def parse_phonemes(phonemes, normalize=False): + """Parse mimic phoneme string into a list of phone, duration pairs. + Arguments + phonemes (bytes): phoneme output from mimic + Returns: + (list) list of phoneme duration pairs + """ + phon_str = phonemes.decode() + pairs = phon_str.replace("pau", ".").split(' ') + phones = [pair.split(':') for pair in pairs if ':' in pair] + # remove silence at start/end/repeated + if normalize: + for idx, (pho, dur) in enumerate(phones): + next_pho = phones[idx + 1][0] if idx + 1 < len(phones) else None + if pho == ".": + if idx == 0 or idx == len(phones) - 1 or next_pho == ".": + phones[idx] = None + return [p for p in phones if p is not None] + + def get_mimic_phonemes(self, sentence, normalize=True): + args = [self.mimic_bin, '-psdur', '-ssml', '-t', sentence, '-o', '/tmp/mimic.pho'] + phonemes = subprocess.check_output(args) + return self.parse_phonemes(phonemes, normalize) + + def get_arpa(self, word, lang, ignore_oov=True): + if lang.lower().startswith("en"): + return [p[0].upper() for p in self.get_mimic_phonemes(word)] + if ignore_oov: + return None + raise OutOfVocabulary + + def utterance2visemes(self, utterance, lang="en", default_dur=0.4): + phonemes = self.get_mimic_phonemes(utterance, normalize=False) + return [(VISIMES.get(pho[0], '4'), float(pho[1])) for pho in phonemes] + + @property + def available_languages(self): + """Return languages supported by this G2P implementation in this state + This property should be overridden by the derived class to advertise + what languages that engine supports. + Returns: + set: supported languages + """ + return {"en"} + + class MimicTTSPlugin(TTS): """Interface to Mimic TTS.""" diff --git a/setup.py b/setup.py index f469647..0b66bb2 100755 --- a/setup.py +++ b/setup.py @@ -51,6 +51,7 @@ def required(requirements_file): PLUGIN_ENTRY_POINT = 'ovos-tts-plugin-mimic = ovos_tts_plugin_mimic:MimicTTSPlugin' +G2P_ENTRY_POINT = 'ovos-g2p-plugin-mimic = ovos_tts_plugin_mimic:MimicPhonemesPlugin' SAMPLE_CONFIGS = 'ovos-tts-plugin-mimic.config = ovos_tts_plugin_mimic:MimicTTSPluginConfig' setup( @@ -83,5 +84,6 @@ def required(requirements_file): ], keywords='mycroft plugin tts OVOS OpenVoiceOS', entry_points={'mycroft.plugin.tts': PLUGIN_ENTRY_POINT, - 'mycroft.plugin.tts.config': SAMPLE_CONFIGS} + 'mycroft.plugin.tts.config': SAMPLE_CONFIGS, + 'ovos.plugin.g2p': G2P_ENTRY_POINT} ) From 406dc5f7431268d880435a27325523e29545e22e Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Tue, 4 Jul 2023 11:12:53 +0000 Subject: [PATCH 03/11] Increment Version --- CHANGELOG.md | 12 ++++++++++++ ovos_tts_plugin_mimic/version.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b720692..ed090b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [Unreleased](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/HEAD) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.8...HEAD) + +**Implemented enhancements:** + +- feat/g2p [\#9](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/9) ([JarbasAl](https://github.com/JarbasAl)) + +## [V0.2.8](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/V0.2.8) (2023-04-24) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.8a2...V0.2.8) + ## [V0.2.8a2](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/V0.2.8a2) (2023-04-24) [Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/c26bbdcb6ac134e2b60de7870716f6130ee01389...V0.2.8a2) diff --git a/ovos_tts_plugin_mimic/version.py b/ovos_tts_plugin_mimic/version.py index a8f245d..cf4ecfc 100644 --- a/ovos_tts_plugin_mimic/version.py +++ b/ovos_tts_plugin_mimic/version.py @@ -3,5 +3,5 @@ VERSION_MAJOR = 0 VERSION_MINOR = 2 VERSION_BUILD = 9 -VERSION_ALPHA = 0 +VERSION_ALPHA = 1 # END_VERSION_BLOCK From 797e60a03f9d72c62515a313ff129c2992f1bb9e Mon Sep 17 00:00:00 2001 From: builderjer <34875857+builderjer@users.noreply.github.com> Date: Sat, 6 Jan 2024 15:21:54 -0700 Subject: [PATCH 04/11] fixes config deprecation warning (#11) --- ovos_tts_plugin_mimic/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovos_tts_plugin_mimic/__init__.py b/ovos_tts_plugin_mimic/__init__.py index 9dd324a..a629f0c 100755 --- a/ovos_tts_plugin_mimic/__init__.py +++ b/ovos_tts_plugin_mimic/__init__.py @@ -15,8 +15,8 @@ from os.path import join, isfile, expanduser from ovos_plugin_manager.templates.g2p import Grapheme2PhonemePlugin, OutOfVocabulary from ovos_plugin_manager.templates.tts import TTS, TTSValidator -from ovos_utils.configuration import get_xdg_base -from ovos_utils.configuration import read_mycroft_config +from ovos_config.meta import get_xdg_base +from ovos_config.config import read_mycroft_config from ovos_utils.lang.visimes import VISIMES from ovos_utils.xdg_utils import xdg_config_home From 92f35d19f07d2d456e086367f2ccb2ff447d0e4e Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Sat, 6 Jan 2024 22:22:32 +0000 Subject: [PATCH 05/11] Increment Version --- CHANGELOG.md | 10 +++++++++- ovos_tts_plugin_mimic/version.py | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed090b9..cbdb4fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,15 @@ ## [Unreleased](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/HEAD) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.8...HEAD) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.9a1...HEAD) + +**Fixed bugs:** + +- fixes config deprecation warning [\#11](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/11) ([builderjer](https://github.com/builderjer)) + +## [V0.2.9a1](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/V0.2.9a1) (2023-07-04) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.8...V0.2.9a1) **Implemented enhancements:** diff --git a/ovos_tts_plugin_mimic/version.py b/ovos_tts_plugin_mimic/version.py index cf4ecfc..36136de 100644 --- a/ovos_tts_plugin_mimic/version.py +++ b/ovos_tts_plugin_mimic/version.py @@ -3,5 +3,5 @@ VERSION_MAJOR = 0 VERSION_MINOR = 2 VERSION_BUILD = 9 -VERSION_ALPHA = 1 +VERSION_ALPHA = 2 # END_VERSION_BLOCK From 62b9aacf1699eea27fd1071359d6c8469b08a06d Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Fri, 26 Apr 2024 01:38:10 +0100 Subject: [PATCH 06/11] Create phonetic_spellings.txt (#12) companion to https://github.com/OpenVoiceOS/ovos-plugin-manager/pull/195 --- ovos_tts_plugin_mimic/locale/en-us/phonetic_spellings.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ovos_tts_plugin_mimic/locale/en-us/phonetic_spellings.txt diff --git a/ovos_tts_plugin_mimic/locale/en-us/phonetic_spellings.txt b/ovos_tts_plugin_mimic/locale/en-us/phonetic_spellings.txt new file mode 100644 index 0000000..a919760 --- /dev/null +++ b/ovos_tts_plugin_mimic/locale/en-us/phonetic_spellings.txt @@ -0,0 +1,7 @@ +jalepeno: hallipeenyo +ai: A.I. +mycroftai: mycroft A.I. +spotify: spot-ify +corgi: core-gee +ip: eye pea +wikipedia: wickee-peedia From 76ca2bac63590cefee6ff7ff440d4d3d6157d8a5 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Fri, 26 Apr 2024 00:38:49 +0000 Subject: [PATCH 07/11] Increment Version --- CHANGELOG.md | 14 +++++++++++++- ovos_tts_plugin_mimic/version.py | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cbdb4fe..14b6d6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,19 @@ ## [Unreleased](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/HEAD) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.9a1...HEAD) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.9a2...HEAD) + +**Implemented enhancements:** + +- Create phonetic\_spellings.txt [\#12](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/12) ([JarbasAl](https://github.com/JarbasAl)) + +**Closed issues:** + +- g2p plugin not working [\#10](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/issues/10) + +## [V0.2.9a2](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/V0.2.9a2) (2024-01-06) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.9a1...V0.2.9a2) **Fixed bugs:** diff --git a/ovos_tts_plugin_mimic/version.py b/ovos_tts_plugin_mimic/version.py index 36136de..a35cf56 100644 --- a/ovos_tts_plugin_mimic/version.py +++ b/ovos_tts_plugin_mimic/version.py @@ -3,5 +3,5 @@ VERSION_MAJOR = 0 VERSION_MINOR = 2 VERSION_BUILD = 9 -VERSION_ALPHA = 2 +VERSION_ALPHA = 3 # END_VERSION_BLOCK From 12ffc64525189ffd49c0b832863c997baa99b068 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Wed, 11 Sep 2024 03:39:28 +0100 Subject: [PATCH 08/11] feat:semver (#13) --- .github/workflows/conventional-label.yml | 10 ++ .github/workflows/dev2master.yml | 20 ---- .github/workflows/docker_tests.yml | 15 --- .github/workflows/publish_build.yml | 76 ------------ .github/workflows/publish_docker.yml | 43 ------- .github/workflows/publish_major.yml | 76 ------------ .github/workflows/publish_minor.yml | 76 ------------ .../{publish_alpha.yml => publish_stable.yml} | 66 +++++------ .github/workflows/release_workflow.yml | 108 ++++++++++++++++++ .github/workflows/unit_tests.yml | 4 +- Dockerfile | 23 ---- readme.md => README.md | 0 requirements/requirements.txt | 2 +- scripts/bump_alpha.py | 17 --- scripts/bump_build.py | 20 ---- scripts/bump_major.py | 26 ----- scripts/bump_minor.py | 23 ---- scripts/remove_alpha.py | 12 -- 18 files changed, 154 insertions(+), 463 deletions(-) create mode 100644 .github/workflows/conventional-label.yml delete mode 100644 .github/workflows/dev2master.yml delete mode 100644 .github/workflows/docker_tests.yml delete mode 100644 .github/workflows/publish_build.yml delete mode 100644 .github/workflows/publish_docker.yml delete mode 100644 .github/workflows/publish_major.yml delete mode 100644 .github/workflows/publish_minor.yml rename .github/workflows/{publish_alpha.yml => publish_stable.yml} (56%) create mode 100644 .github/workflows/release_workflow.yml delete mode 100644 Dockerfile rename readme.md => README.md (100%) delete mode 100644 scripts/bump_alpha.py delete mode 100644 scripts/bump_build.py delete mode 100644 scripts/bump_major.py delete mode 100644 scripts/bump_minor.py delete mode 100644 scripts/remove_alpha.py diff --git a/.github/workflows/conventional-label.yml b/.github/workflows/conventional-label.yml new file mode 100644 index 0000000..9894c1b --- /dev/null +++ b/.github/workflows/conventional-label.yml @@ -0,0 +1,10 @@ +# auto add labels to PRs +on: + pull_request_target: + types: [ opened, edited ] +name: conventional-release-labels +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: bcoe/conventional-release-labels@v1 diff --git a/.github/workflows/dev2master.yml b/.github/workflows/dev2master.yml deleted file mode 100644 index cc76fee..0000000 --- a/.github/workflows/dev2master.yml +++ /dev/null @@ -1,20 +0,0 @@ -# This workflow will generate a distribution and upload it to PyPI - -name: Push dev -> master -on: - workflow_dispatch: - -jobs: - build_and_publish: - 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: dev - - name: Push dev -> master - uses: ad-m/github-push-action@master - - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: master \ No newline at end of file diff --git a/.github/workflows/docker_tests.yml b/.github/workflows/docker_tests.yml deleted file mode 100644 index a29f663..0000000 --- a/.github/workflows/docker_tests.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Run Build Tests -on: - push: - workflow_dispatch: - -jobs: - docker_build_tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - - uses: docker-practice/actions-setup-docker@master - - run: | - sudo docker build . -t ovosttsserver diff --git a/.github/workflows/publish_build.yml b/.github/workflows/publish_build.yml deleted file mode 100644 index 9fdcd30..0000000 --- a/.github/workflows/publish_build.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This workflow will generate a distribution and upload it to PyPI - -name: Publish Build Release ..X -on: - workflow_dispatch: - -jobs: - build_and_publish: - 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: Remove alpha (declare stable) - run: | - VER=$(python setup.py --version) - python scripts/remove_alpha.py - - name: "Generate release changelog" - uses: heinrichreimer/github-changelog-generator-action@v2.3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - id: changelog - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Declare alpha stable - branch: dev - - name: Push dev -> master - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: master - force: true - - 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: false - - name: Build Distribution Packages - run: | - python setup.py bdist_wheel - - name: Prepare next Build version - run: echo "::set-output name=version::$(python setup.py --version)" - id: alpha - - name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0 - run: | - VER=$(python setup.py --version) - python scripts/bump_build.py - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Prepare Next Version - branch: dev - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{secrets.PYPI_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml deleted file mode 100644 index 20d3317..0000000 --- a/.github/workflows/publish_docker.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Publish Mimic Container -on: - workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: OpenVoiceOS/mimic - -jobs: - build_and_publish_docker: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Extract metadata for Docker - id: meta - uses: docker/metadata-action@v2 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=branch - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - diff --git a/.github/workflows/publish_major.yml b/.github/workflows/publish_major.yml deleted file mode 100644 index 87cee86..0000000 --- a/.github/workflows/publish_major.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This workflow will generate a distribution and upload it to PyPI - -name: Publish Major Release X.0.0 -on: - workflow_dispatch: - -jobs: - build_and_publish: - 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: Remove alpha (declare stable) - run: | - VER=$(python setup.py --version) - python scripts/remove_alpha.py - - name: "Generate release changelog" - uses: heinrichreimer/github-changelog-generator-action@v2.3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - id: changelog - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Declare alpha stable - branch: dev - - name: Push dev -> master - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: master - force: true - - 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: false - - name: Build Distribution Packages - run: | - python setup.py bdist_wheel - - name: Prepare next Major version - run: echo "::set-output name=version::$(python setup.py --version)" - id: alpha - - name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0 - run: | - VER=$(python setup.py --version) - python scripts/bump_major.py - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Prepare Next Version - branch: dev - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{secrets.PYPI_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/publish_minor.yml b/.github/workflows/publish_minor.yml deleted file mode 100644 index 4e8b231..0000000 --- a/.github/workflows/publish_minor.yml +++ /dev/null @@ -1,76 +0,0 @@ -# This workflow will generate a distribution and upload it to PyPI - -name: Publish Minor Release .X.0 -on: - workflow_dispatch: - -jobs: - build_and_publish: - 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: Remove alpha (declare stable) - run: | - VER=$(python setup.py --version) - python scripts/remove_alpha.py - - name: "Generate release changelog" - uses: heinrichreimer/github-changelog-generator-action@v2.3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - id: changelog - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Declare alpha stable - branch: dev - - name: Push dev -> master - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: master - force: true - - 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: false - - name: Build Distribution Packages - run: | - python setup.py bdist_wheel - - name: Prepare next Minor version - run: echo "::set-output name=version::$(python setup.py --version)" - id: alpha - - name: Increment Version ${{ steps.alpha.outputs.version }}Alpha0 - run: | - VER=$(python setup.py --version) - python scripts/bump_minor.py - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Prepare Next Version - branch: dev - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{secrets.PYPI_TOKEN}} \ No newline at end of file diff --git a/.github/workflows/publish_alpha.yml b/.github/workflows/publish_stable.yml similarity index 56% rename from .github/workflows/publish_alpha.yml rename to .github/workflows/publish_stable.yml index 82bbe0a..725f749 100644 --- a/.github/workflows/publish_alpha.yml +++ b/.github/workflows/publish_stable.yml @@ -1,25 +1,22 @@ -# This workflow will generate a distribution and upload it to PyPI - -name: Publish Alpha Build ...aX +name: Stable Release on: push: - branches: - - dev - paths-ignore: - - 'ovos_tts_plugin_mimic/version.py' - - 'test/**' - - 'examples/**' - - '.github/**' - - '.gitignore' - - 'LICENSE' - - 'CHANGELOG.md' - - 'MANIFEST.in' - - 'readme.md' - - 'scripts/**' + branches: [master] workflow_dispatch: jobs: - build_and_publish: + publish_stable: + uses: TigreGotico/gh-automations/.github/workflows/publish-stable.yml@master + secrets: inherit + with: + branch: 'master' + version_file: 'ovos_tts_plugin_mimic/version.py' + setup_py: 'setup.py' + 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 @@ -33,20 +30,6 @@ jobs: - name: Install Build Tools run: | python -m pip install build wheel - - name: Increment Version - run: | - VER=$(python setup.py --version) - python scripts/bump_alpha.py - - name: "Generate release changelog" - uses: heinrichreimer/github-changelog-generator-action@v2.3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - id: changelog - - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Increment Version - branch: dev - name: version run: echo "::set-output name=version::$(python setup.py --version)" id: version @@ -63,10 +46,27 @@ jobs: ${{ steps.changelog.outputs.changelog }} draft: false prerelease: true + commitish: dev - name: Build Distribution Packages run: | - python setup.py bdist_wheel + python setup.py sdist bdist_wheel - name: Publish to Test PyPI uses: pypa/gh-action-pypi-publish@master with: - password: ${{secrets.PYPI_TOKEN}} \ No newline at end of file + 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 diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml new file mode 100644 index 0000000..fa0b570 --- /dev/null +++ b/.github/workflows/release_workflow.yml @@ -0,0 +1,108 @@ +name: Release Alpha and Propose Stable + +on: + pull_request: + types: [closed] + branches: [dev] + +jobs: + publish_alpha: + if: github.event.pull_request.merged == true + uses: TigreGotico/gh-automations/.github/workflows/publish-alpha.yml@master + secrets: inherit + with: + branch: 'dev' + version_file: 'ovos_tts_plugin_mimic/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 + diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 129ae3f..c7f3010 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -12,7 +12,7 @@ on: - 'LICENSE' - 'CHANGELOG.md' - 'MANIFEST.in' - - 'readme.md' + - 'README.md' - 'scripts/**' push: branches: @@ -26,7 +26,7 @@ on: - 'LICENSE' - 'CHANGELOG.md' - 'MANIFEST.in' - - 'readme.md' + - 'README.md' - 'scripts/**' workflow_dispatch: diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 6ee691b..0000000 --- a/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM debian:buster-slim - -RUN apt-get update && \ - apt-get install -y git python3 python3-dev python3-pip portaudio19-dev curl build-essential - -RUN curl https://forslund.github.io/mycroft-desktop-repo/mycroft-desktop.gpg.key | \ - apt-key add - 2>/dev/null && \ - echo "deb http://forslund.github.io/mycroft-desktop-repo bionic main" \ - > /etc/apt/sources.list.d/mycroft-mimic.list && \ - apt-get update && \ - apt-get install -y mimic && \ - apt-get -y autoremove && \ - apt-get clean - - -RUN pip3 install ovos-utils==0.0.15 -RUN pip3 install ovos-plugin-manager==0.0.4 -RUN pip3 install ovos-tts-server==0.0.2 - -COPY . /tmp/ovos-tts-plugin-mimic -RUN pip3 install /tmp/ovos-tts-plugin-mimic - -ENTRYPOINT ovos-tts-server --engine ovos-tts-plugin-mimic \ No newline at end of file diff --git a/readme.md b/README.md similarity index 100% rename from readme.md rename to README.md diff --git a/requirements/requirements.txt b/requirements/requirements.txt index a5e66b9..ec9d01a 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -1 +1 @@ -ovos-plugin-manager>=0.0.5 \ No newline at end of file +ovos-plugin-manager>=0.0.5,<1.0.0 \ No newline at end of file diff --git a/scripts/bump_alpha.py b/scripts/bump_alpha.py deleted file mode 100644 index f4e928c..0000000 --- a/scripts/bump_alpha.py +++ /dev/null @@ -1,17 +0,0 @@ -import fileinput -from os.path import join, dirname - -version_file = join(dirname(dirname(__file__)), "ovos_tts_plugin_mimic", "version.py") -version_var_name = "VERSION_ALPHA" - -with open(version_file, "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith(version_var_name): - version = int(line.split("=")[-1]) - new_version = int(version) + 1 - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(version_var_name): - print(f"{version_var_name} = {new_version}") - else: - print(line.rstrip('\n')) diff --git a/scripts/bump_build.py b/scripts/bump_build.py deleted file mode 100644 index 69ffcef..0000000 --- a/scripts/bump_build.py +++ /dev/null @@ -1,20 +0,0 @@ -import fileinput -from os.path import join, dirname - -version_file = join(dirname(dirname(__file__)), "ovos_tts_plugin_mimic", "version.py") -version_var_name = "VERSION_BUILD" -alpha_var_name = "VERSION_ALPHA" - -with open(version_file, "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith(version_var_name): - version = int(line.split("=")[-1]) - new_version = int(version) + 1 - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(version_var_name): - print(f"{version_var_name} = {new_version}") - elif line.startswith(alpha_var_name): - print(f"{alpha_var_name} = 0") - else: - print(line.rstrip('\n')) diff --git a/scripts/bump_major.py b/scripts/bump_major.py deleted file mode 100644 index adc04b4..0000000 --- a/scripts/bump_major.py +++ /dev/null @@ -1,26 +0,0 @@ -import fileinput -from os.path import join, dirname - -version_file = join(dirname(dirname(__file__)), "ovos_tts_plugin_mimic", "version.py") -version_var_name = "VERSION_MAJOR" -minor_var_name = "VERSION_MINOR" -build_var_name = "VERSION_BUILD" -alpha_var_name = "VERSION_ALPHA" - -with open(version_file, "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith(version_var_name): - version = int(line.split("=")[-1]) - new_version = int(version) + 1 - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(version_var_name): - print(f"{version_var_name} = {new_version}") - elif line.startswith(minor_var_name): - print(f"{minor_var_name} = 0") - elif line.startswith(build_var_name): - print(f"{build_var_name} = 0") - elif line.startswith(alpha_var_name): - print(f"{alpha_var_name} = 0") - else: - print(line.rstrip('\n')) diff --git a/scripts/bump_minor.py b/scripts/bump_minor.py deleted file mode 100644 index 7ea1f09..0000000 --- a/scripts/bump_minor.py +++ /dev/null @@ -1,23 +0,0 @@ -import fileinput -from os.path import join, dirname - -version_file = join(dirname(dirname(__file__)), "ovos_tts_plugin_mimic", "version.py") -version_var_name = "VERSION_MINOR" -build_var_name = "VERSION_BUILD" -alpha_var_name = "VERSION_ALPHA" - -with open(version_file, "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith(version_var_name): - version = int(line.split("=")[-1]) - new_version = int(version) + 1 - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(version_var_name): - print(f"{version_var_name} = {new_version}") - elif line.startswith(build_var_name): - print(f"{build_var_name} = 0") - elif line.startswith(alpha_var_name): - print(f"{alpha_var_name} = 0") - else: - print(line.rstrip('\n')) diff --git a/scripts/remove_alpha.py b/scripts/remove_alpha.py deleted file mode 100644 index a65134d..0000000 --- a/scripts/remove_alpha.py +++ /dev/null @@ -1,12 +0,0 @@ -import fileinput -from os.path import join, dirname - -version_file = join(dirname(dirname(__file__)), "ovos_tts_plugin_mimic", "version.py") - -alpha_var_name = "VERSION_ALPHA" - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(alpha_var_name): - print(f"{alpha_var_name} = 0") - else: - print(line.rstrip('\n')) From bc9e43143ac35c9344af47c86c263b05a277e928 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Wed, 11 Sep 2024 02:39:43 +0000 Subject: [PATCH 09/11] Increment Version to 0.2.9a4 --- ovos_tts_plugin_mimic/version.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ovos_tts_plugin_mimic/version.py b/ovos_tts_plugin_mimic/version.py index a35cf56..a4282e3 100644 --- a/ovos_tts_plugin_mimic/version.py +++ b/ovos_tts_plugin_mimic/version.py @@ -1,7 +1,6 @@ -# The following lines are replaced during the release process. # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 2 VERSION_BUILD = 9 -VERSION_ALPHA = 3 -# END_VERSION_BLOCK +VERSION_ALPHA = 4 +# END_VERSION_BLOCK \ No newline at end of file From 158f4245e82986b41013dc7cf901261e37b2908c Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Wed, 11 Sep 2024 02:40:11 +0000 Subject: [PATCH 10/11] Update Changelog --- CHANGELOG.md | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b6d6c..8e6cda6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,16 @@ # Changelog -## [Unreleased](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/HEAD) +## [0.2.9a4](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/0.2.9a4) (2024-09-11) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.9a2...HEAD) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.9a3...0.2.9a4) + +**Merged pull requests:** + +- feat:semver [\#13](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/13) ([JarbasAl](https://github.com/JarbasAl)) + +## [V0.2.9a3](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/V0.2.9a3) (2024-04-26) + +[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.9a2...V0.2.9a3) **Implemented enhancements:** @@ -28,30 +36,6 @@ - feat/g2p [\#9](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/9) ([JarbasAl](https://github.com/JarbasAl)) -## [V0.2.8](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/V0.2.8) (2023-04-24) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/V0.2.8a2...V0.2.8) - -## [V0.2.8a2](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/tree/V0.2.8a2) (2023-04-24) - -[Full Changelog](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/compare/c26bbdcb6ac134e2b60de7870716f6130ee01389...V0.2.8a2) - -**Implemented enhancements:** - -- move ui data to "meta" [\#8](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/8) ([JarbasAl](https://github.com/JarbasAl)) -- Feat/available langs [\#6](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/6) ([NeonJarbas](https://github.com/NeonJarbas)) -- Feat/workflows [\#3](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/3) ([JarbasAl](https://github.com/JarbasAl)) - -**Fixed bugs:** - -- en-uk vs en-us [\#5](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/5) ([NeonJarbas](https://github.com/NeonJarbas)) - -**Merged pull requests:** - -- add "offline" metadata key [\#7](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/7) ([NeonJarbas](https://github.com/NeonJarbas)) -- feat/sample\_configs [\#4](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/4) ([NeonJarbas](https://github.com/NeonJarbas)) -- Added lang=None to get\_tts for compatibility [\#1](https://github.com/OpenVoiceOS/ovos-tts-plugin-mimic/pull/1) ([Joanguitar](https://github.com/Joanguitar)) - \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* From b71d7799623e3d6914a15bea2a02d70f4899cb75 Mon Sep 17 00:00:00 2001 From: JarbasAI <33701864+JarbasAl@users.noreply.github.com> Date: Wed, 11 Sep 2024 03:41:52 +0100 Subject: [PATCH 11/11] Update version.py --- ovos_tts_plugin_mimic/version.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ovos_tts_plugin_mimic/version.py b/ovos_tts_plugin_mimic/version.py index a4282e3..c75405b 100644 --- a/ovos_tts_plugin_mimic/version.py +++ b/ovos_tts_plugin_mimic/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 -VERSION_MINOR = 2 -VERSION_BUILD = 9 -VERSION_ALPHA = 4 -# END_VERSION_BLOCK \ No newline at end of file +VERSION_MINOR = 3 +VERSION_BUILD = 0 +VERSION_ALPHA = 1 +# END_VERSION_BLOCK