Skip to content

Commit

Permalink
root: added DOTNET's nupkg implementations
Browse files Browse the repository at this point in the history
Since DOTNET's nupkg is quite simple to create and to upstream,
it's best we support it from the start. Besides, the Chocolatey
is one of the nupkg implementations so no worries.

This patch adds DOTNET's nupkg implementations 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 28, 2024
1 parent 288912c commit 175320a
Show file tree
Hide file tree
Showing 178 changed files with 14,613 additions and 3,398 deletions.
67 changes: 57 additions & 10 deletions CONFIG.toml
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,15 @@ PROJECT_BOOK = 'srcBOOK'
PROJECT_C = 'srcC'


# PROJECT_C_BRANCH_TAG
# PROJECT_C_ID
# This is for technology tagging purposes such as but not limited to release
# branches identification. The value shall always be lowercase, short, and
# directly identify it is C technology.
# directly identify as a C-based technology.
#
# This field shall not be EMPTY.
#
# Default is: 'c'
# To disable: set it empty ''
PROJECT_C_BRANCH_TAG = 'c'
PROJECT_C_ID = 'c'



Expand Down Expand Up @@ -628,14 +629,15 @@ PROJECT_NODE_VERSION = 'v22.2.0'
PROJECT_NODE_NPM_REGISTRY = 'https://npm.pkg.github.com'


# PROJECT_NODE_BRANCH_TAG
# PROJECT_NODE_NPM_ID
# This is for technology tagging purposes such as but not limited to release
# branches identification. The value shall always be lowercase, short, and
# directly identify it is Node technology.
# directly identify as a Node NPM technology.
#
# This field shall not be EMPTY.
#
# Default is: 'npm'
# To disable: set it empty ''
PROJECT_NODE_BRANCH_TAG = 'npm'
PROJECT_NODE_NPM_ID = 'npm'



Expand Down Expand Up @@ -888,15 +890,25 @@ PROJECT_RELEASE_IPK = 'enabled'
PROJECT_CHOCOLATEY_URL = 'https://github.com/ChewKeanHo/AutomataCI/releases/latest/download'




# PROJECT_CHOCOLATEY_VERSION
# The Chocolatey version as a dependency. This field SHALL NOT BE EMPTY.
#
# Default value is: '0.9.8.21'
PROJECT_CHOCOLATEY_VERSION = '0.9.8.21'


# PROJECT_CHOCOLATEY_ID
# This is for technology tagging purposes such as but not limited to release
# branches identification. The value shall always be lowercase, short, and
# directly identify as Chocolatey technology (including away from the original
# DOTNET nupkg).
#
# This field shall not be EMPTY.
#
# Default is: 'chocolatey'
PROJECT_CHOCOLATEY_ID = 'chocolatey'




#############################
Expand Down Expand Up @@ -1211,6 +1223,17 @@ PROJECT_DOCS_REPO_KEY = 'origin'
PROJECT_DOCS_REPO_BRANCH = 'gh-pages'


# PROJECT_DOCS_ID
# This is for technology tagging purposes such as but not limited to release
# branches identification. The value shall always be lowercase, short, and
# directly identify as a documentation parcel.
#
# This field shall not be EMPTY.
#
# Default is: 'docs'
PROJECT_DOCS_ID = 'docs'




##########################
Expand Down Expand Up @@ -1664,6 +1687,30 @@ PROJECT_MSI_DOCS_COMPONENT_GUID = '7E665EAF-446B-7738-84D9-FE18BE039404'



##########################
# DISTRIBUTION - NUPKG #
##########################
# PROJECT_NUPKG_URL
# The registry url for publishing the DOTNET .nupkg package file. More info:
# (1) https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry
# (2) https://learn.microsoft.com/en-us/nuget/api/package-publish-resource
# (3) https://learn.microsoft.com/en-us/nuget/api/overview
#
# Some examples:
# (1) GitHub Package: 'https://nuget.pkg.github.com/[USERNAME]'
# (2) Nuget.org : 'https://www.nuget.org/api/v2/package'
#
# This field also acts as the flag for enabling or disabling the nupkg pipeline.
#
# To enable : fill in the end-user downloadable URL without ending slash.
# To disable: leave this field empty ('').
#
# !! IMPORTANT !! - Please avoid ending with the URL slash.
PROJECT_NUPKG_URL = 'https://nuget.pkg.github.com/ChewKeanHo'




##########################
# DISTRIBUTION - RPM #
##########################
Expand Down
11 changes: 11 additions & 0 deletions automataCI/SECRETS-template.toml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ NPM_TOKEN = ""



######################
# NUPKG TECHNOLOGY #
######################
# NUPKG_TOKEN
# The Authentication token (e.g. 'Authentication: ' or 'X-NuGet-ApiKey: ') for
# logging into the corresponding NUPKG registry defined in the CONFIG.toml.
NUPKG_TOKEN = ""




######################
# PYTHON TECHNOLOGY #
######################
Expand Down
131 changes: 131 additions & 0 deletions automataCI/__package-assemble-archive_unix-any.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
#!/bin/sh
# Copyright 2023 (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.




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

. "${LIBS_AUTOMATACI}/services/hestiaRUST/Vanilla.sh.ps1"
. "${LIBS_AUTOMATACI}/services/hestiaCONSOLE/Vanilla.sh.ps1"
. "${LIBS_AUTOMATACI}/services/hestiaFS/Vanilla.sh.ps1"
. "${LIBS_AUTOMATACI}/services/hestiaKERNEL/Vanilla.sh.ps1"
. "${LIBS_AUTOMATACI}/services/hestiaNPM/Vanilla.sh.ps1"
. "${LIBS_AUTOMATACI}/services/hestiaTAR/Vanilla.sh.ps1"
. "${LIBS_AUTOMATACI}/services/hestiaWASM/Vanilla.sh.ps1"
. "${LIBS_AUTOMATACI}/services/hestiaZIP/Vanilla.sh.ps1"




PACKAGE_Assemble_As_ARCHIVE() {
_target="$1"
_directory="$2"
_target_name="$3"
_target_os="$4"
_target_arch="$5"


# determine unpack destination
if [ $(hestiaFS_Is_Filename_Has "$_target" "-docs") -eq $hestiaKERNEL_ERROR_OK ]; then
__dest="${_directory}/docs"
elif [ $(hestiaFS_Is_Filename_Has "$_target" "-lib") -eq $hestiaKERNEL_ERROR_OK ] ||
[ $(hestiaFS_Is_Filename_Has "$_target" "lib") -eq $hestiaKERNEL_ERROR_OK ]; then
__dest="${_directory}/lib"

if [ $(hestiaNPM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ] ||
[ $(hestiaRUST_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then
__dest="$_directory" # distribution oriented libraries
fi
elif [ $(hestiaWASM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then
__dest="${_directory}/assets"
else
__dest="${_directory}/bin"
if [ $(hestiaTAR_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ] ||
[ $(hestiaZIP_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then
__dest="$_directory"
fi
fi


# assemble based on target's nature
if [ $(hestiaTAR_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then
# unpack tar*
hestiaCONSOLE_Log_Assemble "$__dest" "$_target"
hestiaFS_Create_Directory "$__dest"
hestiaTAR_Unpack "$__dest" "$_target"
if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then
hestiaCONSOLE_Log_Assemble_Failed
return $hestiaKERNEL_ERROR_BAD_EXEC
fi
elif [ $(hestiaZIP_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then
# unpack zip
hestiaCONSOLE_Log_Assemble "$__dest" "$_target"
hestiaFS_Create_Directory "$__dest"
hestiaZIP_Unpack "$__dest" "$_target"
if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then
hestiaCONSOLE_Log_Assemble_Failed
return $hestiaKERNEL_ERROR_BAD_EXEC
fi
else
# assemble standalone file
___filename="$(hestiaFS_Get_File "$_target")"
if [ "$__dest" = "${_directory}/bin" ]; then
___filename="${PROJECT_SKU}"
if [ "$_target_os" = "windows" ]; then
___filename="${___filename}.exe"
fi
fi

hestiaCONSOLE_Log_Assemble "${__dest}/${___filename}" "$_target"
hestiaFS_Create_Directory "$__dest"
hestiaFS_Copy_File "${__dest}/${___filename}" "$_target"
if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then
hestiaCONSOLE_Log_Assemble_Failed
return $hestiaKERNEL_ERROR_BAD_EXEC
fi

# if it is WASM artifact, then check for its gluing js script
# whenever available.
if [ $(hestiaWASM_Is_Target_Valid "$_target") -eq $hestiaKERNEL_ERROR_OK ]; then
__source="$(hestiaFS_Replace_Extension "$_target" ".wasm" ".js")"
if [ $(hestiaFS_Is_File "$__source") -eq $hestiaKERNEL_ERROR_OK ]; then
__dest="${__dest}/$(FS_Get_File "$__source")"
hestiaCONSOLE_Log_Assemble "$__dest" "$_target"
hestiaFS_Copy_File \
"${__dest}/$(hestiaFS_Get_File "$_target")" \
"$_target"
if [ $? -ne $hestiaKERNEL_ERROR_OK ]; then
hestiaCONSOLE_Log_Assemble_Failed
return $hestiaKERNEL_ERROR_BAD_EXEC
fi
fi
fi
fi


# sanitize check before proceeding
hestiaCONSOLE_Log_Check "$_directory"
if [ $(hestiaFS_Is_Directory_Empty "$_directory") -eq 0 ]; then
hestiaCONSOLE_Log_Check_Failed
return $hestiaKERNEL_ERROR_BAD_EXEC
fi


# report status
return $hestiaKERNEL_ERROR_OK
}
Loading

0 comments on commit 175320a

Please sign in to comment.