diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 00000000..9969affb --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,62 @@ +# WARNING: auto-generated by AutomataCI + +cff-version: "1.2.0" +type: "software" +date-released: "2023-11-04" +title: "AutomataCI" +version: "1.7.0" +license: "Apache-2.0" +repository: "https://github.com/ChewKeanHo/AutomataCI" +repository-code: "https://github.com/ChewKeanHo/AutomataCI" +repository-artifact: "https://github.com/ChewKeanHo/AutomataCI/wiki/" +url: "https://your-product.website.here" +contact: + - affiliation: "Your Legal Full Name Here" + email: "contact@youremail.example" + website: "https://your-product.website.here" +abstract: |- + Continuous improvements or integrations (CI) is a nerve system of a + software product production. Leaving the job blindly by outsourcing + to any proprietary 3rd-party CI service provider is a guaranteed + way for being threatened and extorted by any malicious suppliers. + As of year 2021 to 2023, many evidences show that the suppliers + vilely alter their pricing charges after the fact to the point of + legally extorting their customers and destroyed some useful + software entirely. + + Therefore, AutomataCI counters such problem by facilitating CI + functions natively, making it locally available, decentralized, + and redistributable at git repository level. 3rd-party service + providers can only call AutomataCI just like how the developer + performs them locally. This de-risk the software owner by not + completely depending on the service provider, allowing him/her + to switch supplier easily. AutomataCI also facilitates + technology-specific automation customization, capable of + absorbing new changes easily across time. It only uses the + basic POSIX compliant Shell and PowerShell scripts. +message: |- + Please cite and reference this repository accordingly. +authors: + - given-names: "Kean Ho" + family-names: "Chew" + email: "hollowaykeanho@gmail.com" + affiliation: "Independent" + orcid: "https://orcid.org/0000-0003-4202-4863" + - given-names: "Cory" + family-names: "Galyna" + email: "124406765+corygalyna@users.noreply.github.com" + affiliation: "Independent" +identifiers: + - type: doi + value: "10.5281/zenodo.000000" + description: "Paper" +keywords: + - "continuous integration" + - "native and locally available" + - "git enhancement" + - "decentralized" + - "redistributable" + - "powershell" + - "posix shell" + - "solid foundation" + - "self-improvable" diff --git a/CONFIG.toml b/CONFIG.toml index 3115773f..44187b38 100644 --- a/CONFIG.toml +++ b/CONFIG.toml @@ -126,6 +126,27 @@ PROJECT_C = '' +###################### +# CITATION # +###################### +# PROJECT_CITATION +# This is the control variable used to generate the CITATION.cff file during the +# Release CI Job. It is the cff-version field's value. +# +# To enable it, simply simply the supported version. Default is '1.2.0'. +# To dsiable it, simply leave it empty. +PROJECT_CITATION="1.2.0" + + +# PROJECT_CITATION_TYPE +# The type's field value of the repository representing the content of it. +# +# Can only accept 'software' or 'dataset'. Default is 'software'. +PROJECT_CITATION_TYPE="software" + + + + ###################### # GO TECHNOLOGY # ###################### diff --git a/automataCI/_release-citation_unix-any.sh b/automataCI/_release-citation_unix-any.sh new file mode 100644 index 00000000..b7b86df3 --- /dev/null +++ b/automataCI/_release-citation_unix-any.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# Copyright 2023 (Holloway) Chew, Kean Ho +# +# 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. +. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/io/os.sh" +. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/io/fs.sh" +. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/io/time.sh" +. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/compilers/citation.sh" + + + + +RELEASE::run_citation() { + # execute + OS::print_status info "generating citation file...\n" + CITATION::build \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}/CITATION.cff" \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/ABSTRACTS.txt" \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_SOURCE}/docs/CITATIONS.yml" \ + "$PROJECT_CITATION" \ + "$PROJECT_CITATION_TYPE" \ + "$(TIME::format_iso8601_date "$(TIME::now)")" \ + "$PROJECT_NAME" \ + "$PROJECT_VERSION" \ + "$PROJECT_LICENSE" \ + "$PROJECT_SOURCE_URL" \ + "$PROJECT_SOURCE_URL" \ + "$PROJECT_STATIC_URL" \ + "$PROJECT_CONTACT_NAME" \ + "$PROJECT_CONTACT_WEBSITE" \ + "$PROJECT_CONTACT_EMAIL" + if [ $? -ne 0 ]; then + OS::print_status error "generate failed.\n" + return 1 + fi + + if [ -f "${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}/CITATION.cff" ]; then + OS::print_status info "exporting CITATION.cff...\n" + FS::copy_file \ + "${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}/CITATION.cff" \ + "${PROJECT_PATH_ROOT}/CITATION.cff" + if [ $? -ne 0 ]; then + OS::print_status error "export failed.\n" + return 1 + fi + fi + + + # report status + return 0 +} diff --git a/automataCI/_release-citation_windows-any.ps1 b/automataCI/_release-citation_windows-any.ps1 new file mode 100644 index 00000000..f2842fbb --- /dev/null +++ b/automataCI/_release-citation_windows-any.ps1 @@ -0,0 +1,59 @@ +# Copyright 2023 (Holloway) Chew, Kean Ho +# +# 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:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\io\os.ps1" +. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\io\fs.ps1" +. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\io\time.ps1" +. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\compilers\citation.ps1" + + + + +function RELEASE-Run-Citation { + # execute + OS-Print-Status info "generating citation file..." + $__process = CITATION-Build ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\CITATION.cff" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\docs\ABSTRACTS.txt" ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_SOURCE}\docs\CITATIONS.yml" ` + "${env:PROJECT_CITATION}" ` + "${env:PROJECT_CITATION_TYPE}" ` + "$(TIME-Format-ISO8601-Date "$(TIME-Now)")" ` + "${env:PROJECT_NAME}" ` + "${env:PROJECT_VERSION}" ` + "${env:PROJECT_LICENSE}" ` + "${env:PROJECT_SOURCE_URL}" ` + "${env:PROJECT_SOURCE_URL}" ` + "${env:PROJECT_STATIC_URL}" ` + "${env:PROJECT_CONTACT_NAME}" ` + "${env:PROJECT_CONTACT_WEBSITE}" ` + "${env:PROJECT_CONTACT_EMAIL}" + if ($__process -ne 0) { + OS-Print-Status error "generate failed." + return 1 + } + + + if (Test-Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\CITATION.cff") { + OS-Print-Status info "exporting CITATION.cff..." + $__process = FS-Copy-File ` + "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_PKG}\CITATION.cff" ` + "${env:PROJECT_PATH_ROOT}\CITATION.cff" + if ($__process -ne 0) { + OS-Print-Status error "export failed." + return 1 + } + } + + + # report status + return 0 +} diff --git a/automataCI/docs/AutomataCI-Engineering-Specification.odt b/automataCI/docs/AutomataCI-Engineering-Specification.odt index 66e949ad..de8f3c9c 100644 Binary files a/automataCI/docs/AutomataCI-Engineering-Specification.odt and b/automataCI/docs/AutomataCI-Engineering-Specification.odt differ diff --git a/automataCI/docs/AutomataCI-Engineering-Specification.pdf b/automataCI/docs/AutomataCI-Engineering-Specification.pdf index 48cc6ddd..76501a7f 100644 Binary files a/automataCI/docs/AutomataCI-Engineering-Specification.pdf and b/automataCI/docs/AutomataCI-Engineering-Specification.pdf differ diff --git a/automataCI/release_unix-any.sh b/automataCI/release_unix-any.sh index d21ad77e..f25b477a 100644 --- a/automataCI/release_unix-any.sh +++ b/automataCI/release_unix-any.sh @@ -27,6 +27,7 @@ fi . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/_release-changelog_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/_release-checksum_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/_release-chocolatey_unix-any.sh" +. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/_release-citation_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/_release-deb_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/_release-docker_unix-any.sh" . "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/_release-homebrew_unix-any.sh" @@ -139,6 +140,12 @@ for TARGET in "${PROJECT_PATH_ROOT}/${PROJECT_PATH_PKG}"/*; do done +RELEASE::run_citation +if [ $? -ne 0 ]; then + return 1 +fi + + RELEASE::run_checksum_seal "$STATIC_REPO" if [ $? -ne 0 ]; then return 1 diff --git a/automataCI/release_windows-any.ps1 b/automataCI/release_windows-any.ps1 index fb07baff..f9b199a7 100644 --- a/automataCI/release_windows-any.ps1 +++ b/automataCI/release_windows-any.ps1 @@ -26,6 +26,7 @@ if (-not (Test-Path -Path $env:PROJECT_PATH_ROOT)) { . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\_release-changelog_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\_release-checksum_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\_release-chocolatey_windows-any.ps1" +. "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\_release-citation_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\_release-deb_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\_release-docker_windows-any.ps1" . "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\_release-homebrew_windows-any.ps1" @@ -140,6 +141,12 @@ foreach ($TARGET in (Get-ChildItem -Path "${env:PROJECT_PATH_ROOT}\${env:PROJECT } +$__process = RELEASE-Run-Citation +if ($__process -ne 0) { + return 1 +} + + $__process = RELEASE-Run-Checksum-Seal "$STATIC_REPO" if ($__process -ne 0) { return 1 diff --git a/automataCI/services/compilers/citation.ps1 b/automataCI/services/compilers/citation.ps1 new file mode 100644 index 00000000..37208942 --- /dev/null +++ b/automataCI/services/compilers/citation.ps1 @@ -0,0 +1,226 @@ +# Copyright 2023 (Holloway) Chew, Kean Ho +# +# 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:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_AUTOMATA}\services\io\fs.ps1" + + + + +function CITATION-Build { + param( + [string]$__filepath, + [string]$__abstract_filepath, + [string]$__citation_filepath, + [string]$__cff_version, + [string]$__type, + [string]$__date, + [string]$__title, + [string]$__version, + [string]$__license, + [string]$__repo, + [string]$__repo_code, + [string]$__repo_artifact, + [string]$__contact_name, + [string]$__contact_website, + [string]$__contact_email + ) + + + # validate input + if ([string]::IsNullOrEmpty($__cff_version)) { + return 0 # requested to be disabled + } + + if ([string]::IsNullOrEmpty($__filepath) -or + [string]::IsNullOrEmpty($__title) -or + [string]::IsNullOrEmpty($__type)) { + return 1 + } + + if ([string]::IsNullOrEmpty($__citation_filepath) -or + (-not (Test-Path -Path "${__citation_filepath}"))) { + return 1 + } + + + # execute + $null = FS-Remove-Silently "${__filepath}" + $null = FS-Make-Housing-Directory "${__filepath}" + $__process = FS-Write-File "${__filepath}" @" +# WARNING: auto-generated by AutomataCI + +cff-version: `"${__cff_version}`" +type: `"${__type}`" +"@ + if ($__process -ne 0) { + return 1 + } + + ## date + if (-not [string]::IsNullOrEmpty($__date)) { + $__process = FS-Append-File "${__filepath}" @" +date-released: `"${__date}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + ## title + if (-not [string]::IsNullOrEmpty($__title)) { + $__process = FS-Append-File "${__filepath}" @" +title: `"${__title}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + ## version + if (-not [string]::IsNullOrEmpty($__version)) { + $__process = FS-Append-File "${__filepath}" @" +version: `"${__version}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + ## license + if (-not [string]::IsNullOrEmpty($__license)) { + $__process = FS-Append-File "${__filepath}" @" +license: `"${__license}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + ## repository + if (-not [string]::IsNullOrEmpty($__repo)) { + $__process = FS-Append-File "${__filepath}" @" +repository: `"${__repo}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + ## repository-code + if (-not [string]::IsNullOrEmpty($__repo_code)) { + $__process = FS-Append-File "${__filepath}" @" +repository-code: `"${__repo_code}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + ## repository-artifact + if (-not [string]::IsNullOrEmpty($__version)) { + $__process = FS-Append-File "${__filepath}" @" +repository-artifact: `"${__repo_artifact}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + ## url + if (-not [string]::IsNullOrEmpty($__contact_website)) { + $__process = FS-Append-File "${__filepath}" @" +url: `"${__contact_website}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + ## contact + if ((-not [string]::IsNullOrEmpty($__contact_name)) -and + ((-not [string]::IsNullOrEmpty($__contact_website)) -or + (-not [string]::IsNullOrEmpty($__contact_email)))) { + $__process = FS-Append-File "${__filepath}" @" +contact: + - affiliation: `"${__contact_name}`" +"@ + if ($__process -ne 0) { + return 1 + } + + if (-not [string]::IsNullOrEmpty($__contact_email)) { + $__process = FS-Append-File "${__filepath}" @" + email: `"${__contact_email}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + + if (-not [string]::IsNullOrEmpty($__contact_website)) { + $__process = FS-Append-File "${__filepath}" @" + website: `"${__contact_website}`" +"@ + if ($__process -ne 0) { + return 1 + } + } + } + + ## abstract + if (Test-Path -Path "${__abstract_filepath}") { + $__process = FS-Append-File "${__filepath}" @" +abstract: |- +"@ + if ($__process -ne 0) { + return 1 + } + + foreach ($__line in (Get-Content "${__abstract_filepath}")) { + if ((-not [string]::IsNullOrEmpty($__line)) -and + [string]::IsNullOrEmpty($__line -replace "#.*$")) { + continue + } + + $__line = $__line -replace '#.*' + if (-not [string]::IsNullOrEmpty($__line)) { + $__line = " ${__line}" + } + + $__process = FS-Append-File "${__filepath}" "${__line}" + if ($__process -ne 0) { + return 1 + } + } + } + + ## other citations + foreach ($__line in (Get-Content "${__citation_filepath}")) { + if ((-not [string]::IsNullOrEmpty($__line)) -and + [string]::IsNullOrEmpty($__line -replace "#.*$")) { + continue + } + + $__line = $__line -replace '#.*' + if ([string]::IsNullOrEmpty($__line)) { + continue + } + + $__process = FS-Append-File "${__filepath}" "${__line}" + if ($__process -ne 0) { + return 1 + } + } + + + # report status + return 0 +} diff --git a/automataCI/services/compilers/citation.sh b/automataCI/services/compilers/citation.sh new file mode 100644 index 00000000..efe96f84 --- /dev/null +++ b/automataCI/services/compilers/citation.sh @@ -0,0 +1,223 @@ +#!/bin/sh +# Copyright 2023 (Holloway) Chew, Kean Ho +# +# 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. +. "${PROJECT_PATH_ROOT}/${PROJECT_PATH_AUTOMATA}/services/io/fs.sh" + + + + +CITATION::build() { + __filepath="$1" + __abstract_filepath="$2" + __citation_filepath="$3" + __cff_version="$4" + __type="$5" + __date="$6" + __title="$7" + __version="$8" + __license="$9" + __repo="${10}" + __repo_code="${11}" + __repo_artifact="${12}" + __contact_name="${13}" + __contact_website="${14}" + __contact_email="${15}" + + + # validate input + if [ -z "$__cff_version" ]; then + return 0 # requested to be disabled + fi + + if [ -z "$__filepath" ] || [ -z "$__title" ] || [ -z "$__type" ]; then + return 1 + fi + + if [ -z "$__citation_filepath" ] || [ ! -f "$__citation_filepath" ]; then + return 1 + fi + + + # execute + FS::remove_silently "$__filepath" + FS::make_housing_directory "$__filepath" + FS::write_file "$__filepath" "\ +# WARNING: auto-generated by AutomataCI + +cff-version: \"${__cff_version}\" +type: \"${__type}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + + ## date + if [ ! -z "$__date" ]; then + FS::append_file "$__filepath" "\ +date-released: \"${__date}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + ## title + if [ ! -z "$__title" ]; then + FS::append_file "$__filepath" "\ +title: \"${__title}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + ## version + if [ ! -z "$__version" ]; then + FS::append_file "$__filepath" "\ +version: \"${__version}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + ## license + if [ ! -z "$__license" ]; then + FS::append_file "$__filepath" "\ +license: \"${__license}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + ## repository + if [ ! -z "$__repo" ]; then + FS::append_file "$__filepath" "\ +repository: \"${__repo}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + ## repository-code + if [ ! -z "$__repo_code" ]; then + FS::append_file "$__filepath" "\ +repository-code: \"${__repo_code}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + ## repository-artifact + if [ ! -z "$__repo_artifact" ]; then + FS::append_file "$__filepath" "\ +repository-artifact: \"${__repo_artifact}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + ## url + if [ ! -z "$__contact_website" ]; then + FS::append_file "$__filepath" "\ +url: \"${__contact_website}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + ## contact + if [ ! -z "$__contact_name" ] && + [ ! -z "$__contact_website" -o ! -z "$__contact_email" ]; then + FS::append_file "$__filepath" "\ +contact: + - affiliation: \"${__contact_name}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + + if [ ! -z "$__contact_email" ]; then + FS::append_file "$__filepath" "\ + email: \"${__contact_email}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + + if [ ! -z "$__contact_website" ]; then + FS::append_file "$__filepath" "\ + website: \"${__contact_website}\" +" + if [ $? -ne 0 ]; then + return 1 + fi + fi + fi + + ## abstract + if [ -f "$__abstract_filepath" ]; then + FS::append_file "$__filepath" "\ +abstract: |- +" + if [ $? -ne 0 ]; then + return 1 + fi + + __old_IFS="$IFS" + while IFS="" read -r __line || [ -n "$__line" ]; do + if [ ! -z "$__line" -a -z "${__line%%#*}" ]; then + continue + fi + + __line="${__line%%#*}" + if [ ! -z "$__line" ]; then + __line=" ${__line}" + fi + + FS::append_file "$__filepath" "${__line}\n" + if [ $? -ne 0 ]; then + return 1 + fi + done < "$__abstract_filepath" + IFS="$__old_IFS" && unset __old_IFS + fi + + ## other citations + __old_IFS="$IFS" + while IFS="" read -r __line || [ -n "$__line" ]; do + if [ ! -z "$__line" -a -z "${__line%%#*}" ]; then + continue + fi + + __line="${__line%%#*}" + if [ -z "$__line" ]; then + continue + fi + + FS::append_file "$__filepath" "${__line}\n" + if [ $? -ne 0 ]; then + return 1 + fi + done < "$__citation_filepath" + IFS="$__old_IFS" && unset __old_IFS + + + # report status + return 0 +} diff --git a/automataCI/services/compilers/deb.ps1 b/automataCI/services/compilers/deb.ps1 index 2f6b65eb..b43a3f12 100644 --- a/automataCI/services/compilers/deb.ps1 +++ b/automataCI/services/compilers/deb.ps1 @@ -260,6 +260,7 @@ Description: ${__pitch} continue } + $__line = $__line -replace '#.*' if ([string]::IsNullOrEmpty($__line)) { $__line = " ." } else { diff --git a/automataCI/services/compilers/rpm.ps1 b/automataCI/services/compilers/rpm.ps1 index 92e3820e..a406970e 100644 --- a/automataCI/services/compilers/rpm.ps1 +++ b/automataCI/services/compilers/rpm.ps1 @@ -255,7 +255,7 @@ URL: ${__website} continue } - $__line = $_ -replace '#.*' + $__line = $__line -replace '#.*' $null = FS-Append-File $__location "${__line}`n" } @@ -268,7 +268,7 @@ URL: ${__website} continue } - $__line = $_ -replace '#.*' + $__line = $__line -replace '#.*' $null = FS-Append-File $__location "${__line}`n" } } else { diff --git a/automataCI/services/io/time.ps1 b/automataCI/services/io/time.ps1 new file mode 100644 index 00000000..62c0098e --- /dev/null +++ b/automataCI/services/io/time.ps1 @@ -0,0 +1,41 @@ +# Copyright 2023 (Holloway) Chew, Kean Ho +# +# 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. +function TIME-Format-ISO8601-Date { + param( + [string]$__epoch + ) + + + # validate input + if ([string]::IsNullOrEmpty($__epoch)) { + return 1 + } + + + # execute + $__t = (Get-Date "1970-01-01 00:00:00.000Z") + ([TimeSpan]::FromSeconds($__epoch)) + return $__t.ToString("yyyy-MM-dd") +} + + + + +function TIME-Is-Available { + return 0 +} + + + + +function TIME-Now { + return Get-Date (Get-Date).ToUniversalTime() -UFormat %s +} diff --git a/automataCI/services/io/time.sh b/automataCI/services/io/time.sh new file mode 100644 index 00000000..88127bbd --- /dev/null +++ b/automataCI/services/io/time.sh @@ -0,0 +1,76 @@ +#!/bin/sh +# Copyright 2023 (Holloway) Chew, Kean Ho +# +# 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. +TIME::format_iso8601_date() { + #__epoch="$1" + + + # validate input + if [ -z "$1" ]; then + printf -- "" + return 1 + fi + + TIME::is_available + if [ $? -ne 0 ]; then + return 1 + fi + + + # execute + if [ "$(echo "$(uname)" | tr '[:upper:]' '[:lower:]')" = "darwin" ]; then + printf -- "%b" "$(date -j -f "%s" "${1}" +"%Y-%m-%d")" + else + printf -- "%b" "$(date --date="@${1}" +"%Y-%m-%d")" + fi + + + # report status + return 0 +} + + + + +TIME::is_available() { + # execute + if [ -z "$(type -t date)" ]; then + return 1 + fi + + + # report status + return 0 +} + + + + +TIME::now() { + # validate input + TIME::is_available + if [ $? -ne 0 ]; then + return 1 + fi + + + # execute + if [ "$(echo "$(uname)" | tr '[:upper:]' '[:lower:]')" = "darwin" ]; then + printf -- "%b" "$(date -j --utc -f %s 1374432952)" + else + printf -- "%b" "$(date --utc +%s)" + fi + + + # report status + return 0 +} diff --git a/src/docs/ABSTRACTS.txt b/src/docs/ABSTRACTS.txt index 22f6b022..2fee3e0b 100644 --- a/src/docs/ABSTRACTS.txt +++ b/src/docs/ABSTRACTS.txt @@ -15,8 +15,22 @@ ################################################################################ # 🠳 Max # ################################################################################ -Your longer description here. New empty line is separated by a -newline as shown below. The packager shall automatically format it -to the required line. +Continuous improvements or integrations (CI) is a nerve system of a +software product production. Leaving the job blindly by outsourcing +to any proprietary 3rd-party CI service provider is a guaranteed +way for being threatened and extorted by any malicious suppliers. +As of year 2021 to 2023, many evidences show that the suppliers +vilely alter their pricing charges after the fact to the point of +legally extorting their customers and destroyed some useful +software entirely. -This is a new line. +Therefore, AutomataCI counters such problem by facilitating CI +functions natively, making it locally available, decentralized, +and redistributable at git repository level. 3rd-party service +providers can only call AutomataCI just like how the developer +performs them locally. This de-risk the software owner by not +completely depending on the service provider, allowing him/her +to switch supplier easily. AutomataCI also facilitates +technology-specific automation customization, capable of +absorbing new changes easily across time. It only uses the +basic POSIX compliant Shell and PowerShell scripts. diff --git a/src/docs/CITATIONS.yml b/src/docs/CITATIONS.yml new file mode 100644 index 00000000..c1312c04 --- /dev/null +++ b/src/docs/CITATIONS.yml @@ -0,0 +1,77 @@ +################################################################################ +# NOTE # +# # +# This is a line-by-line citation data file is aligned to the CITATION.cff # +# file generator where it houses its specific data. You may refer to the # +# following sites for info: # +# 1. https://citation-file-format.github.io/ # +# 2. https://github.com/citation-file-format/citation-file-format # +# # +# Generally, you want to write down the following fields for appending to the # +# CITATION.cff generated by AutomataCI using the repository configurations # +# from CONFIG.toml. Among the supported fields are (and shall be rendered) as # +# follows: # +# 1. cff-version: "${PROJECT_CITATION}" # +# 2. type: "${PROJECT_CITATION_TYPE}" # +# 3. title: "${PROJECT_NAME}" # +# 4. version: "${PROJECT_VERSION}" # +# 5. date-released: "{{ Generated by Processing Release date }}" # +# 6. license: "${PROJECT_LICENSE}" # +# 7. repository: "${PROJECT_SOURCE_URL}" # +# 8. repository-code: "${PROJECT_SOURCE_URL}" # +# 9. repository-artifact: "${PROJECT_STATIC_URL}" # +# 10. url: "${PROJECT_CONTACT_WEBSITE}" # +# 11. contact: # +# - affiliation: "${PROJECT_CONTACT_NAME}" # +# email: "${PROJECT_CONTACT_EMAIL}" # +# website: "${PROJECT_CONTACT_WEBSITE}" # +# 12. abstract: >- # +# {{ Generated by Processing Abstract file }} # +# # +# # +# Hence, begin your appendix below this line. You're free to modify the # +# existing and develop from there. Some COMPULSORY fields are: # +# 1. message: >- # +# Your message here after 2 spacing from the key. Can be as long as you # +# want until then next field. # +# 2. authors: # +# - given-names: "Your Given Name" # +# name-particle: "von" # +# family-names: "Your Family Name" # +# name-suffix: "III" # +# orcid: "https://orcid.org/1234-5678-9101-1121" # +# affiliation: "Company Name OR Independent" # +# email: "your.email@domain.here" # +# fax: "+1-2345-6788" # +# tel: "+1-2345-6789" # +# website: "https://research-project.org" # +# country: "DE" # IMPORTANT: **STRICTLY ISO3166-1 country code** # +# city: "Berlin" # +# - ... ANOTHER AUTHOR/ENTITY ... # +################################################################################ +message: |- + Please cite and reference this repository accordingly. +authors: + - given-names: "Kean Ho" + family-names: "Chew" + email: "hollowaykeanho@gmail.com" + affiliation: "Independent" + orcid: "https://orcid.org/0000-0003-4202-4863" + - given-names: "Cory" + family-names: "Galyna" + email: "124406765+corygalyna@users.noreply.github.com" + affiliation: "Independent" +identifiers: + - type: doi + value: "10.5281/zenodo.000000" + description: "Paper" +keywords: + - "continuous integration" + - "native and locally available" + - "git enhancement" + - "decentralized" + - "redistributable" + - "powershell" + - "posix shell" + - "solid foundation" + - "self-improvable"