diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml
index cd95ade6..428a0f45 100644
--- a/.github/workflows/build-and-test.yml
+++ b/.github/workflows/build-and-test.yml
@@ -106,11 +106,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libmagic1 libmagic-dev portaudio19-dev python3-pyaudio ffmpeg
+ - name: Update PIP
+ run: pip install --upgrade pip
- name: Workaround for Python Magic
run: |
python3 -m pip install git+https://github.com/julian-r/python-magic.git
- - name: Update PIP
- run: pip install --upgrade pip
- name: Build preparation
id: build_init
run: |
diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml
index 44d19f4b..fdbf446c 100644
--- a/.github/workflows/create-release.yml
+++ b/.github/workflows/create-release.yml
@@ -4,10 +4,10 @@ run-name: Create Release
on:
push:
tags:
- - "[0-9]+.[0-9]+.[0-9]+"
- - "[0-9]+.[0-9]+.[0-9]+a[0-9]+"
- - "[0-9]+.[0-9]+.[0-9]+b[0-9]+"
- - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
+ - "v?[0-9]+.[0-9]+.[0-9]+"
+ - "v?[0-9]+.[0-9]+.[0-9]+a[0-9]+"
+ - "v?[0-9]+.[0-9]+.[0-9]+b[0-9]+"
+ - "v?[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
env:
PACKAGE_NAME: "${vars.PACKAGE_NAME}"
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index ce3077fe..12afcf89 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -34,6 +34,8 @@ jobs:
version: ${{ steps.publish-it.outputs.version }}
steps:
- uses: actions/checkout@v4
+ with:
+ submodules: 'true'
- uses: actions/setup-java@v3
with:
distribution: temurin
@@ -49,9 +51,22 @@ jobs:
restore-keys: ${{ runner.os }}-gradle
- uses: actions/setup-python@v3
with:
- python-version: ${{ vars.PYTHON_VERSION }}
+ python-version: ${{ matrix.python-version }}
+ - name: Install System packages
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y libmagic1 libmagic-dev portaudio19-dev python3-pyaudio ffmpeg
+ - name: Update PIP
+ run: pip install --upgrade pip
+ - name: Workaround for Python Magic
+ run: |
+ python3 -m pip install git+https://github.com/julian-r/python-magic.git
+ - name: Build preparation
+ id: build_init
+ run: |
+ echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
- name: Install Python tools
- run: gradle installBuildTools ${{ inputs.gradle_debug_params }}
+ run: gradle installBuildTools build copyLicenseAndReadme ${{ inputs.gradle_debug_params }}
- name: Publish
id: publish-it
run: |
@@ -65,3 +80,6 @@ jobs:
git pull --rebase -Xtheirs && git push --atomic origin HEAD
git tag -a v"$version" -m "${{ inputs.comment }}"
git push origin --tags
+ echo "## Revision Information" >> $GITHUB_STEP_SUMMARY
+ echo "- Branch: ${{ steps.build_init.outputs.branch }}" >> $GITHUB_STEP_SUMMARY
+ echo "- Version: $version" >> $GITHUB_STEP_SUMMARY
diff --git a/README.md b/README.md
index 90959dea..069142d5 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
[![Terminal](https://badgen.net/badge/icon/terminal?icon=terminal&label)](https://github.com/yorevs/homesetup)
[![License](https://badgen.net/badge/license/MIT/gray)](LICENSE.md)
-[![Release](https://badgen.net/badge/release/v1.2.4/gray)](docs/CHANGELOG.md#unreleased)
+[![Release](https://badgen.net/badge/release/v1.2.5/gray)](docs/CHANGELOG.md#unreleased)
[![Donate](https://badgen.net/badge/paypal/donate/yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J5CDEFLF6M3H4)
[![build-and-test](https://github.com/yorevs/askai/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/yorevs/askai/actions/workflows/build-and-test.yml)
diff --git a/build.gradle b/build.gradle
index ca14a9f4..1d1a6d8a 100644
--- a/build.gradle
+++ b/build.gradle
@@ -40,7 +40,6 @@ ext {
apply from: "${gradleDir}/dependencies.gradle"
apply from: "${gradleDir}/python.gradle"
apply from: "${gradleDir}/versioning.gradle"
-apply from: "${gradleDir}/pypi-publish.gradle"
apply from: "${gradleDir}/docker.gradle"
apply from: "${gradleDir}/docgen.gradle"
apply from: "${gradleDir}/idea.gradle"
diff --git a/bumpver.toml b/bumpver.toml
index 91bdd341..fb5c4dff 100644
--- a/bumpver.toml
+++ b/bumpver.toml
@@ -1,5 +1,5 @@
[bumpver]
-current_version = "1.2.4"
+current_version = "1.2.5"
version_pattern = "MAJOR.MINOR.PATCH"
commit_message = "++version {old_version} -> {new_version}"
commit = false
diff --git a/gradle.properties b/gradle.properties
index d5f075e6..1d412af1 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -2,7 +2,7 @@ author = Hugo Saporetti Junior
mailTo = yorevs@hotmail.com
siteUrl = https://github.com/yorevs/askai
app_name = hspylib-askai
-app_version = 1.2.4
+app_version = 1.2.5
# Build Tools
buildTools = setuptools, wheel, build, twine, bumpver, pipenv, isort, black, mypy, pylint, pdoc, pytest, PyInstaller
diff --git a/gradle/pypi-publish.gradle b/gradle/pypi-publish.gradle
deleted file mode 100644
index 7eb91acd..00000000
--- a/gradle/pypi-publish.gradle
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- Gradle PyPi publisher extension
-
- Created: 23rd April, 2021
- License: MIT - Please refer to
- Copyright·(c)·2024,·HSPyLib
-*/
-
-import groovy.json.JsonSlurper
-
-ext {
- pypiRepository = System.getenv("PYPI_REPOSITORY") ?: 'https://test.pypi.org/legacy'
- pypiModuleUrl = System.getenv("PYPI_MODULE_URL") ?: 'https://test.pypi.org/pypi'
- pypiUsername = System.getenv("PYPI_USERNAME") ?: ''
- pypiPassword = System.getenv("PYPI_PASSWORD") ?: ''
-}
-
-
-/* Helper Functions -------------------------------------------------------- */
-
-Collection dirsByPattern(String baseDir, String pattern) {
- def paths = []
- fileTree(baseDir).visit { FileVisitDetails details ->
- if (details.isDirectory() && details.name ==~ pattern) paths << details.file.path
- }
- return paths
-}
-
-String dirName(File file) {
- file.getParentFile().getPath()
-}
-
-/* Tasks ------------------------------------------------------------------- */
-
-/* Cleanup distribution files from sourceRoot */
-task cleanDist(type: Task) {
- group = 'Build'
- description = "Cleanup distribution files from sourceRoot"
- doLast {
- println "Cleanup distribution files \n\t from $sourceRoot"
- delete dirsByPattern(sourceRoot, /.*dist$/)
- delete dirsByPattern(sourceRoot, /.*build$/)
- delete dirsByPattern(sourceRoot, /.*egg-info$/)
- }
-}
-
-/* Copy LICENSE and README files into main folder */
-task copyLicenseAndReadme(type: Copy) {
- group = 'Publish'
- description = "Copy LICENSE file into main folder"
- from(rootDir) {
- include 'LICENSE*'
- include 'README*'
- }
- into "${sourceRoot}/main"
-}
-
-/* Check files created in dist folder */
-task checkDist(type: Task) {
- group = 'Publish'
- description = 'Check files created in dist folder'
- doLast {
- fileTree(sourceRoot).matching {
- include "**/setup.py"
- }.each { File module ->
- def moduleDir = dirName(module)
- def distDir = "${moduleDir}/dist"
- println "Checking distribution files -> $distDir"
- exec {
- workingDir moduleDir
- commandLine project.python, '-m', 'twine', 'check', "${distDir}/*"
- }
- }
- }
-}
-
-/* Generate PyPi distribution files */
-task sdist(type: Task) {
- group = 'Publish'
- description = 'Generate PyPi distribution files'
- if (!project.hasProperty('no-patch') || !Boolean.valueOf(project.getProperty('no-patch'))) {
- dependsOn patchVersion
- }
- dependsOn cleanDist
- dependsOn copyLicenseAndReadme
- dependsOn syncRequirements
- finalizedBy checkDist
- doLast {
- fileTree("$sourceRoot").matching {
- include "**/setup.py"
- }.each { File module ->
- def moduleDir = dirName(module)
- println "Generating distribution files -> $moduleDir"
- exec {
- workingDir "$moduleDir"
- commandLine project.python, "-m", "build", "--sdist"
- }
- exec {
- workingDir "$moduleDir"
- commandLine project.python, "-m", "build", "--wheel"
- }
- }
- }
-}
-
-/* Publish the module to PyPi repository */
-task publish(type: Task) {
- group = 'Publish'
- description = "Publish the module to PyPi repository"
- dependsOn sdist
- def url = project.ext.pypiRepository
- def un = project.ext.pypiUsername
- def pw = project.ext.pypiPassword
- doLast {
- fileTree("$sourceRoot").matching {
- include "**/setup.py"
- }.each { File module ->
- def moduleDir = dirName(module)
- def distDir = "${moduleDir}/dist"
- println "--- ${project.name} details ---"
- println "|-version: ${project.ext.app_version}"
- println "|-setup: ${module}"
- println "|-url: ${url}"
- println "|-user: ${un}"
- println "|-dist: ${distDir}/*"
- println '-------------------------------'
- println "Publishing module to PyPi => ${url}"
- exec {
- workingDir moduleDir
- commandLine project.python, '-m', 'twine', 'upload',
- '--verbose',
- '--repository-url', "${url}",
- '-u', "${un}",
- '-p', "${pw}",
- "${distDir}/*"
- }
- }
- exec {
- commandLine 'git', 'tag', '-a', "v${app_version}", '-m', "New PyPi version v${app_version}"
- }
- exec {
- commandLine 'git', 'push', 'origin', "v${app_version}"
- }
- }
-}
-
-/* Show PyPi module details */
-task pypiShow(type: Task) {
- group = 'Publish'
- description = "Show PyPi module details"
- doLast {
- def tempDir = System.getenv("TEMP") ?: '/tmp'
- def url = project.ext.pypiModuleUrl + "/${app_name}/json"
- def outFile = "${tempDir}/${app_name}-info.json"
- println("PyPi Instance: " + url)
- exec {
- commandLine 'curl', '-s', '-o', outFile, url
- }
- def json = new JsonSlurper().parseText(new File(outFile).getText())
- println("\n--------------------------------------------------------------------------------")
- println("|-AppName: ${json.info.package_url}")
- println("|-Summary: ${json.info.summary}")
- println("|-Version: ${json.info.version}")
- println("|-License: ${json.info.license}")
- println("|-Python: ${json.info.requires_python}")
- println("|-Keywords: \n ${json.info.keywords ? '#' + json.info.keywords.split(',').join(' #') : 'None'}")
- println("|-Classifiers: \n ${json.info.classifiers ? '|-' + json.info.classifiers.join('\n |-') : 'None'}")
- println("|-Dependencies: \n ${json.info.requires_dist ? '|-' + json.info.requires_dist.join('\n |-') : 'None'} ")
- println("--------------------------------------------------------------------------------")
- }
-}
diff --git a/gradle/python.gradle b/gradle/python.gradle
index bacf1b30..7b1cb37e 100644
--- a/gradle/python.gradle
+++ b/gradle/python.gradle
@@ -192,6 +192,17 @@ task syncPythonPackages(type: Task) {
}
}
+/* Copy LICENSE and README files into main folder */
+task copyLicenseAndReadme(type: Copy) {
+ group = 'Publish'
+ description = "Copy LICENSE file into main folder"
+ from(rootDir) {
+ include 'LICENSE*'
+ include 'README*'
+ }
+ into "${sourceRoot}/main"
+}
+
/* Install module in editable mode (i.e. setuptools 'develop mode') */
task installModule(type: Task) {
group = 'Install'
@@ -330,7 +341,6 @@ task mypy(type: Task) {
tasks.register('clean', Task) {
group = 'Build'
dependsOn cleanPython
- dependsOn cleanDist
}
tasks.register('compile', Task) {
diff --git a/pyproject.toml b/pyproject.toml
index 4876e9ea..3487a7f2 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hspylib-askai"
- version = "1.2.4"
+ version = "1.2.5"
description = "HomeSetup - AskAI"
authors = ["Hugo Saporetti Junior "]
license = "MIT"
diff --git a/src/main/askai/.version b/src/main/askai/.version
index e8ea05db..c813fe11 100644
--- a/src/main/askai/.version
+++ b/src/main/askai/.version
@@ -1 +1 @@
-1.2.4
+1.2.5
diff --git a/src/main/setup.py b/src/main/setup.py
index 184fbc71..66272ee9 100644
--- a/src/main/setup.py
+++ b/src/main/setup.py
@@ -31,7 +31,7 @@
# This call to setup() does all the work
setuptools.setup(
name="hspylib-askai",
- version="1.2.4",
+ version="1.2.5",
description="HomeSetup - AskAI",
author="Hugo Saporetti Junior",
author_email="yorevs@hotmail.com",