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/publish_alpha.yml b/.github/workflows/publish_alpha.yml index e0dfd39..ca2fa62 100644 --- a/.github/workflows/publish_alpha.yml +++ b/.github/workflows/publish_alpha.yml @@ -1,3 +1,4 @@ +# This workflow will generate a distribution and upload it to PyPI name: Publish Alpha Build ...aX on: push: @@ -14,15 +15,59 @@ on: - "MANIFEST.in" - "README.md" - "scripts/**" + - "translations/**" workflow_dispatch: - jobs: build_and_publish: - uses: openvoiceos/.github/.github/workflows/publish_alpha_release.yml@feat/shared_actions1 - secrets: inherit - with: - version_file: version.py # File location of the version file, default: version.py - python_version: "3.10" - locale_folder: locale - update_intentfile: test/test_intents.yaml - changelog_file: CHANGELOG.md + 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: 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 }} + maxIssues: 50 + 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 + - 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 bdist_wheel + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{secrets.PYPI_TOKEN}} diff --git a/.github/workflows/publish_build.yml b/.github/workflows/publish_build.yml new file mode 100644 index 0000000..bae06b7 --- /dev/null +++ b/.github/workflows/publish_build.yml @@ -0,0 +1,84 @@ +# 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@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.10 + - 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 + commitish: dev + - 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 PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{secrets.PYPI_TOKEN}} + - 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 skill-ovos-fallback-unknown release! ${{ steps.version.outputs.version }} diff --git a/.github/workflows/publish_major.yml b/.github/workflows/publish_major.yml new file mode 100644 index 0000000..a881af8 --- /dev/null +++ b/.github/workflows/publish_major.yml @@ -0,0 +1,84 @@ +# 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@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.10 + - 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 + commitish: master + - 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 PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{secrets.PYPI_TOKEN}} + - 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 skill-ovos-fallback-unknown release! ${{ steps.version.outputs.version }} diff --git a/.github/workflows/publish_minor.yml b/.github/workflows/publish_minor.yml new file mode 100644 index 0000000..43c0c25 --- /dev/null +++ b/.github/workflows/publish_minor.yml @@ -0,0 +1,84 @@ +# 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@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.10 + - 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 + commitish: master + - 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 PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{secrets.PYPI_TOKEN}} + - 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 skill-ovos-fallback-unknown release! ${{ steps.version.outputs.version }} diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml deleted file mode 100644 index 6c7c978..0000000 --- a/.github/workflows/publish_release.yml +++ /dev/null @@ -1,15 +0,0 @@ - -name: publish_release -on: - push: - branches: - - master - - main -jobs: - build_and_publish_pypi_and_release: - permissions: - contents: write - packages: write - uses: neongeckocom/.github/.github/workflows/publish_stable_release.yml@master - secrets: - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml deleted file mode 100644 index ccc6470..0000000 --- a/.github/workflows/pull-request-lint.yml +++ /dev/null @@ -1,28 +0,0 @@ -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: - types: |- - feat - fix - chore - docs - requireScope: false - githubBaseUrl: ${{ github.api_url }} diff --git a/.github/workflows/test_resources.yml b/.github/workflows/test_resources.yml deleted file mode 100644 index 17c870a..0000000 --- a/.github/workflows/test_resources.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Test Resources -on: - workflow_dispatch: - push: - -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_resources.yaml diff --git a/scripts/bump_alpha.py b/scripts/bump_alpha.py new file mode 100644 index 0000000..c32c238 --- /dev/null +++ b/scripts/bump_alpha.py @@ -0,0 +1,15 @@ +"""increases alpha version number""" +import fileinput +from os.path import join, dirname +version_file = join(dirname(dirname(__file__)), "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')) \ No newline at end of file diff --git a/scripts/bump_build.py b/scripts/bump_build.py new file mode 100644 index 0000000..82ad511 --- /dev/null +++ b/scripts/bump_build.py @@ -0,0 +1,17 @@ +import fileinput +from os.path import join, dirname +version_file = join(dirname(dirname(__file__)), "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')) \ No newline at end of file diff --git a/scripts/bump_major.py b/scripts/bump_major.py new file mode 100644 index 0000000..31eb19f --- /dev/null +++ b/scripts/bump_major.py @@ -0,0 +1,23 @@ +import fileinput +from os.path import join, dirname +version_file = join(dirname(dirname(__file__)), "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')) \ No newline at end of file diff --git a/scripts/bump_minor.py b/scripts/bump_minor.py new file mode 100644 index 0000000..bb860c0 --- /dev/null +++ b/scripts/bump_minor.py @@ -0,0 +1,20 @@ +import fileinput +from os.path import join, dirname +version_file = join(dirname(dirname(__file__)), "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')) \ No newline at end of file diff --git a/scripts/remove_alpha.py b/scripts/remove_alpha.py new file mode 100644 index 0000000..aa3c3f6 --- /dev/null +++ b/scripts/remove_alpha.py @@ -0,0 +1,9 @@ +import fileinput +from os.path import join, dirname +version_file = join(dirname(dirname(__file__)), "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')) \ No newline at end of file