Skip to content

Commit

Permalink
root: enabled research paper pipeline (srcRESEARCH)
Browse files Browse the repository at this point in the history
Since we want this library to be reliably good, we should enable
the research paper pipeline and place all our details and data in
it. That way, interested folks and code auditors can review the
materials without needing to ping-pong with the maintainers that
often.

This patch enables research paper pipeline (srcRESEARCH) in
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 30de314 commit 25d2c84
Show file tree
Hide file tree
Showing 10 changed files with 622 additions and 181 deletions.
31 changes: 26 additions & 5 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 @@ -646,7 +655,19 @@ PROJECT_PYPI_README_MIME = "text/markdown"
#
# To enable it: simply supply the path (e.g. default is 'srcRESEARCH').
# To disable it: simply supply an empty path (e.g. default is '').
PROJECT_RESEARCH = ''
PROJECT_RESEARCH = 'srcRESEARCH'


# 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
53 changes: 53 additions & 0 deletions automataCI/_release-pdf_unix-any.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/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
return 1
fi
fi


# report status
return 0
}
65 changes: 65 additions & 0 deletions automataCI/_release-pdf_windows-any.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# 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
}

if ($(STRINGS-Is-Empty "${env:PROJECT_SOURCE_GIT_REMOTE}") -eq 0) {
return 0
}

$___process = GIT-Is-Available
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 "$1" "${___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 25d2c84

Please sign in to comment.