From 41d3541227806a66f25c9f4b8d8c1494318ec91a Mon Sep 17 00:00:00 2001 From: "(Holloway) Chew, Kean Ho" Date: Sun, 31 Mar 2024 19:40:17 +0800 Subject: [PATCH] root: updated Package CI job for the application Since this is a special shell script application in which AutomataCI is yet to support, I need to modify the Package CI job and make sure everything is working fine. Hence, let's do this. This patch updates Package CI job for the application in root repository. Signed-off-by: (Holloway) Chew, Kean Ho --- README.md | 59 ++++++++- automataCI/_package-deb_unix-any.sh | 4 +- automataCI/_package-deb_windows-any.ps1 | 4 +- automataCI/_package-flatpak_unix-any.sh | 5 +- automataCI/_package-flatpak_windows-any.ps1 | 4 +- automataCI/_package-ipk_unix-any.sh | 4 +- automataCI/_package-ipk_windows-any.ps1 | 4 +- automataCI/_package-rpm_unix-any.sh | 4 +- automataCI/_package-rpm_windows-any.ps1 | 4 +- automataCI/package_unix-any.sh | 2 + automataCI/package_windows-any.ps1 | 2 + automataCI/services/compilers/deb.ps1 | 26 ++-- automataCI/services/compilers/deb.sh | 27 +++-- automataCI/services/compilers/flatpak.ps1 | 2 +- automataCI/services/compilers/flatpak.sh | 2 +- automataCI/services/compilers/rpm.ps1 | 2 +- automataCI/services/compilers/rpm.sh | 2 +- src/.ci/_package-chocolatey_unix-any.sh | 126 +++++++++++++++++++- src/.ci/_package-chocolatey_windows-any.ps1 | 125 ++++++++++++++++++- src/.ci/_package-deb_unix-any.sh | 2 +- src/.ci/_package-deb_windows-any.ps1 | 20 ++-- src/.ci/_package-docker_unix-any.sh | 71 +++++++---- src/.ci/_package-docker_windows-any.ps1 | 72 +++++++---- src/.ci/_package-flatpak_unix-any.sh | 12 +- src/.ci/_package-flatpak_windows-any.ps1 | 20 ++-- src/.ci/_package-homebrew_unix-any.sh | 53 +++++++- src/.ci/_package-homebrew_windows-any.ps1 | 53 +++++++- src/.ci/_package-ipk_unix-any.sh | 2 +- src/.ci/_package-ipk_windows-any.ps1 | 2 +- src/.ci/_package-rpm_unix-any.sh | 6 +- src/.ci/_package-rpm_windows-any.ps1 | 6 +- src/.ci/build_unix-any.sh | 41 +++++-- src/.ci/build_windows-any.ps1 | 39 ++++-- src/changelog/data/latest | 2 + src/changelog/deb/latest | 4 +- src/docs/ABSTRACTS.txt | 5 + src/docs/CITATIONS.yml | 2 +- 37 files changed, 655 insertions(+), 165 deletions(-) diff --git a/README.md b/README.md index 0ec2a20..1efbbfe 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Holloway's HiAI -[![hiAI](src/icons/banner_1200x330.svg)](#holloways-hiai) +[![hollowayHIAI](src/icons/banner_1200x330.svg)](#holloways-hiai) A local terminal polygot (POSIX Shell x PowerShell) bridging LLM AI prompt interaction capabilities directly to your computer! Turn every computer's terminal into an interactive AI prompt. -[![hiAi-demo-debian](src/screenshots/hiAI-demo-debian.gif)](#holloways-hiai) +[![hollowayHIAI-demo-debian](src/screenshots/hiAI-demo-debian.gif)](#holloways-hiai) @@ -77,11 +77,57 @@ $ powershell.exe -noprofile ` +## To Install + +The software is packaged based on available OSes. + + + +### Debian-based OS (`linux`, `hurd`, etc) + +1. Download the latest `.deb` package from the [release section](https://github.com/ChewKeanHo/APP_hiAI/releases) +2. perform `$ dpkg -i .deb`. + +Don't worry, the package will setup the upstream apt repository list source +alongside the required GPG key for future `apt update`. + + + +### Red-Hat Linux (`redhat`, `fedora`, etc) + +1. Download the latest `.rpm` package from the [release section](https://github.com/ChewKeanHo/APP_hiAI/releases) +2. perform `$ rpm -i .rpm`. + +Don't worry, the package will setup the upstream apt repository list source +alongside the required GPG key for future `apt update`. + + + +### Flatpak + +*Coming Soon* + +Note that the command to use is: `flatpak run [TBD] ...` due to how Flatpak +works. + + +### Docker / Podman + +Please refer to [GitHub Packages Section](https://github.com/ChewKeanHo/APP_hiAI/pkgs/container/hollowayhiai). + + +### Plain Script + +Use the `tar.gz` package. + + + + ## To Contribute -AutomataCI cannot be made successfully without contributions from (Holloway) -Chew, Kean Ho, his teams, and supports from external folks. If you had been -using AutomataCI and wish to contribute back, there are 2 ways to do so: +Holloway's HiAI! cannot be made successfully without contributions from +(Holloway) Chew, Kean Ho, his teams, and supports from external folks. If you +had been using it and wish to contribute back, there are 2 ways to do so: @@ -105,4 +151,5 @@ free to refer the PDF Handbook and execute accordingly. ## License -AutomataCI is licensed under OSI compatible [Apache 2.0 License](LICENSE.txt). +Holloway's HiAI! is licensed under OSI compatible +[Apache 2.0 License](LICENSE.txt). diff --git a/automataCI/_package-deb_unix-any.sh b/automataCI/_package-deb_unix-any.sh index b42acd0..5b3d576 100644 --- a/automataCI/_package-deb_unix-any.sh +++ b/automataCI/_package-deb_unix-any.sh @@ -56,11 +56,11 @@ PACKAGE_Run_DEB() { I18N_Check_Availability "DEB" DEB_Is_Available "$_target_os" "$_target_arch" case $? in - 2|3) + 2) I18N_Check_Incompatible_Skipped return 0 ;; - 0) + 0|3) # accepted ;; *) diff --git a/automataCI/_package-deb_windows-any.ps1 b/automataCI/_package-deb_windows-any.ps1 index 2b1be84..4ec2e8e 100644 --- a/automataCI/_package-deb_windows-any.ps1 +++ b/automataCI/_package-deb_windows-any.ps1 @@ -46,10 +46,10 @@ function PACKAGE-Run-DEB { $null = I18N-Check-Availability "DEB" $___process = DEB-Is-Available "${_target_os}" "${_target_arch}" switch ($___process) { - { $_ -in 2, 3 } { + 2 { $null = I18N-Check-Incompatible-Skipped return 0 - } 0 { + } {$_ -in 0, 3} { # accepted } Default { $null = I18N-Check-Failed diff --git a/automataCI/_package-flatpak_unix-any.sh b/automataCI/_package-flatpak_unix-any.sh index d5503c8..00bb399 100644 --- a/automataCI/_package-flatpak_unix-any.sh +++ b/automataCI/_package-flatpak_unix-any.sh @@ -56,11 +56,12 @@ PACKAGE_Run_FLATPAK() { I18N_Check_Availability "FLATPAK" FLATPAK_Is_Available "$_target_os" "$_target_arch" case $? in - 2|3) + 2) I18N_Check_Incompatible_Skipped return 0 ;; - 0) + 0|3) + # accepted ;; *) I18N_Check_Failed diff --git a/automataCI/_package-flatpak_windows-any.ps1 b/automataCI/_package-flatpak_windows-any.ps1 index 12486a6..7a38b0e 100644 --- a/automataCI/_package-flatpak_windows-any.ps1 +++ b/automataCI/_package-flatpak_windows-any.ps1 @@ -46,10 +46,10 @@ function PACKAGE-Run-FLATPAK { $null = I18N-Check-Availability "FLATPAK" $___process = FLATPAK-Is-Available "${_target_os}" "${_target_arch}" switch ($___process) { - { $_ -in 2, 3 } { + 2 { $null = I18N-Check-Incompatible-Skipped return 0 - } 0 { + } { $_ -in 0, 3 } { break } Default { $null = I18N-Check-Failed diff --git a/automataCI/_package-ipk_unix-any.sh b/automataCI/_package-ipk_unix-any.sh index 193d2bd..6386a30 100644 --- a/automataCI/_package-ipk_unix-any.sh +++ b/automataCI/_package-ipk_unix-any.sh @@ -54,11 +54,11 @@ PACKAGE_Run_IPK() { I18N_Check_Availability "IPK" IPK_Is_Available "$_target_os" "$_target_arch" case $? in - 2|3) + 2) I18N_Check_Incompatible_Skipped return 0 ;; - 0) + 0|3) # accepted ;; *) diff --git a/automataCI/_package-ipk_windows-any.ps1 b/automataCI/_package-ipk_windows-any.ps1 index 58de1bb..c03a189 100644 --- a/automataCI/_package-ipk_windows-any.ps1 +++ b/automataCI/_package-ipk_windows-any.ps1 @@ -45,10 +45,10 @@ function PACKAGE-Run-IPK { $null = I18N-Check-Availability "IPK" $___process = IPK-Is-Available "${_target_os}" "${_target_arch}" switch ($___process) { - { $_ -in 2, 3 } { + 2 { $null = I18N-Check-Incompatible-Skipped return 0 - } 0 { + } {$_ -in 0, 3} { # accepted } Default { $null = I18N-Check-Failed diff --git a/automataCI/_package-rpm_unix-any.sh b/automataCI/_package-rpm_unix-any.sh index c3c24b0..cdf8b6f 100644 --- a/automataCI/_package-rpm_unix-any.sh +++ b/automataCI/_package-rpm_unix-any.sh @@ -56,11 +56,11 @@ PACKAGE_Run_RPM() { I18N_Check_Availability "RPM" RPM_Is_Available "$_target_os" "$_target_arch" case $? in - 2|3) + 2) I18N_Check_Incompatible_Skipped return 0 ;; - 0) + 0|3) # accepted ;; *) diff --git a/automataCI/_package-rpm_windows-any.ps1 b/automataCI/_package-rpm_windows-any.ps1 index 1e8d364..dc5c985 100644 --- a/automataCI/_package-rpm_windows-any.ps1 +++ b/automataCI/_package-rpm_windows-any.ps1 @@ -47,10 +47,10 @@ function PACKAGE-Run-RPM { $null = I18N-Check-Availability "RPM" $___process = RPM-Is-Available "${_target_os}" "${_target_arch}" switch ($___process) { - { $_ -in 2, 3 } { + 2 { $null = I18N-Check-Incompatible-Skipped return 0 - } 0 { + } { $_ -in 0, 3} { # accepted } Default { $null = I18N-Check-Failed-Skipped diff --git a/automataCI/package_unix-any.sh b/automataCI/package_unix-any.sh index e176889..06648a1 100644 --- a/automataCI/package_unix-any.sh +++ b/automataCI/package_unix-any.sh @@ -155,7 +155,9 @@ for i in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}"/*; do TARGET_OS="${TARGET_FILENAME##*_}" TARGET_FILENAME="${TARGET_FILENAME%%_*}" TARGET_ARCH="${TARGET_OS##*-}" + TARGET_ARCH="${TARGET_ARCH%%.*}" TARGET_OS="${TARGET_OS%%-*}" + TARGET_OS="${TARGET_OS%%.*}" if [ "$(STRINGS_Is_Empty "$TARGET_OS")" -eq 0 ] || [ "$(STRINGS_Is_Empty "$TARGET_ARCH")" -eq 0 ] || diff --git a/automataCI/package_windows-any.ps1 b/automataCI/package_windows-any.ps1 index 1981979..472a25e 100644 --- a/automataCI/package_windows-any.ps1 +++ b/automataCI/package_windows-any.ps1 @@ -170,7 +170,9 @@ foreach ($file in (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_P $TARGET_OS = $TARGET_FILENAME -replace ".*_" $TARGET_FILENAME = $TARGET_FILENAME -replace "_.*" $TARGET_ARCH = $TARGET_OS -replace ".*-" + $TARGET_ARCH = $TARGET_ARCH -replace "\..*$" $TARGET_OS = $TARGET_OS -replace "-.*" + $TARGET_OS = $TARGET_OS -replace "\..*$" if (($(STRINGS-Is-Empty "${TARGET_OS}") -eq 0) -or ($(STRINGS-Is-Empty "${TARGET_ARCH}") -eq 0) -or diff --git a/automataCI/services/compilers/deb.ps1 b/automataCI/services/compilers/deb.ps1 index b3b9ab8..2955db2 100644 --- a/automataCI/services/compilers/deb.ps1 +++ b/automataCI/services/compilers/deb.ps1 @@ -401,34 +401,36 @@ function DEB-Get-Architecture { # process os switch ($___os) { "dragonfly" { - $___output="dragonflybsd" + $___output="dragonflybsd-" + } "linux" { + $___output="" } default { - $___output="${___os}" + $___output="${___os}-" }} # process arch switch ($___arch) { { $_ -in "386", "i386", "486", "i486", "586", "i586", "686", "i686" } { - $___output = "${___output}-i386" + $___output = "${___output}i386" } "mipsle" { - $___output = "${___output}-mipsel" + $___output = "${___output}mipsel" } "mipsr6le" { - $___output = "${___output}-mipsr6el" + $___output = "${___output}mipsr6el" } "mips32le" { - $___output = "${___output}-mips32el" + $___output = "${___output}mips32el" } "mips32r6le" { - $___output = "${___output}-mips32r6el" + $___output = "${___output}mips32r6el" } "mips64le" { - $___output = "${___output}-mips64el" + $___output = "${___output}mips64el" } "mips64r6le" { - $___output = "${___output}-mips64r6el" + $___output = "${___output}mips64r6el" } "powerpcle" { - $___output = "${___output}-powerpcel" + $___output = "${___output}powerpcel" } "ppc64le" { - $___output = "${___output}-ppc64el" + $___output = "${___output}ppc64el" } default { - $___output = "${___output}-${___arch}" + $___output = "${___output}${___arch}" }} diff --git a/automataCI/services/compilers/deb.sh b/automataCI/services/compilers/deb.sh index 771d280..62b088e 100644 --- a/automataCI/services/compilers/deb.sh +++ b/automataCI/services/compilers/deb.sh @@ -384,11 +384,14 @@ DEB_Get_Architecture() { # process os case "$1" in + linux) + ___output="" + ;; dragonfly) - ___output="dragonflybsd" + ___output="dragonflybsd-" ;; *) - ___output="$1" + ___output="${1}-" ;; esac @@ -396,34 +399,34 @@ DEB_Get_Architecture() { # process arch case "$2" in 386|i386|486|i486|586|i586|686|i686) - ___output="${___output}-i386" + ___output="${___output}i386" ;; mipsle) - ___output="${___output}-mipsel" + ___output="${___output}mipsel" ;; mipsr6le) - ___output="${___output}-mipsr6el" + ___output="${___output}mipsr6el" ;; mips32le) - ___output="${___output}-mips32el" + ___output="${___output}mips32el" ;; mips32r6le) - ___output="${___output}-mips32r6el" + ___output="${___output}mips32r6el" ;; mips64le) - ___output="${___output}-mips64el" + ___output="${___output}mips64el" ;; mips64r6le) - ___output="${___output}-mips64r6el" + ___output="${___output}mips64r6el" ;; powerpcle) - ___output="${___output}-powerpcel" + ___output="${___output}powerpcel" ;; ppc64le) - ___output="${___output}-ppc64el" + ___output="${___output}ppc64el" ;; *) - ___output="${___output}-${2}" + ___output="${___output}${2}" ;; esac diff --git a/automataCI/services/compilers/flatpak.ps1 b/automataCI/services/compilers/flatpak.ps1 index 9d925b9..b32158a 100644 --- a/automataCI/services/compilers/flatpak.ps1 +++ b/automataCI/services/compilers/flatpak.ps1 @@ -132,7 +132,7 @@ function FLATPAK-Is-Available { # check compatible target os switch ($___os) { - linux { + { $_ -in "linux", "any" } { # accepted } Default { return 2 diff --git a/automataCI/services/compilers/flatpak.sh b/automataCI/services/compilers/flatpak.sh index 367cdf5..a017bed 100644 --- a/automataCI/services/compilers/flatpak.sh +++ b/automataCI/services/compilers/flatpak.sh @@ -122,7 +122,7 @@ FLATPAK_Is_Available() { # check compatible target os case "$___os" in - linux) + linux|any) # accepted ;; *) diff --git a/automataCI/services/compilers/rpm.ps1 b/automataCI/services/compilers/rpm.ps1 index 88bdd20..b987e3d 100644 --- a/automataCI/services/compilers/rpm.ps1 +++ b/automataCI/services/compilers/rpm.ps1 @@ -464,7 +464,7 @@ function RPM-Is-Available { # check compatible target os switch ($___os) { - linux { + { $_ -in "linux", "any" } { break } default { return 2 diff --git a/automataCI/services/compilers/rpm.sh b/automataCI/services/compilers/rpm.sh index ebde475..ea7e947 100644 --- a/automataCI/services/compilers/rpm.sh +++ b/automataCI/services/compilers/rpm.sh @@ -475,7 +475,7 @@ RPM_Is_Available() { # check compatible target cpu architecture case "$___os" in - linux) + linux|any) ;; *) return 2 diff --git a/src/.ci/_package-chocolatey_unix-any.sh b/src/.ci/_package-chocolatey_unix-any.sh index 57b5cbc..5e4641c 100644 --- a/src/.ci/_package-chocolatey_unix-any.sh +++ b/src/.ci/_package-chocolatey_unix-any.sh @@ -15,11 +15,14 @@ # initialize -if [ "$PROJECT_PATH_ROOT" == "" ]; then +if [ "$PROJECT_PATH_ROOT" = "" ]; then >&2 printf "[ ERROR ] - Please run from automataCI/ci.sh.ps1 instead!\n" return 1 fi +. "${LIBS_AUTOMATACI}/services/io/fs.sh" +. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" + @@ -31,6 +34,123 @@ PACKAGE_Assemble_CHOCOLATEY_Content() { _target_arch="$5" - # execute - return 10 # not applicable - should be tech-oriented. + # validate project + if [ $(FS_Is_Target_A_Chocolatey "$_target") -ne 0 ]; then + return 10 # not applicable + fi + + + # assemble the package + ___source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}/${PROJECT_SKU}_any-any.sh.ps1" + ___dest="${_directory}/bin/${PROJECT_SKU_TITLECASE}.sh.ps1" + I18N_Assemble "$___source" "$___dest" + FS_Make_Housing_Directory "$___dest" + FS_Copy_File "$___source" "$___dest" + if [ $? -ne 0 ]; then + I18N_Assemble_Failed + return 1 + fi + + ___source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/icons/icon-128x128.png" + ___dest="${_directory}/icon.png" + I18N_Assemble "$___source" "$___dest" + FS_Copy_File "$___source" "$___dest" + if [ $? -ne 0 ]; then + I18N_Assemble_Failed + return 1 + fi + + ___source="${PROJECT_PATH_ROOT}/README.md" + ___dest="${_directory}/README.md" + I18N_Assemble "$___source" "$___dest" + FS_Copy_File "$___source" "$___dest" + if [ $? -ne 0 ]; then + I18N_Assemble_Failed + return 1 + fi + + + # REQUIRED: chocolatey required tools\ directory + ___dest="${_directory}/tools" + I18N_Create "$___dest" + FS_Make_Directory "${_directory}/tools" + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi + + + # OPTIONAL: chocolatey tools\chocolateyBeforeModify.ps1 + ___dest="${_directory}/tools/chocolateyBeforeModify.ps1" + I18N_Create "$___dest" + FS_Write_File "$___dest" "\ +Write-Host \"Performing pre-configurations...\" +" + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi + + + # REQUIRED: chocolatey tools\chocolateyinstall.ps1 + ___dest="${_directory}/tools/chocolateyinstall.ps1" + I18N_Create "$___dest" + FS_Write_File "$___dest" "\ +Write-Host \"Installing ${PROJECT_SKU_TITLECASE} (${PROJECT_VERSION})...\" +" + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi + + + # REQUIRED: chocolatey tools\chocolateyuninstall.ps1 + ___dest="${_directory}/tools/chocolateyuninstall.ps1" + I18N_Create "$___dest" + FS_Write_File "$___dest" "\ +Write-Host \"Uninstalling ${PROJECT_SKU_TITLECASE} (${PROJECT_VERSION})...\" +" + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi + + + # REQUIRED: chocolatey xml.nuspec file + ___dest="${_directory}/${PROJECT_SKU}.nuspec" + I18N_Create "$___dest" + FS_Write_File "$___dest" "\ + + + + ${PROJECT_SKU} + ${PROJECT_NAME} + ${PROJECT_VERSION} + ${PROJECT_CONTACT_NAME} + ${PROJECT_CONTACT_NAME} + ${PROJECT_CONTACT_WEBSITE} + ${PROJECT_LICENSE} + ${PROJECT_PITCH} + README.md + icon.png + + + + + + + + + + + +" + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi + + + # report status + return 0 } diff --git a/src/.ci/_package-chocolatey_windows-any.ps1 b/src/.ci/_package-chocolatey_windows-any.ps1 index 933639b..06ce185 100644 --- a/src/.ci/_package-chocolatey_windows-any.ps1 +++ b/src/.ci/_package-chocolatey_windows-any.ps1 @@ -19,6 +19,9 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { exit 1 } +. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" +. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" + @@ -32,6 +35,124 @@ function PACKAGE-Assemble-CHOCOLATEY-Content { ) - # execute - return 10 # not applicable - should be tech-oriented. + # validate project + if ($(FS-Is-Target-A-Chocolatey "${_target}") -ne 0) { + return 10 # not applicable + } + + + # assemble the package + $___source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}\${env:PROJECT_SKU}_any-any.sh.ps1" + $___dest = "${_directory}\bin\${env:PROJECT_SKU_TITLECASE}.sh.ps1" + $null = I18N-Assemble "${___source}" "${___dest}" + $null = FS-Make-Housing-Directory "${___dest}" + $___process = FS-Copy-File "${___source}" "${___dest}" + if ($___process -ne 0) { + $null = I18N-Assemble-Failed + return 1 + } + + $___source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\icons\icon-128x128.png" + $___dest = "${_directory}\icon.png" + $null = I18N-Assemble "${___source}" "${___dest}" + $___process = FS-Copy-File "${___source}" "${___dest}" + if ($___process -ne 0) { + $null = I18N-Assemble-Failed + return 1 + } + + $___source = "${env:PROJECT_PATH_ROOT}\README.md" + $___dest = "${_directory}\README.md" + $null = I18N-Assemble "${___source}" "${___dest}" + $___process = FS-Copy-File "${___source}" "${___dest}" + if ($___process -ne 0) { + $null = I18N-Assemble-Failed + return 1 + } + + + # REQUIRED: chocolatey required tools\ directory + $___dest = "${_directory}\tools" + $null = I18N-Create "${___dest}" + $___process = FS-Make-Directory "${___dest}" + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } + + + # OPTIONAL: chocolatey tools\chocolateyBeforeModify.ps1 + $___dest = "${_directory}\tools\chocolateyBeforeModify.ps1" + $null = I18N-Create "${___dest}" + $___process = FS-Write-File "${___dest}" @" +Write-Host "Performing pre-configurations..." +"@ + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } + + + # REQUIRED: chocolatey tools\chocolateyinstall.ps1 + $___dest = "${_directory}\tools\chocolateyinstall.ps1" + $null = I18N-Create "${___dest}" + $___process = FS-Write-File "${___dest}" @" +Write-Host "Uninstalling ${env:PROJECT_SKU_TITLECASE} (${env:PROJECT_VERSION})..." +"@ + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } + + + # REQUIRED: chocolatey tools\chocolateyuninstall.ps1 + $___dest = "${_directory}\tools\chocolateyuninstall.ps1" + $null = I18N-Create "${___dest}" + $___process = FS-Write-File "${___dest}" @" +# REQUIRED - PREPARING UNINSTALLATION +Write-Host "Uninstalling ${env:PROJECT_SKU_TITLECASE} (${env:PROJECT_VERSION})..." +"@ + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } + + + # REQUIRED: chocolatey xml.nuspec file + $___dest = "${_directory}\${env:PROJECT_SKU}.nuspec" + $null = I18N-Create "${___dest}" + $___process = FS-Write-File "${___dest}" @" + + + + ${env:PROJECT_SKU} + ${env:PROJECT_NAME} + ${env:PROJECT_VERSION} + ${env:PROJECT_CONTACT_NAME} + ${env:PROJECT_CONTACT_NAME} + ${env:PROJECT_CONTACT_WEBSITE} + ${env:PROJECT_LICENSE} + ${env:PROJECT_PITCH} + README.md + icon.png + + + + + + + + + + + +"@ + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } + + + # report status + return 0 } diff --git a/src/.ci/_package-deb_unix-any.sh b/src/.ci/_package-deb_unix-any.sh index d50d8a1..b6c4c9a 100644 --- a/src/.ci/_package-deb_unix-any.sh +++ b/src/.ci/_package-deb_unix-any.sh @@ -100,7 +100,7 @@ PACKAGE_Assemble_DEB_Content() { I18N_Copy "$_target" "$___dest" FS_Make_Directory "$___dest" - FS_Copy_File "$_target" "$___dest" + FS_Copy_File "$_target" "${___dest}/${PROJECT_SKU_TITLECASE}" if [ $? -ne 0 ]; then I18N_Copy_Failed return 1 diff --git a/src/.ci/_package-deb_windows-any.ps1 b/src/.ci/_package-deb_windows-any.ps1 index 929c22b..d36f2e1 100644 --- a/src/.ci/_package-deb_windows-any.ps1 +++ b/src/.ci/_package-deb_windows-any.ps1 @@ -103,7 +103,7 @@ function PACKAGE-Assemble-DEB-Content { $null = I18N-Assemble "${_target}" "${___dest}" $null = FS-Make-Directory "${___dest}" - $___process = FS-Copy-File "${_target}" "${___dest}" + $___process = FS-Copy-File "${_target}" "${___dest}\${env:PROJECT_SKU_TITLECASE}" if ($___process -ne 0) { $null = I18N-Assemble-Failed return 1 @@ -168,6 +168,15 @@ function PACKAGE-Assemble-DEB-Content { } + # NOTE: REQUIRED file + $null = I18N-Create "${_directory}\control\md5sum" + $___process = DEB-Create-Checksum "${_directory}" + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } + + # NOTE: OPTIONAL (Comment to turn it off) $null = I18N-Create "source.list" $___process = DEB-Create-Source-List ` @@ -183,15 +192,6 @@ function PACKAGE-Assemble-DEB-Content { } - # NOTE: REQUIRED file - $null = I18N-Create "${_directory}\control\md5sum" - $___process = DEB-Create-Checksum "${_directory}" - if ($___process -ne 0) { - $null = I18N-Create-Failed - return 1 - } - - # WARNING: THIS REQUIRED FILE MUST BE THE LAST ONE $null = I18N-Create "${_directory}\control\control" $___process = DEB-Create-Control ` diff --git a/src/.ci/_package-docker_unix-any.sh b/src/.ci/_package-docker_unix-any.sh index 58fcc03..db8840e 100644 --- a/src/.ci/_package-docker_unix-any.sh +++ b/src/.ci/_package-docker_unix-any.sh @@ -22,6 +22,7 @@ fi . "${LIBS_AUTOMATACI}/services/io/fs.sh" . "${LIBS_AUTOMATACI}/services/io/strings.sh" +. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" @@ -53,44 +54,57 @@ PACKAGE_Assemble_DOCKER_Content() { return 10 # not applicable elif [ $(FS_Is_Target_A_MSI "$_target") -eq 0 ]; then return 10 # not applicable + elif [ $(FS_Is_Target_A_PDF "$_target") -eq 0 ]; then + return 10 # not applicable fi case "$_target_os" in - linux|windows) + linux) + ;; + any) + _target_os="$PROJECT_OS" + ;; + *) + return 10 # not applicable + ;; + esac + + case "$_target_arch" in + 386|amd64|arm64|arm|s390x|ppc64le) + ;; + any) + _target_arch="$PROJECT_ARCH" ;; *) - return 10 + return 10 # not applicable ;; esac # assemble the package - FS_Copy_File "$_target" "${_directory}/${PROJECT_SKU}" + ___dest="${_directory}/${PROJECT_SKU}" + I18N_Assemble "$_target" "$___dest" + FS_Copy_File "$_target" "$___dest" if [ $? -ne 0 ]; then + I18N_Assemble_Failed return 1 fi - FS_Touch_File "${_directory}/.blank" + ___dest="${_directory}/.blank" + I18N_Assemble "$_target" "$___dest" + FS_Copy_File "$_target" "$___dest" if [ $? -ne 0 ]; then + I18N_Assemble_Failed return 1 fi # generate the Dockerfile - FS_Write_File "${_directory}/Dockerfile" "\ + ___dest="${_directory}/Dockerfile" + I18N_Create "$___dest" + FS_Write_File "$___dest" "\ # Defining baseline image -" - if [ "$_target_os" = "windows" ]; then - FS_Append_File "${_directory}/Dockerfile" "\ -FROM --platform=${_target_os}/${_target_arch} mcr.microsoft.com/windows/nanoserver:ltsc2022 -" - else - FS_Append_File "${_directory}/Dockerfile" "\ -FROM --platform=${_target_os}/${_target_arch} busybox:latest -" - fi - - FS_Append_File "${_directory}/Dockerfile" "\ +FROM --platform=${_target_os}/${_target_arch} linuxcontainers/debian-slim:latest LABEL org.opencontainers.image.title=\"${PROJECT_NAME}\" LABEL org.opencontainers.image.description=\"${PROJECT_PITCH}\" LABEL org.opencontainers.image.authors=\"${PROJECT_CONTACT_NAME} <${PROJECT_CONTACT_EMAIL}>\" @@ -98,20 +112,32 @@ LABEL org.opencontainers.image.version=\"${PROJECT_VERSION}\" LABEL org.opencontainers.image.revision=\"${PROJECT_CADENCE}\" LABEL org.opencontainers.image.licenses=\"${PROJECT_LICENSE}\" " + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi if [ $(STRINGS_Is_Empty "$PROJECT_CONTACT_WEBSITE") -ne 0 ]; then - FS_Append_File "${_directory}/Dockerfile" "\ + FS_Append_File "$___dest" "\ LABEL org.opencontainers.image.url=\"${PROJECT_CONTACT_WEBSITE}\" " + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi fi if [ $(STRINGS_Is_Empty "$PROJECT_SOURCE_URL") -ne 0 ]; then - FS_Append_File "${_directory}/Dockerfile" "\ + FS_Append_File "$___dest" "\ LABEL org.opencontainers.image.source=\"${PROJECT_SOURCE_URL}\" " + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi fi - FS_Append_File "${_directory}/Dockerfile" "\ + FS_Append_File "$___dest" "\ # Defining environment variables ENV ARCH ${_target_arch} ENV OS ${_target_os} @@ -119,15 +145,16 @@ ENV PORT 80 # Assemble the file structure COPY .blank /tmp/.tmpfile -ADD ${PROJECT_SKU} /app/bin/${PROJECT_SKU} +ADD ${PROJECT_SKU} /app/bin/${PROJECT_SKU_TITLECASE}.sh.ps1 # Set network port exposures EXPOSE 80 # Set entry point -ENTRYPOINT [\"/app/bin/${PROJECT_SKU}\"] +ENTRYPOINT [\"/app/bin/${PROJECT_SKU_TITLECASE}.sh.ps1\"] " if [ $? -ne 0 ]; then + I18N_Create_Failed return 1 fi diff --git a/src/.ci/_package-docker_windows-any.ps1 b/src/.ci/_package-docker_windows-any.ps1 index fdfedee..951ad15 100644 --- a/src/.ci/_package-docker_windows-any.ps1 +++ b/src/.ci/_package-docker_windows-any.ps1 @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at: -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -21,6 +21,7 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { . "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" . "${env:LIBS_AUTOMATACI}\services\io\strings.ps1" +. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" @@ -36,11 +37,11 @@ function PACKAGE-Assemble-DOCKER-Content { # validate project - if ($(FS-Is-Target-A-Source "${_target}") -eq 0) { + if ($(FS-Is-Target-A-Source "${_target}") -ne 0) { return 10 # not applicable } elseif ($(FS-Is-Target-A-Docs "${_target}") -eq 0) { return 10 # not applicable - } elseif ($(FS-Is-Target-A-Library "${_target}") -eq 0) { + } elseif ($(FS-Is-Target-A-Library "${_target}") -ne 0) { return 10 # not applicable } elseif ($(FS-Is-Target-A-WASM-JS "${_target}") -eq 0) { return 10 # not applicable @@ -54,43 +55,53 @@ function PACKAGE-Assemble-DOCKER-Content { return 10 # not applicable } elseif ($(FS-Is-Target-A-MSI "${_target}") -eq 0) { return 10 # not applicable + } elseif ($(FS-Is-Target-A-PDF "${_target}") -eq 0) { + return 10 # not applicable } switch ($_target_os) { - { $_ -in 'linux', 'windows' } { + windows { + # accepted + } any { + $_target_os = "${env:PROJECT_OS}" + } default { + return 10 # not applicable + }} + + switch ($_target_arch) { + amd64 { # accepted + } any { + $_target_arch = "${env:PROJECT_ARCH}" } default { - return 10 + return 10 # not applicable }} # assemble the package - $___process = FS-Copy-File "${_target}" "${_directory}\${env:PROJECT_SKU}" + $___dest = "${_directory}\${env:PROJECT_SKU}" + $null = I18N-Assemble "${_target}" "${___dest}" + $___process = FS-Copy-File "${_target}" "${___dest}" if ($___process -ne 0) { + $null = I18N-Assemble-Failed return 1 } - $___process = FS-Touch-File "${_directory}\.blank" + $___dest = "${_directory}\.blank" + $null = I18N-Assemble "${_target}" "${___dest}" + $___process = FS-Copy-File "${_target}" "${___dest}" if ($___process -ne 0) { + $null = I18N-Assemble-Failed return 1 } # generate the Dockerfile - $___process = FS-Write-File "${_directory}\Dockerfile" @" + $___dest = "${_directory}\Dockerfile" + $null = I18N-Create "${___dest}" + $___process = FS-Write-File "${___dest}" @" # Defining baseline image -"@ - if (${_target_os} == "windows") { - $___process = FS-Append-File "${_directory}\Dockerfile" @" FROM --platform=${_target_os}/${_target_arch} mcr.microsoft.com/windows/nanoserver:ltsc2022 -"@ - } else { - $___process = FS-Append-File "${_directory}\Dockerfile" @" -FROM --platform=${_target_os}/${_target_arch} busybox:latest -"@ - } - - $___process = FS-Append-File "${_directory}\Dockerfile" @" LABEL org.opencontainers.image.title=`"${env:PROJECT_NAME}`" LABEL org.opencontainers.image.description=`"${env:PROJECT_PITCH}`" LABEL org.opencontainers.image.authors=`"${env:PROJECT_CONTACT_NAME} <${env:PROJECT_CONTACT_EMAIL}>`" @@ -98,20 +109,32 @@ LABEL org.opencontainers.image.version=`"${env:PROJECT_VERSION}`" LABEL org.opencontainers.image.revision=`"${env:PROJECT_CADENCE}`" LABEL org.opencontainers.image.licenses=`"${env:PROJECT_LICENSE}`" "@ + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } if ($(STRINGS-Is-Empty "${env:PROJECT_CONTACT_WEBSITE}") -ne 0) { - $___process = FS-Append-File "${_directory}\Dockerfile" @" + $___process = FS-Append-File "${___dest}" @" LABEL org.opencontainers.image.url=`"${env:PROJECT_CONTACT_WEBSITE}`" "@ + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } } if ($(STRINGS-Is-Empty "${env:PROJECT_SOURCE_URL}") -ne 0) { - $___process = FS-Append-File "${_directory}\Dockerfile" @" + $___process = FS-Append-File "${___dest}" @" LABEL org.opencontainers.image.source=`"${env:PROJECT_SOURCE_URL}`" "@ + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } } - $___process = FS-Append-File "${_directory}\Dockerfile" @" + $___process = FS-Append-File "${___dest}" @" # Defining environment variables ENV ARCH ${_target_arch} ENV OS ${_target_os} @@ -119,15 +142,16 @@ ENV PORT 80 # Assemble the file structure COPY .blank /tmp/.tmpfile -ADD ${PROJECT_SKU} /app/bin/${PROJECT_SKU} +ADD ${env:PROJECT_SKU} /app/bin/${env:PROJECT_SKU_TITLECASE}.sh.ps1 # Set network port exposures EXPOSE 80 # Set entry point -ENTRYPOINT ["/app/bin/${PROJECT_SKU}"] +ENTRYPOINT ["/app/bin/${env:PROJECT_SKU_TITLECASE}.sh.ps1"] "@ if ($___process -ne 0) { + $null = I18N-Create-Failed return 1 } diff --git a/src/.ci/_package-flatpak_unix-any.sh b/src/.ci/_package-flatpak_unix-any.sh index 76b2d5f..869cdcd 100644 --- a/src/.ci/_package-flatpak_unix-any.sh +++ b/src/.ci/_package-flatpak_unix-any.sh @@ -61,14 +61,13 @@ PACKAGE_Assemble_FLATPAK_Content() { return 10 # not applicable elif [ $(FS_Is_Target_A_MSI "$_target") -eq 0 ]; then return 10 # not applicable - elif [ ! "$_target_os" = "linux" ]; then + elif [ ! "$_target_os" = "linux" ] && [ ! "$_target_os" = "any" ]; then return 10 # not applicable fi # copy main program - _target="$1" - _filepath="${_directory}/${PROJECT_SKU}" + _filepath="${_directory}/${PROJECT_SKU_TITLECASE}" I18N_Copy "$_target" "$_filepath" FS_Copy_File "$_target" "$_filepath" if [ $? -ne 0 ]; then @@ -117,23 +116,22 @@ PACKAGE_Assemble_FLATPAK_Content() { app-id: ${PROJECT_APP_ID} branch: ${_target_arch} default-branch: any -command: ${PROJECT_SKU} +command: ${PROJECT_SKU_TITLECASE} runtime: ${PROJECT_FLATPAK_RUNTIME} runtime-version: '${PROJECT_FLATPAK_RUNTIME_VERSION}' sdk: ${PROJECT_FLATPAK_SDK} finish-args: - \"--share=network\" - - \"--socket=pulseaudio\" - \"--filesystem=home\" modules: - name: ${PROJECT_SKU}-main buildsystem: simple no-python-timestamp-fix: true build-commands: - - install -D ${PROJECT_SKU} /app/bin/${PROJECT_SKU} + - install -D ${PROJECT_SKU_TITLECASE} /app/bin/${PROJECT_SKU_TITLECASE} sources: - type: file - path: ${PROJECT_SKU} + path: ${PROJECT_SKU_TITLECASE} - name: ${PROJECT_SKU}-appdata buildsystem: simple build-commands: diff --git a/src/.ci/_package-flatpak_windows-any.ps1 b/src/.ci/_package-flatpak_windows-any.ps1 index 98380b4..37417a4 100644 --- a/src/.ci/_package-flatpak_windows-any.ps1 +++ b/src/.ci/_package-flatpak_windows-any.ps1 @@ -61,13 +61,13 @@ function PACKAGE-Assemble-FLATPAK-Content { return 10 # not applicable } elseif ($(FS-Is-Target-A-MSI "${_target}") -eq 0) { return 10 # not applicable - } elseif ($_target_os -ne "linux") { + } elseif (($_target_os -ne "linux") -and ($_target_os -ne "any")) { return 10 # not applicable } # copy main program - $_filepath = "${_directory}\${env:PROJECT_SKU}" + $_filepath = "${_directory}\${env:PROJECT_SKU_TITLECASE}" $null = I18N-Copy "${_target}" "${_filepath}" $___process = FS-Copy-File "${_target}" "${_filepath}" if ($___process -ne 0) { @@ -77,8 +77,7 @@ function PACKAGE-Assemble-FLATPAK-Content { # copy icon.svg - $_target = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}" - $_target = "${_target}\icons\icon.svg" + $_target = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\icons\icon.svg" $_filepath = "${_directory}\icon.svg" $null = I18N-Copy "${_target}" "${_filepath}" $___process = FS-Copy-File "${_target}" "${_filepath}" @@ -89,8 +88,7 @@ function PACKAGE-Assemble-FLATPAK-Content { # copy icon-48x48.png - $_target = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}" - $_target = "${_target}\icons\icon-48x48.png" + $_target = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\icons\icon-48x48.png" $_filepath = "${_directory}\icon-48x48.png" $null = I18N-Copy "${_target}" "${_filepath}" $___process = FS-Copy-File "${_target}" "${_filepath}" @@ -101,8 +99,7 @@ function PACKAGE-Assemble-FLATPAK-Content { # copy icon-128x128.png - $_target = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}" - $_target = "${_target}\icons\icon-128x128.png" + $_target = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\icons\icon-128x128.png" $_filepath = "${_directory}\icon-128x128.png" $null = I18N-Copy "${_target}" "${_filepath}" $___process = FS-Copy-File "${_target}" "${_filepath}" @@ -119,23 +116,22 @@ function PACKAGE-Assemble-FLATPAK-Content { app-id: ${env:PROJECT_APP_ID} branch: ${_target_arch} default-branch: any -command: ${env:PROJECT_SKU} +command: ${env:PROJECT_SKU_TITLECASE} runtime: ${env:PROJECT_FLATPAK_RUNTIME} runtime-version: '${env:PROJECT_FLATPAK_RUNTIME_VERSION}' sdk: ${env:PROJECT_FLATPAK_SDK} finish-args: - "--share=network" - - "--socket=pulseaudio" - "--filesystem=home" modules: - name: ${env:PROJECT_SKU}-main buildsystem: simple no-python-timestamp-fix: true build-commands: - - install -D ${env:PROJECT_SKU} /app/bin/${env:PROJECT_SKU} + - install -D ${env:PROJECT_SKU_TITLECASE} /app/bin/${env:PROJECT_SKU_TITLECASE} sources: - type: file - path: ${env:PROJECT_SKU} + path: ${env:PROJECT_SKU_TITLECASE} - name: ${env:PROJECT_SKU}-appdata buildsystem: simple build-commands: diff --git a/src/.ci/_package-homebrew_unix-any.sh b/src/.ci/_package-homebrew_unix-any.sh index 44d5528..7621c9d 100644 --- a/src/.ci/_package-homebrew_unix-any.sh +++ b/src/.ci/_package-homebrew_unix-any.sh @@ -20,6 +20,9 @@ if [ "$PROJECT_PATH_ROOT" = "" ]; then return 1 fi +. "${LIBS_AUTOMATACI}/services/io/fs.sh" +. "${LIBS_AUTOMATACI}/services/i18n/translations.sh" + @@ -31,6 +34,52 @@ PACKAGE_Assemble_HOMEBREW_Content() { _target_arch="$5" - # execute - return 10 # not applicable - should be tech-oriented. + # validate project + if [ $(FS_Is_Target_A_Homebrew "$_target") -ne 0 ]; then + return 10 # not applicable + fi + + + # assemble the package + ___source="${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}/${PROJECT_SKU}_any-any.sh.ps1" + ___dest="${_directory}/bin/${PROJECT_SKU_TITLECASE}.sh.ps1" + I18N_Assemble "$___source" "$___dest" + FS_Make_Directory "$___dest" + FS_Copy_File "$___source" "$___dest" + if [ $? -ne 0 ]; then + I18N_Assemble_Failed + return 1 + fi + + + # script formula.rb + ___dest="${_directory}/formula.rb" + I18N_Create "$___dest" + FS_Write_File "$___dest" "\ +class ${PROJECT_SKU_TITLECASE} < Formula + desc \"${PROJECT_PITCH}\" + homepage \"${PROJECT_CONTACT_WEBSITE}\" + license \"${PROJECT_LICENSE}\" + url \"${PROJECT_HOMEBREW_SOURCE_URL}/${PROJECT_VERSION}/{{ TARGET_PACKAGE }}\" + sha256 \"{{ TARGET_SHASUM }}\" + + + def install + chmod 0755, \"bin/${PROJECT_SKU_TITLECASE}.sh.ps1\" + bin.install \"bin/${PROJECT_SKU_TITLECASE}.sh.ps1\" + end + + test do + assert_predicate ./bin/${PROJECT_SKU_TITLECASE}.sh.ps1, :exist? + end +end +" + if [ $? -ne 0 ]; then + I18N_Create_Failed + return 1 + fi + + + # report status + return 0 } diff --git a/src/.ci/_package-homebrew_windows-any.ps1 b/src/.ci/_package-homebrew_windows-any.ps1 index 1b84546..3a30ef7 100644 --- a/src/.ci/_package-homebrew_windows-any.ps1 +++ b/src/.ci/_package-homebrew_windows-any.ps1 @@ -19,6 +19,9 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { exit 1 } +. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1" +. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1" + @@ -32,6 +35,52 @@ function PACKAGE-Assemble-HOMEBREW-Content { ) - # execute - return 10 # not applicable - should be tech-oriented. + # validate project + if ($(FS-Is-Target-A-Homebrew "${_target}") -ne 0) { + return 10 # not applicable + } + + + # assemble the package + $___source = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}\${env:PROJECT_SKU}_any-any.sh.ps1" + $___dest = "${_directory}\bin\${env:PROJECT_SKU_TITLECASE}.sh.ps1" + $null = I18N-Assemble "${___source}" "${___dest}" + $null = FS-Make-Directory "${___dest}" + $___process = FS-Copy-File "${___source}" "${___dest}" + if ($___process -ne 0) { + $null = I18N-Assemble-Failed + return 1 + } + + + # script formula.rb + $___dest = "${_directory}\formula.rb" + $null = I18N-Create "${___dest}" + $___process = FS-Write-File "${___dest}" @" +class ${env:PROJECT_SKU_TITLECASE} < Formula + desc "${env:PROJECT_PITCH}" + homepage "${env:PROJECT_CONTACT_WEBSITE}" + license "${env:PROJECT_LICENSE}" + url "${env:PROJECT_HOMEBREW_SOURCE_URL}/${env:PROJECT_VERSION}/{{ TARGET_PACKAGE }}" + sha256 "{{ TARGET_SHASUM }}" + + + def install + chmod 0755, "bin/${env:PROJECT_SKU_TITLECASE}.sh.ps1" + bin.install "bin/${env:PROJECT_SKU_TITLECASE}.sh.ps1" + end + + test do + assert_predicate ./bin/${env:PROJECT_SKU_TITLECASE}.sh.ps1, :exist? + end +end +"@ + if ($___process -ne 0) { + $null = I18N-Create-Failed + return 1 + } + + + # report status + return 0 } diff --git a/src/.ci/_package-ipk_unix-any.sh b/src/.ci/_package-ipk_unix-any.sh index 18be071..34ebef1 100644 --- a/src/.ci/_package-ipk_unix-any.sh +++ b/src/.ci/_package-ipk_unix-any.sh @@ -86,7 +86,7 @@ PACKAGE_Assemble_IPK_Content() { I18N_Assemble "$_target" "$___dest" FS_Make_Directory "$___dest" - FS_Copy_File "$_target" "$___dest" + FS_Copy_File "$_target" "${___dest}/${PROJECT_SKU_TITLECASE}" if [ $? -ne 0 ]; then I18N_Assemble_Failed return 1 diff --git a/src/.ci/_package-ipk_windows-any.ps1 b/src/.ci/_package-ipk_windows-any.ps1 index 8b12662..ded5733 100644 --- a/src/.ci/_package-ipk_windows-any.ps1 +++ b/src/.ci/_package-ipk_windows-any.ps1 @@ -59,7 +59,7 @@ function PACKAGE-Assemble-IPK-Content { $null = I18N-Assemble "${_target}" "${___dest}" $null = FS-Make-Directory "${___dest}" - $___process = FS-Copy-File "${_target}" "${___dest}" + $___process = FS-Copy-File "${_target}" "${___dest}\${env:PROJECT_SKU_TITLECASE}" if ($___process -ne 0) { $null = I18N-Assemble-Failed return 1 diff --git a/src/.ci/_package-rpm_unix-any.sh b/src/.ci/_package-rpm_unix-any.sh index 966a8c0..9263b91 100644 --- a/src/.ci/_package-rpm_unix-any.sh +++ b/src/.ci/_package-rpm_unix-any.sh @@ -112,7 +112,7 @@ install -m 0644 copyright %{buildroot}/usr/local/share/doc/lib${PROJECT_SKU}/ else # copy main program # TIP: (1) copy all files into "${__directory}/BUILD" directory. - _filepath="${_directory}/BUILD/${PROJECT_SKU}" + _filepath="${_directory}/BUILD/${PROJECT_SKU_TITLECASE}" I18N_Copy "$_target" "$_filepath" FS_Make_Housing_Directory "$_filepath" if [ $? -ne 0 ]; then @@ -132,7 +132,7 @@ install -m 0644 copyright %{buildroot}/usr/local/share/doc/lib${PROJECT_SKU}/ I18N_Create "$__file" FS_Write_File "$__file" "\ install --directory %{buildroot}/usr/local/bin -install -m 0755 ${PROJECT_SKU} %{buildroot}/usr/local/bin +install -m 0755 ${PROJECT_SKU_TITLECASE} %{buildroot}/usr/local/bin install --directory %{buildroot}/usr/local/share/doc/${PROJECT_SKU}/ install -m 0644 copyright %{buildroot}/usr/local/share/doc/${PROJECT_SKU}/ @@ -150,7 +150,7 @@ install -m 0644 ${PROJECT_SKU}.1.gz %{buildroot}/usr/local/share/man/man1/ __file="${_directory}/SPEC_FILES" I18N_Create "$__file" FS_Write_File "$__file" "\ -/usr/local/bin/${PROJECT_SKU} +/usr/local/bin/${PROJECT_SKU_TITLECASE} /usr/local/share/doc/${PROJECT_SKU}/copyright /usr/local/share/man/man1/${PROJECT_SKU}.1.gz " diff --git a/src/.ci/_package-rpm_windows-any.ps1 b/src/.ci/_package-rpm_windows-any.ps1 index 66f3628..ce10284 100644 --- a/src/.ci/_package-rpm_windows-any.ps1 +++ b/src/.ci/_package-rpm_windows-any.ps1 @@ -114,7 +114,7 @@ install -m 0644 copyright %{buildroot}/usr/local/share/doc/lib${env:PROJECT_SKU} # copy main program # TIP: (1) usually is: usr/local/bin or usr/local/sbin # (2) please avoid: bin/, usr/bin/, sbin/, and usr/sbin/ - $_filepath = "${_directory}\BUILD\${env:PROJECT_SKU}" + $_filepath = "${_directory}\BUILD\${env:PROJECT_SKU_TITLECASE}" $null = I18N-Copy "${_target}" "${_filepath}" $___process = FS-Make-Housing-Directory "${_filepath}" if ($___process -ne 0) { @@ -134,7 +134,7 @@ install -m 0644 copyright %{buildroot}/usr/local/share/doc/lib${env:PROJECT_SKU} $null = I18N-Create "${__file}" $___process = FS-Write-File "${__file}" @" install --directory %{buildroot}/usr/local/bin -install -m 0755 ${env:PROJECT_SKU} %{buildroot}/usr/local/bin +install -m 0755 ${env:PROJECT_SKU_TITLECASE} %{buildroot}/usr/local/bin install --directory %{buildroot}/usr/local/share/doc/${env:PROJECT_SKU}/ install -m 644 copyright %{buildroot}/usr/local/share/doc/${env:PROJECT_SKU}/ @@ -152,7 +152,7 @@ install -m 644 ${env:PROJECT_SKU}.1.gz %{buildroot}/usr/local/share/man/man1/ $__file = "${_directory}\SPEC_FILES" $null = I18N-Create "${__file}" $___process = FS-Write-File "${__file}" @" -/usr/local/bin/${env:PROJECT_SKU} +/usr/local/bin/${env:PROJECT_SKU_TITLECASE} /usr/local/share/doc/${env:PROJECT_SKU}/copyright /usr/local/share/man/man1/${env:PROJECT_SKU}.1.gz "@ diff --git a/src/.ci/build_unix-any.sh b/src/.ci/build_unix-any.sh index 0f04e4c..b09be3f 100644 --- a/src/.ci/build_unix-any.sh +++ b/src/.ci/build_unix-any.sh @@ -39,11 +39,11 @@ fi # assemble polygot script -___workspace="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/build-${PROJECT_SKU_TITLECASE}" +___workspace="${PROJECT_PATH_ROOT}/${PROJECT_PATH_TEMP}/build-${PROJECT_SKU}" FS_Remake_Directory "$___workspace" -___dest="${___workspace}/${PROJECT_SKU_TITLECASE}.sh.ps1" +___dest="${___workspace}/${PROJECT_SKU}.sh.ps1" I18N_Create "$___dest" FS_Write_File "$___dest" "\ echo \\\" <<'RUN_AS_BATCH' >/dev/null \">NUL \"\\\" \\\`\" <#\" @@ -189,15 +189,36 @@ I18N_Newline # export -___dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}/${PROJECT_SKU_TITLECASE}_any-any.sh.ps1" -FS_Make_Housing_Directory "$___dest" +FS_Make_Directory "${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}" -I18N_Export "$___dest" -FS_Copy_File "$___source" "$___dest" -if [ $? -ne 0 ]; then - I18N_Export_Failed - return 1 -fi +__old_IFS="$IFS" +while IFS= read -r __line || [ -n "$__line" ]; do + ___dest="${PROJECT_PATH_ROOT}/${PROJECT_PATH_BUILD}/${PROJECT_SKU}_${__line}.sh.ps1" + I18N_Export "$___dest" + FS_Copy_File "$___source" "$___dest" + if [ $? -ne 0 ]; then + I18N_Export_Failed + return 1 + fi +done </dev/null ">NUL "\" \``" <#" @@ -191,14 +191,33 @@ $null = I18N-Newline # export -$___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}\${env:PROJECT_SKU_TITLECASE}_any-any.sh.ps1" -$null = FS-Make-Housing-Directory "${___dest}" - -$null = I18N-Export "${___dest}" -$___process = FS-Copy-File "${___source}" "${___dest}" -if ($___process -ne 0) { - $null = I18N-Export-Failed - return 1 +$null = FS-Make-Directory "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}" + +foreach ($__line in @( + "darwin-amd64" + "darwin-arm64" + "linux-386" + "linux-amd64" + "linux-arm64" + "linux-arm" + "linux-loong64" + "linux-mips" + "linux-mips64" + "linux-mips64le" + "linux-ppc64" + "linux-ppc64le" + "linux-riscv64" + "linux-s390x" + "windows-amd64" + "windows-arm64" +)) { + $___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_BUILD}\${env:PROJECT_SKU}_${__line}.sh.ps1" + $null = I18N-Export "${___dest}" + $___process = FS-Copy-File "${___source}" "${___dest}" + if ($___process -ne 0) { + $null = I18N-Export-Failed + return 1 + } } diff --git a/src/changelog/data/latest b/src/changelog/data/latest index 3d9466e..20bdad7 100644 --- a/src/changelog/data/latest +++ b/src/changelog/data/latest @@ -1,3 +1,5 @@ +automataCI: performed early patched to archive CI job algorithm +src: implemented polygot script build alogrithm CONFIG.toml: updated URI to match upstream repository address README.md: updated pitch line to be more direct. README.md: added supported AI vendors list diff --git a/src/changelog/deb/latest b/src/changelog/deb/latest index 9bd1f45..514f67f 100644 --- a/src/changelog/deb/latest +++ b/src/changelog/deb/latest @@ -1,5 +1,7 @@ hollowayhiai (0.0.1) stable; urgency=low + * automataCI: performed early patched to archive CI job algorithm + * src: implemented polygot script build alogrithm * CONFIG.toml: updated URI to match upstream repository address * README.md: updated pitch line to be more direct. * README.md: added supported AI vendors list @@ -7,4 +9,4 @@ hollowayhiai (0.0.1) stable; urgency=low * README.md: updated with how-tos guides * src: developed first prototype --- (Holloway) Chew, Kean Ho Sun, 31 Mar 2024 10:19:08 +0800 +-- (Holloway) Chew, Kean Ho Sun, 31 Mar 2024 17:47:26 +0800 diff --git a/src/docs/ABSTRACTS.txt b/src/docs/ABSTRACTS.txt index a56c2bc..7e7686f 100644 --- a/src/docs/ABSTRACTS.txt +++ b/src/docs/ABSTRACTS.txt @@ -24,3 +24,8 @@ supported device via large language model (LLM) prompt. This project is to make LLM AI prompt available for all the current computing devices via interacting with API so that one does not need to overly dependent on a graphical user interface alone. + +When operating in Sandbox mode, this app requires: +(1) Network access to communicate with service providers' API. +(2) Filesystem access for 'text2image' or 'text2video' queries + for saving the media output files. diff --git a/src/docs/CITATIONS.yml b/src/docs/CITATIONS.yml index 5a7ee65..a24c1a8 100644 --- a/src/docs/CITATIONS.yml +++ b/src/docs/CITATIONS.yml @@ -60,7 +60,7 @@ authors: identifiers: - type: doi value: "10.0000/publisher.000000" - description: "Paper" + description: "Software" keywords: - "ai application" - "prompt"