Skip to content

Commit

Permalink
[@yorevs] Push for new revision
Browse files Browse the repository at this point in the history
  • Loading branch information
yorevs committed Dec 6, 2024
1 parent 85e2194 commit f1d81df
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 134 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
with:
python-version: ${{ vars.PYTHON_VERSION }}
- 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: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion bumpver.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ author = <B>H</B>ugo <B>S</B>aporetti <B>J</B>unior
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
123 changes: 0 additions & 123 deletions gradle/pypi-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,8 @@

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'
Expand All @@ -55,95 +21,6 @@ task copyLicenseAndReadme(type: Copy) {
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'
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hspylib-askai"
version = "1.2.4"
version = "1.2.5"
description = "HomeSetup - AskAI"
authors = ["Hugo Saporetti Junior <yorevs@hotmail.com>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/main/askai/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.4
1.2.5
2 changes: 1 addition & 1 deletion src/main/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f1d81df

Please sign in to comment.