diff --git a/.github/workflows/auto_translate.yml b/.github/workflows/auto_translate.yml deleted file mode 100644 index 97552f3..0000000 --- a/.github/workflows/auto_translate.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Auto translate -on: - workflow_dispatch: - -jobs: - autotranslate: - uses: openvoiceos/.github/.github/workflows/auto_translate.yml@feat/shared_actions1 - with: - branch: dev - action_branch: feat/shared_actions1 - python_version: "3.10" - locale_folder: locale diff --git a/.github/workflows/build_tests.yml b/.github/workflows/build_tests.yml new file mode 100644 index 0000000..c7283ba --- /dev/null +++ b/.github/workflows/build_tests.yml @@ -0,0 +1,39 @@ +name: Run Build Tests +on: + push: + branches: + - master + pull_request: + branches: + - dev + workflow_dispatch: + +jobs: + build_tests: + strategy: + max-parallel: 2 + matrix: + python-version: ["3.10", "3.11"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install Build Tools + run: | + python -m pip install build wheel + - name: Install System Dependencies + run: | + sudo apt-get update + sudo apt install python3-dev swig libssl-dev + - name: Build Source Packages + run: | + python setup.py sdist + - name: Build Distribution Packages + run: | + python setup.py bdist_wheel + - name: Install skill + run: | + pip install . diff --git a/.github/workflows/conventional_label.yml b/.github/workflows/conventional_label.yml new file mode 100644 index 0000000..174741d --- /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/license_tests.yml b/.github/workflows/license_tests.yml deleted file mode 100644 index 6e69868..0000000 --- a/.github/workflows/license_tests.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: License tests -on: - workflow_dispatch: - push: - -jobs: - license: - uses: openvoiceos/.github/.github/workflows/license_tests.yml@feat/shared_actions1 - with: - branch: ${{ github.head_ref }} - action_branch: feat/shared_actions1 - python_version: 3.10 diff --git a/.github/workflows/propose_stable_release.yml b/.github/workflows/propose_stable_release.yml deleted file mode 100644 index 6f3d1aa..0000000 --- a/.github/workflows/propose_stable_release.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Propose Stable Build -on: - workflow_dispatch: - inputs: - release_type: - type: choice - options: - - "patch" - - "minor" - - "major" - -jobs: - build_and_publish: - uses: openvoiceos/.github/.github/workflows/propose_semver_release.yml@feat/shared_actions1 - with: - python_version: "3.10" - version_file: skill_randomness/version.py - release_type: ${{inputs.release_type}} # build, minor, major diff --git a/.github/workflows/propose_translation.yml b/.github/workflows/propose_translation.yml deleted file mode 100644 index e48e0b3..0000000 --- a/.github/workflows/propose_translation.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Propose Translations -on: - workflow_dispatch: - inputs: - translations: # wait for dispatcher input for a langcode (xx-xx) - type: string - required: true - -jobs: - propose_translation: - uses: openvoiceos/.github/.github/workflows/propose_translation.yml@feat/shared_actions1 - secrets: inherit - with: - action_branch: feat/shared_actions1 - python_version: "3.10" - language: ${{ inputs.translations }} - reviewers: "jarbasai,emphasize" diff --git a/.github/workflows/publish_alpha.yml b/.github/workflows/publish_alpha.yml deleted file mode 100644 index b43f906..0000000 --- a/.github/workflows/publish_alpha.yml +++ /dev/null @@ -1,72 +0,0 @@ -# This workflow will generate a distribution and upload it to PyPI - -name: Publish Alpha Build ...aX -on: - push: - branches: - - dev - paths-ignore: - - 'test/**' - - 'examples/**' - - '.github/**' - - '.gitignore' - - 'LICENSE' - - 'CHANGELOG.md' - - 'MANIFEST.in' - - 'readme.md' - - 'scripts/**' - - 'translations/**' - 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: 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: Prepare alpha version package - branch: dev - - 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 - - name: Build Distribution Packages - run: | - python setup.py bdist_wheel - - name: Publish to Test PyPI - uses: pypa/gh-action-pypi-publish@master - with: - password: ${{secrets.PYPI_TOKEN}} diff --git a/.github/workflows/publish_alpha_build.yml b/.github/workflows/publish_alpha_build.yml deleted file mode 100644 index 1ca51f3..0000000 --- a/.github/workflows/publish_alpha_build.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Publish Alpha Build ...aX -on: - push: - branches: - - dev - paths-ignore: - - "ovos_core/version.py" - - "test/**" - - "examples/**" - - ".github/**" - - ".gitignore" - - "LICENSE" - - "CHANGELOG.md" - - "MANIFEST.in" - - "readme.md" - - "scripts/**" - workflow_dispatch: - -jobs: - build_and_publish: - uses: openvoiceos/.github/.github/workflows/publish_alpha_release.yml@feat/shared_actions1 - secrets: inherit - with: - version_file: skill_randomness/version.py # File location of the version file, default: version.py - python_version: "3.10" - locale_folder: skill_randomness/locale - update_intentfile: test/test_intents.yaml - changelog_file: CHANGELOG.md diff --git a/.github/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml deleted file mode 100644 index 355b952..0000000 --- a/.github/workflows/pull-request-lint.yml +++ /dev/null @@ -1,24 +0,0 @@ -# ~~ Generated by projen. To modify, edit .projenrc.json and run "npx projen". - -name: pull-request-lint -on: - pull_request_target: - types: - - labeled - - opened - - synchronize - - reopened - - ready_for_review - - edited -jobs: - validate: - name: Validate PR title - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - uses: amannn/action-semantic-pull-request@v5.0.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - requireScope: false diff --git a/.github/workflows/release_workflow.yml b/.github/workflows/release_workflow.yml new file mode 100644 index 0000000..02ee326 --- /dev/null +++ b/.github/workflows/release_workflow.yml @@ -0,0 +1,105 @@ +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: "skill_randomness/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@v4 + - 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@v4 + with: + ref: dev + fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.8 + - name: Install Build Tools + run: | + python -m pip install build wheel + - name: version + run: echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT + id: version + - name: Build Distribution Packages + run: | + python setup.py sdist bdist_wheel + - name: Publish to 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@v4 + with: + ref: dev + + - name: Setup Python + uses: actions/setup-python@v5 + 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 + 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/skill_tests.yml b/.github/workflows/skill_tests.yml index ef4ebfd..bbea614 100644 --- a/.github/workflows/skill_tests.yml +++ b/.github/workflows/skill_tests.yml @@ -1,25 +1,34 @@ -# ~~ Generated by projen. To modify, edit .projenrc.json and run "npx projen". - name: skill_tests on: pull_request: {} workflow_dispatch: {} jobs: - py_build_tests: - name: py_build_tests - permissions: - contents: read - uses: openvoiceos/.github/.github/workflows/python_build_tests.yml@feat/shared_actions1 - with: - python_matrix: '[3.9, "3.10", "3.11"]' + # skill_unit_tests: + # name: skill_unit_tests + # permissions: + # contents: read + # uses: neongeckocom/.github/.github/workflows/skill_tests.yml@master + # with: + # ovos_versions: '["3.10", "3.11"]' skill_unit_tests: name: skill_unit_tests - permissions: - contents: read - uses: openvoiceos/.github/.github/workflows/pytest_file_or_dir.yml@feat/shared_actions1 - with: - action_branch: feat/shared_actions1 - test_location: test - python_matrix: '[3.9, "3.10", "3.11"]' - is_skill: true - # upload_coverage: true # TODO: Once this moves to the OVOS org + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + - name: Install Build Tools + run: | + python -m pip install build wheel setuptools + - name: Install System Dependencies + run: | + sudo apt-get update + sudo apt install python3-dev swig libssl-dev + - name: Install skill + run: | + pip install ".[test]" + - name: Run Skill Tests + run: | + python -m pytest test/ diff --git a/.github/workflows/sync_tx.yml b/.github/workflows/sync_tx.yml index 2fd378e..897007b 100644 --- a/.github/workflows/sync_tx.yml +++ b/.github/workflows/sync_tx.yml @@ -11,22 +11,22 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 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 + uses: actions/setup-python@v5 with: - python-version: 3.9 - + python-version: 3.10 + - name: Run script if merged by gitlocalize-app[bot] if: github.event_name == 'push' && github.event.head_commit.author.username == 'gitlocalize-app[bot]' run: | python scripts/sync_translations.py - + - name: Commit to dev - uses: stefanzweifel/git-auto-commit-action@v4 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: Update translations branch: dev diff --git a/.github/workflows/test_resources.yml b/.github/workflows/test_resources.yml index 62102aa..fe4d8bf 100644 --- a/.github/workflows/test_resources.yml +++ b/.github/workflows/test_resources.yml @@ -5,8 +5,4 @@ on: jobs: test-intents: - uses: openvoiceos/.github/.github/workflows/skill_test_resources.yml@feat/shared_actions1 - with: - action_branch: feat/shared_actions1 - python_matrix: '[3.9, "3.10", "3.11"]' - intent_testfile: test/test_intents.yaml + uses: neongeckocom/.github/.github/workflows/skill_test_resources.yml@master diff --git a/setup.py b/setup.py index 20a375c..ebb6659 100644 --- a/setup.py +++ b/setup.py @@ -78,5 +78,5 @@ def find_resource_files(): install_requires=get_requirements("requirements.txt"), keywords="ovos skill voice assistant", entry_points={"ovos.plugin.skill": PLUGIN_ENTRY_POINT}, - extras={"test": get_requirements("requirements-dev.txt")}, + extras_require={"test": get_requirements("requirements-dev.txt")}, )