Skip to content

Commit

Permalink
automataCI: upgraded from npm to libraries packaging
Browse files Browse the repository at this point in the history
Since npm is a library itself, we can proceed to create a
libraries CI tasks instead of serving specifically for NPM. That
way, other technologies' libraries can share the same production
processes for maximum consistencies. Hence, let's do this.

This patch upgrades from npm to libraries packaging in automataCI/
directory.

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 9, 2024
1 parent 9c72753 commit db70f83
Show file tree
Hide file tree
Showing 47 changed files with 1,193 additions and 581 deletions.
27 changes: 27 additions & 0 deletions CONFIG.toml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,33 @@ PROJECT_SOURCE_GIT_REMOTE = 'origin'
PROJECT_SOURCE_RELEASE_TAG_LATEST = 'latest'


# PROJECT_README
# The relative location of the project readme file from $PROJECT_PATH_ROOT
# (repository root directory).
#
# Default is 'README.md'
PROJECT_README = 'README.md'


# PROJECT_LICENSE_FILE
# The relative location of the project license file from $PROJECT_PATH_ROOT
# (repository root directory).
#
# Default is 'LICENSE.txt'
PROJECT_LICENSE_FILE = 'LICENSE.txt'


# PROJECT_LICENSE_ACCEPTANCE_REQUIRED
# The flag to indicate the license of the project **MUST** be explictly
# accepted. This is used in ecosystem like .NET nupkg where a special UI
# is available to interact with the end-users.
#
# Value is lowercase 'true' or 'false'.
#
# Default is 'true'
PROJECT_LICENSE_ACCEPTANCE_REQUIRED = 'true'


# AUTOMATACI_LANG
# Overrides AutomataCI to operate in 1 specific language. Otherwise, AutomataCI
# shall query the system language settings. Only accepts language code complying
Expand Down
2 changes: 1 addition & 1 deletion automataCI/_package-homebrew_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function PACKAGE-Run-HOMEBREW {
"{{ TARGET_SHASUM }}" `
"${__shasum}"

$___process = FS-Append-File "${_target_path}.rb" "${__line}"
$___process = FS-Append-File "${_target_path}.rb" "${__line}`n"
if ($___process -ne 0) {
$null = I18N-Update-Failed
return 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fi



PACKAGE_Run_NPM() {
PACKAGE_Run_LIB() {
#__line="$1"


Expand All @@ -50,7 +50,7 @@ PACKAGE_Run_NPM() {


# copy all complimentary files to the workspace
cmd="PACKAGE_Assemble_NPM_Content"
cmd="PACKAGE_Assemble_LIB_Content"
I18N_Check_Function "$cmd"
OS_Is_Command_Available "$cmd"
if [ $? -ne 0 ]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) {



function PACKAGE-Run-NPM {
function PACKAGE-Run-LIB {
param (
[string]$__line
)
Expand All @@ -41,7 +41,7 @@ function PACKAGE-Run-NPM {


# copy all complimentary files to the workspace
$cmd = "PACKAGE-Assemble-NPM-Content"
$cmd = "PACKAGE-Assemble-LIB-Content"
$null = I18N-Check-Function "$cmd"
$___process = OS-Is-Command-Available "$cmd"
if ($___process -ne 0) {
Expand All @@ -50,7 +50,7 @@ function PACKAGE-Run-NPM {
}

$null = I18N-Assemble-Package
$___process = PACKAGE-Assemble-NPM-Content `
$___process = PACKAGE-Assemble-LIB-Content `
"${_target}" `
"${_dest}" `
"${_target_filename}" `
Expand Down
8 changes: 2 additions & 6 deletions automataCI/_release-checksum_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ function RELEASE-Run-CHECKSUM {
return 1
}

$___process = FS-Append-File "${__sha256_file}" @"
${__value} $TARGET
"@
$___process = FS-Append-File "${__sha256_file}" "${__value} $TARGET`n"
if ($___process -ne 0) {
$null = I18N-Checksum-Failed
return 1
Expand All @@ -121,9 +119,7 @@ ${__value} $TARGET
return 1
}

$___process = FS-Append-File "${__sha512_file}" @"
${__value} $TARGET
"@
$___process = FS-Append-File "${__sha512_file}" "${__value} $TARGET`n"
if ($___process -ne 0) {
$null = I18N-Checksum-Failed
return 1
Expand Down
1 change: 1 addition & 0 deletions automataCI/_release-staticrepo_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function RELEASE-Conclude-STATIC-REPO {
This is a re-purposed repository for housing various distribution ecosystem
such as but not limited to ``.deb``, ``.rpm``, ``.flatpak``, and etc for folks
to ``apt-get install``, ``yum install``, or ``flatpak install``.
"@

$null = I18N-Commit "STATIC REPO"
Expand Down
12 changes: 6 additions & 6 deletions automataCI/package_unix-any.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ fi
. "${LIBS_AUTOMATACI}/_package-flatpak_unix-any.sh"
. "${LIBS_AUTOMATACI}/_package-homebrew_unix-any.sh"
. "${LIBS_AUTOMATACI}/_package-ipk_unix-any.sh"
. "${LIBS_AUTOMATACI}/_package-lib_unix-any.sh"
. "${LIBS_AUTOMATACI}/_package-msi_unix-any.sh"
. "${LIBS_AUTOMATACI}/_package-npm_unix-any.sh"
. "${LIBS_AUTOMATACI}/_package-pdf_unix-any.sh"
. "${LIBS_AUTOMATACI}/_package-pypi_unix-any.sh"
. "${LIBS_AUTOMATACI}/_package-rpm_unix-any.sh"
Expand Down Expand Up @@ -245,17 +245,17 @@ ${__common}|${__log}|PACKAGE_Run_IPK
return 1
fi

__log="${__log_directory}/msi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
FS_Append_File "$__serial_control" "\
${__common}|${__log}|PACKAGE_Run_MSI
__log="${__log_directory}/lib_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
FS_Append_File "$__parallel_control" "\
${__common}|${__log}|PACKAGE_Run_LIB
"
if [ $? -ne 0 ]; then
return 1
fi

__log="${__log_directory}/npm_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
__log="${__log_directory}/msi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
FS_Append_File "$__serial_control" "\
${__common}|${__log}|PACKAGE_Run_NPM
${__common}|${__log}|PACKAGE_Run_MSI
"
if [ $? -ne 0 ]; then
return 1
Expand Down
25 changes: 19 additions & 6 deletions automataCI/package_windows-any.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ function SUBROUTINE-Package {
$null = . "${env:LIBS_AUTOMATACI}\_package-flatpak_windows-any.ps1"
$null = . "${env:LIBS_AUTOMATACI}\_package-homebrew_windows-any.ps1"
$null = . "${env:LIBS_AUTOMATACI}\_package-ipk_windows-any.ps1"
$null = . "${env:LIBS_AUTOMATACI}\_package-lib_windows-any.ps1"
$null = . "${env:LIBS_AUTOMATACI}\_package-msi_windows-any.ps1"
$null = . "${env:LIBS_AUTOMATACI}\_package-npm_windows-any.ps1"
$null = . "${env:LIBS_AUTOMATACI}\_package-pdf_windows-any.ps1"
$null = . "${env:LIBS_AUTOMATACI}\_package-pypi_windows-any.ps1"
$null = . "${env:LIBS_AUTOMATACI}\_package-rpm_windows-any.ps1"
Expand Down Expand Up @@ -198,6 +198,7 @@ foreach ($file in (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_P
$__log = "${__log_directory}\archive_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-ARCHIVE
"@
if ($___process -ne 0) {
return 1
Expand All @@ -206,6 +207,7 @@ ${__common}|${__log}|PACKAGE-Run-ARCHIVE
$__log = "${__log_directory}\cargo_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-CARGO
"@
if ($___process -ne 0) {
return 1
Expand All @@ -214,6 +216,7 @@ ${__common}|${__log}|PACKAGE-Run-CARGO
$__log = "${__log_directory}\chocolatey_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-CHOCOLATEY
"@
if ($___process -ne 0) {
return 1
Expand All @@ -222,6 +225,7 @@ ${__common}|${__log}|PACKAGE-Run-CHOCOLATEY
$__log = "${__log_directory}\deb_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${FILE_CHANGELOG_DEB}|${__log}|PACKAGE-Run-DEB
"@
if ($___process -ne 0) {
return 1
Expand All @@ -230,6 +234,7 @@ ${__common}|${FILE_CHANGELOG_DEB}|${__log}|PACKAGE-Run-DEB
$__log = "${__log_directory}\docker_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__serial_control}" @"
${__common}|${__log}|PACKAGE-Run-DOCKER
"@
if ($___process -ne 0) {
return 1
Expand All @@ -239,6 +244,7 @@ ${__common}|${__log}|PACKAGE-Run-DOCKER
$__log = "${__log_directory}\flatpak_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__serial_control}" @"
${__common}|${__flatpak_path}|${__log}|PACKAGE-Run-FLATPAK
"@
if ($___process -ne 0) {
return 1
Expand All @@ -247,6 +253,7 @@ ${__common}|${__flatpak_path}|${__log}|PACKAGE-Run-FLATPAK
$__log = "${__log_directory}\homebrew_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-HOMEBREW
"@
if ($___process -ne 0) {
return 1
Expand All @@ -255,22 +262,25 @@ ${__common}|${__log}|PACKAGE-Run-HOMEBREW
$__log = "${__log_directory}\ipk_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-IPK
"@
if ($___process -ne 0) {
return 1
}

$__log = "${__log_directory}\msi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__serial_control}" @"
${__common}|${__log}|PACKAGE-Run-MSI
$__log = "${__log_directory}\lib_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-LIB
"@
if ($___process -ne 0) {
return 1
}

$__log = "${__log_directory}\npm_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$__log = "${__log_directory}\msi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__serial_control}" @"
${__common}|${__log}|PACKAGE-Run-NPM
${__common}|${__log}|PACKAGE-Run-MSI
"@
if ($___process -ne 0) {
return 1
Expand All @@ -279,6 +289,7 @@ ${__common}|${__log}|PACKAGE-Run-NPM
$__log = "${__log_directory}\PDF_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-PDF
"@
if ($___process -ne 0) {
return 1
Expand All @@ -287,6 +298,7 @@ ${__common}|${__log}|PACKAGE-Run-PDF
$__log = "${__log_directory}\pypi_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-PYPI
"@
if ($___process -ne 0) {
return 1
Expand All @@ -295,6 +307,7 @@ ${__common}|${__log}|PACKAGE-Run-PYPI
$__log = "${__log_directory}\rpm_${TARGET_FILENAME}_${TARGET_OS}-${TARGET_ARCH}.log"
$___process = FS-Append-File "${__parallel_control}" @"
${__common}|${__log}|PACKAGE-Run-RPM
"@
if ($___process -ne 0) {
return 1
Expand Down
7 changes: 5 additions & 2 deletions automataCI/services/compilers/c.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,14 @@ function C-Build {
# it's a .c file. Register for building and linking...
$___process = FS-Append-File "${___build_list}" @"
build|${___file_obj}|${___file_src}|${___file_log}|${___os}|${___arch}|${___compiler}|${___arguments}
"@
if ($___process -ne 0) {
return 1
}


$___process = FS-Append-File "${___object_list}" "${___file_obj}"
$___process = FS-Append-File "${___object_list}" "${___file_obj}`n"
if ($___process -ne 0) {
return 1
}
Expand All @@ -151,7 +152,7 @@ build|${___file_obj}|${___file_src}|${___file_log}|${___os}|${___arch}|${___comp
return 1
}

$___process = FS-Append-File "${___object_list}" "${___file_obj}"
$___process = FS-Append-File "${___object_list}" "${___file_obj}`n"
if ($___process -ne 0) {
return 1
}
Expand Down Expand Up @@ -869,13 +870,15 @@ function C-Test {

$___process = FS-Append-File "${___build_list}" @"
build-executable|${___file_obj}|${___file_src}|${___file_log}_build.log|${___os}|${___arch}|${___compiler}|${___arguments}
"@
if ($___process -ne 0) {
return 1
}

$___process = FS-Append-File "${___test_list}" @"
test|${___file_obj}|${___file_src}|${___file_log}_test.log|${___os}|${___arch}|${___compiler}|${___arguments}
"@
if ($___process -ne 0) {
return 1
Expand Down
Loading

0 comments on commit db70f83

Please sign in to comment.