Skip to content

Commit

Permalink
root: backported srcRESEARCH implementations from hestiaERROR
Browse files Browse the repository at this point in the history
In hestiaERROR repository, there were some improvement works done
for srcRESEARCH/ implementations. Hence, let's backport it.

This patch backports srcRESEARCH implementations from hestiaERROR
into root repository.

Co-authored-by: Shuralyov, Jean <[email protected]>
Co-authored-by: Galyna, Cory <[email protected]>
Co-authored-by: (Holloway) Chew, Kean Ho <[email protected]>
Signed-off-by: (Holloway) Chew, Kean Ho <[email protected]>
  • Loading branch information
3 people committed Jun 10, 2024
1 parent 6c5849c commit ddd515f
Show file tree
Hide file tree
Showing 9 changed files with 423 additions and 199 deletions.
29 changes: 25 additions & 4 deletions CONFIG.toml
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ GOOGLEAI_BLOCK_HARASSMENT = 'BLOCK_NONE'
# notify the CI provider to setup a localized virtual environment for
# development automatically.
#
# Do note that should the following technologies are enabled, LibreOffice shall
# be installed regardless of this control variable:
# (1) PROJECT_RESEARCH - using Libreoffice by default.
#
# To enable it: simply supply the path (e.g. default is 'srcLIBREOFFICE').
# To disable it: simply supply an empty path (e.g. default is '').
PROJECT_LIBREOFFICE = ''
Expand All @@ -462,17 +466,22 @@ PROJECT_LIBREOFFICE = ''
#
# Refer to the following mirror list for value selection:
# (1) https://download.documentfoundation.org/mirmon/allmirrors.html
PROJECT_LIBREOFFICE_MIRROR = "https://ftp.osuosl.org/pub/tdf/libreoffice"

PROJECT_LIBREOFFICE_MIRROR = "https://download.documentfoundation.org/libreoffice"

# PROJECT_LIBREOFFICE_VERSION
# This is for defining the LibreOffice version to install into the local OS.
#
# Refer the the following list for value selection:
# (1) https://www.libreoffice.org/download/download-libreoffice/
#
# Example: '24.2.1' for 'LibreOffice 24.2.1'
PROJECT_LIBREOFFICE_VERSION = "24.2.1"
# Example: '24.4.3' for 'LibreOffice 24.4.3'
PROJECT_LIBREOFFICE_VERSION = "24.2.3"


# PROJECT_PATH_LIBREOFFICE_ENGINE
# This is a relative pathing to PROJECT_PATH_ROOT + PROJECT_PATH_TOOLS for
# setting up localized environment.
PROJECT_PATH_LIBREOFFICE_ENGINE = "libreoffice-engine"



Expand Down Expand Up @@ -649,6 +658,18 @@ PROJECT_PYPI_README_MIME = "text/markdown"
PROJECT_RESEARCH = ''


# PROJECT_RESEARCH_IDENTIFIER
# The file identifier for the compiled output paper file from its peers with the
# same formats (e.g. a bunch of PDFs). This is suffix-ed within the filename
# itself like:
#
# pattern: '${PROJECT_SKU}-${PROJECT_RESEARCH_IDENTIFIER}_v${PROJECT_VERSION}_any-any.pdf'
# example: 'automataci-RESEARCH_v100.00.100_any-any.pdf'
#
# default is: 'RESEARCH'
PROJECT_RESEARCH_IDENTIFIER = 'RESEARCH'




######################
Expand Down
54 changes: 54 additions & 0 deletions automataCI/_release-pdf_unix-any.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#!/bin/sh
# Copyright 2024 (Holloway) Chew, Kean Ho <[email protected]>
#
# 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
# 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
# License for the specific language governing permissions and limitations under
# the License.
. "${LIBS_AUTOMATACI}/services/io/fs.sh"
. "${LIBS_AUTOMATACI}/services/i18n/translations.sh"




# initialize
if [ "$PROJECT_PATH_ROOT" = "" ]; then
>&2 printf "[ ERROR ] - Please run me from automataCI/ci.sh.ps1 instead!\n"
return 1
fi




RELEASE_Run_PDF() {
#_target="$1"


# validate input
if [ $(FS_Is_Target_A_PDF "$1") -ne 0 ]; then
return 0
fi


# execute
___dest="PAPER.pdf"
I18N_Publish "$___dest"
___dest="${PROJECT_PATH_ROOT}/${___dest}"
if [ "${1##*${PROJECT_RESEARCH_IDENTIFIER}}" != "$1" ]; then
## it's a research paper
FS_Copy_File "$1" "$___dest"
if [ $? -ne 0 ]; then
I18N_Publish_Failed
return 1
fi
fi


# report status
return 0
}
56 changes: 56 additions & 0 deletions automataCI/_release-pdf_windows-any.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Copyright 2024 (Holloway) Chew, Kean Ho <[email protected]>
#
# 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
# 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
# License for the specific language governing permissions and limitations
# under the License.
. "${env:LIBS_AUTOMATACI}\services\io\fs.ps1"
. "${env:LIBS_AUTOMATACI}\services\i18n\translations.ps1"




# initialize
if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) {
Write-Error "[ ERROR ] - Please run from automataCI\ci.sh.ps1 instead!`n"
return
}




function RELEASE-Run-PDF {
param(
[string]$_target
)


# validate input
$___process = FS-Is-Target-A-PDF "${_target}"
if ($___process -ne 0) {
return 0
}


# execute
$___dest = "PAPER.pdf"
$null = I18N-Publish "${___dest}"
$___dest = "${env:PROJECT_PATH_ROOT}\${___dest}"
if ($($_target -replace "^.*${env:PROJECT_RESEARCH_IDENTIFIER}") -ne "${_target}") {
## it's a research paper
$___process = FS-Copy-File "${_target}" "${___dest}"
if ($___process -ne 0) {
$null = I18N-Publish-Failed
return 1
}
}


# report status
return 0
}
6 changes: 6 additions & 0 deletions automataCI/release_unix-any.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ fi
. "${LIBS_AUTOMATACI}/_release-homebrew_unix-any.sh"
. "${LIBS_AUTOMATACI}/_release-lib_unix-any.sh"
. "${LIBS_AUTOMATACI}/_release-npm_unix-any.sh"
. "${LIBS_AUTOMATACI}/_release-pdf_unix-any.sh"
. "${LIBS_AUTOMATACI}/_release-pypi_unix-any.sh"
. "${LIBS_AUTOMATACI}/_release-rpm_unix-any.sh"
. "${LIBS_AUTOMATACI}/_release-staticrepo_unix-any.sh"
Expand Down Expand Up @@ -139,6 +140,11 @@ for TARGET in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}"/*; do
return 1
fi

RELEASE_Run_PDF "$TARGET"
if [ $? -ne 0 ]; then
return 1
fi

RELEASE_Run_PYPI "$TARGET"
if [ $? -ne 0 ]; then
return 1
Expand Down
6 changes: 6 additions & 0 deletions automataCI/release_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) {
. "${env:LIBS_AUTOMATACI}\_release-homebrew_windows-any.ps1"
. "${env:LIBS_AUTOMATACI}\_release-lib_windows-any.ps1"
. "${env:LIBS_AUTOMATACI}\_release-npm_windows-any.ps1"
. "${env:LIBS_AUTOMATACI}\_release-pdf_windows-any.ps1"
. "${env:LIBS_AUTOMATACI}\_release-pypi_windows-any.ps1"
. "${env:LIBS_AUTOMATACI}\_release-rpm_windows-any.ps1"
. "${env:LIBS_AUTOMATACI}\_release-staticrepo_windows-any.ps1"
Expand Down Expand Up @@ -142,6 +143,11 @@ if (Test-Path -PathType Container -Path "${PACKAGE_DIRECTORY}") {
return 1
}

$___process = RELEASE-Run-PDF "$TARGET"
if ($___process -ne 0) {
return 1
}

$___process = RELEASE-Run-PYPI "$TARGET"
if ($___process -ne 0) {
return 1
Expand Down
Loading

0 comments on commit ddd515f

Please sign in to comment.